Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid collision in MultiQC #38

Merged
merged 7 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Initial release of `nf-core/sarek`, created with the [nf-core](http://nf-co.re/)
- [#35](https://github.com/nf-core/sarek/pull/35) - Refactor references handling
- [#35](https://github.com/nf-core/sarek/pull/35) - use Channel values instead of `referenceMap`
- [#37](https://github.com/nf-core/sarek/pull/37) - Bump version for Release
- [#38](https://github.com/nf-core/sarek/pull/38) - File names before merge is based on `${idSample}_${idRun}` instead of `${idRun}`

### `Removed`

Expand Down Expand Up @@ -123,6 +124,7 @@ Initial release of `nf-core/sarek`, created with the [nf-core](http://nf-co.re/)
- [#31](https://github.com/nf-core/sarek/pull/31) - Fix badges according to nf-core lint
- [#31](https://github.com/nf-core/sarek/pull/31) - Fix rcolorbrewer version according to nf-core lint
- [#33](https://github.com/nf-core/sarek/pull/33) - Fix MD Linting
- [#38](https://github.com/nf-core/sarek/pull/38) - Avoid collision in MultiQC

### `Deprecated`

Expand Down
41 changes: 18 additions & 23 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -594,19 +594,19 @@ process FastQCFQ {

tag {idPatient + "-" + idRun}

publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idRun}", mode: params.publishDirMode
publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idSample}_${idRun}", mode: params.publishDirMode

input:
set idPatient, idSample, idRun, file("${idRun}_R1.fastq.gz"), file("${idRun}_R2.fastq.gz") from inputPairReadsFastQC
set idPatient, idSample, idRun, file("${idSample}_${idRun}_R1.fastq.gz"), file("${idSample}_${idRun}_R2.fastq.gz") from inputPairReadsFastQC

output:
file "*_fastqc.{zip,html}" into fastQCFQReport
file("*.{html,zip}") into fastQCFQReport

when: step == 'mapping' && !('fastqc' in skipQC)

script:
"""
fastqc -t 2 -q ${idRun}_R1.fastq.gz ${idRun}_R2.fastq.gz
fastqc -t 2 -q ${idSample}_${idRun}_R1.fastq.gz ${idSample}_${idRun}_R2.fastq.gz
"""
}

Expand All @@ -615,19 +615,19 @@ process FastQCBAM {

tag {idPatient + "-" + idRun}

publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idRun}", mode: params.publishDirMode
publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idSample}_${idRun}", mode: params.publishDirMode

input:
set idPatient, idSample, idRun, file("${idRun}.bam") from inputBAMFastQC
set idPatient, idSample, idRun, file("${idSample}_${idRun}.bam") from inputBAMFastQC

output:
file "*_fastqc.{zip,html}" into fastQCBAMReport
file("*.{html,zip}") into fastQCBAMReport

when: step == 'mapping' && !('fastqc' in skipQC)

script:
"""
fastqc -t 2 -q "${idRun}.bam"
fastqc -t 2 -q ${idSample}_${idRun}.bam
"""
}

Expand All @@ -648,8 +648,8 @@ process MapReads {
file(fasta) from ch_fasta

output:
set idPatient, idSample, idRun, file("${idRun}.bam") into bamMapped
set idPatient, idSample, file("${idRun}.bam") into bamMappedBamQC
set idPatient, idSample, idRun, file("${idSample}_${idRun}.bam") into bamMapped
set idPatient, idSample, file("${idSample}_${idRun}.bam") into bamMappedBamQC

when: step == 'mapping'

Expand All @@ -670,7 +670,7 @@ process MapReads {
${convertToFastq}
bwa mem -K 100000000 -R \"${readGroup}\" ${extra} -t ${task.cpus} -M ${fasta} \
${input} | \
samtools sort --threads ${task.cpus} -m 2G - > ${idRun}.bam
samtools sort --threads ${task.cpus} -m 2G - > ${idSample}_${idRun}.bam
"""
}

Expand Down Expand Up @@ -2361,24 +2361,19 @@ compressVCFOutVEP = compressVCFOutVEP.dump(tag:'VCF')

// STEP MULTIQC

multiQCReport = Channel.empty()
.mix(
bamQCReport,
bcftoolsReport,
fastQCReport,
markDuplicatesReport,
samtoolsStatsReport,
snpeffReport,
vcftoolsReport
).collect()

process MultiQC {
publishDir "${params.outdir}/Reports/MultiQC", mode: params.publishDirMode

input:
file (multiqcConfig) from Channel.value(params.multiqc_config ? file(params.multiqc_config) : "")
file (reports) from multiQCReport
file (versions) from yamlSoftwareVersion
file ('bamQC/*') from bamQCReport.collect().ifEmpty([])
file ('BCFToolsStats/*') from bcftoolsReport.collect().ifEmpty([])
file ('FastQC/*') from fastQCReport.collect().ifEmpty([])
file ('MarkDuplicates/*') from markDuplicatesReport.collect().ifEmpty([])
file ('SamToolsStats/*') from samtoolsStatsReport.collect().ifEmpty([])
file ('snpEff/*') from snpeffReport.collect().ifEmpty([])
file ('VCFTools/*') from vcftoolsReport.collect().ifEmpty([])

output:
set file("*multiqc_report.html"), file("*multiqc_data") into multiQCOut
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ profiles {
singularity.enabled = false
}
singularity {
autoMounts = true
docker.enabled = false
singularity.enabled = true
}
Expand Down