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

fix saveAs parameter for publishDir directive #529

Merged
merged 2 commits into from
Apr 29, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#454](https://github.com/nf-core/sarek/pull/454) - Input is optional (can actually be found automatically by `Sarek` if previously run)
- [#463](https://github.com/nf-core/sarek/pull/463), [#468](https://github.com/nf-core/sarek/pull/468) - Fix `nf-core lint`
- [#513](https://github.com/nf-core/sarek/pull/513), [#527](https://github.com/nf-core/sarek/pull/527) - CNV is back
- [#529](https://github.com/nf-core/sarek/pull/529) - Do not save `versions.yml` files

### Deprecated

Expand Down
94 changes: 56 additions & 38 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ process {
[
path: { "${params.outdir}/reports/trimgalore/${meta.id}/fastqc" },
mode: params.publish_dir_mode,
pattern: "*.{html,zip}"
pattern: "*{html,zip}"
],
[
path: { "${params.outdir}/trimgalore/${meta.id}" },
mode: params.publish_dir_mode,
pattern: "*.fq.gz"
pattern: "*fq.gz"
],
[
path: { "${params.outdir}/reports/trimgalore/${meta.id}" },
mode: params.publish_dir_mode,
pattern: "*.txt"
pattern: "*txt"
]
]
}
Expand Down Expand Up @@ -244,8 +244,9 @@ process {
ext.when = { params.split_fastq > 1 }
publishDir = [
enabled: params.save_split_fastqs,
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/${meta.sample}/seqkit" },
mode: params.publish_dir_mode
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand Down Expand Up @@ -273,7 +274,7 @@ process {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/${meta.id}/mapped" },
pattern: "*.bam",
pattern: "*bam",
saveAs: { (params.save_bam_mapped || (params.skip_tools && params.skip_tools.contains('markduplicates'))) && (meta.size * meta.numLanes == 1) ? it : null }
]
}
Expand All @@ -293,24 +294,21 @@ process {

// MARKDUPLICATES

withName: 'GATK4_ESTIMATELIBRARYCOMPLEXITY' {
withName: 'GATK4_ESTIMATELIBRARYCOMPLEXITY|GATK4_MARKDUPLICATES' {
ext.prefix = { "${meta.id}.md" }
ext.when = { !(params.skip_tools && params.skip_tools.contains('markduplicates_report')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/${meta.id}/markduplicates" },
pattern: "*metrics"
path: { "${params.outdir}/reports/${meta.id}/markduplicates" },
pattern: "metrics"
]
}

withName: 'GATK4_ESTIMATELIBRARYCOMPLEXITY' {
ext.when = { !(params.skip_tools && params.skip_tools.contains('markduplicates_report')) }
}

withName: 'GATK4_MARKDUPLICATES' {
ext.args = '-REMOVE_DUPLICATES false -VALIDATION_STRINGENCY LENIENT --CREATE_INDEX true'
ext.prefix = { "${meta.id}.md" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/${meta.id}/markduplicates" },
pattern: "*metrics"
]
}

withName: 'GATK4_MARKDUPLICATES_SPARK' {
Expand Down Expand Up @@ -351,7 +349,7 @@ process {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/${meta.id}/recal_table" },
pattern: "*.table"
pattern: "*table"
]
}

Expand Down Expand Up @@ -398,7 +396,7 @@ process {
[
path: { "${params.outdir}/reports/fastqc/${meta.id}" },
mode: params.publish_dir_mode,
pattern: "*.{html,zip}"
pattern: "*{html,zip}"
]
]
}
Expand All @@ -409,23 +407,26 @@ process {
ext.when = { !(params.skip_tools && params.skip_tools.contains('bamqc')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/qualimap/${meta.id}" }
path: { "${params.outdir}/reports/qualimap/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'SAMTOOLS_STATS' {
ext.when = { !(params.skip_tools && params.skip_tools.contains('samtools')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/samtools_stats/${meta.id}" }
path: { "${params.outdir}/reports/samtools_stats/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'DEEPTOOLS_BAMCOVERAGE' {
ext.when = { !(params.skip_tools && params.skip_tools.contains('deeptools')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/deeptools/${meta.id}" }
path: { "${params.outdir}/reports/deeptools/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -435,15 +436,17 @@ process {
ext.when = { !(params.skip_tools && params.skip_tools.contains('bamqc')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/qualimap/${meta.id}" }
path: { "${params.outdir}/reports/qualimap/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'NFCORE_SAREK:SAREK:CRAM_QC:SAMTOOLS_STATS' {
ext.when = { !(params.skip_tools && params.skip_tools.contains('samtools')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/samtools_stats/${meta.id}" }
path: { "${params.outdir}/reports/samtools_stats/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}
Expand Down Expand Up @@ -502,7 +505,8 @@ process{
publishDir = [
enabled: !params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" }
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'FREEBAYES' {
Expand All @@ -511,13 +515,15 @@ process{
publishDir = [
enabled: params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" }
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName : 'TABIX_VC_FREEBAYES' {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" }
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -527,7 +533,8 @@ process{
publishDir = [
enabled: !params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller" }
path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'HAPLOTYPECALLER' {
Expand Down Expand Up @@ -630,7 +637,7 @@ process{
enabled: !params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" },
pattern: "*{mpileup}"
pattern: "*mpileup"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whys is the saveAs thing not here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because pattern

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you don't need it when you have a pattern, then the yml does not match it and thus is not published

]
}

Expand Down Expand Up @@ -680,7 +687,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" },
pattern: "*{.bed}"
pattern: "*bed"
]
}

Expand All @@ -689,7 +696,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" },
pattern: "*{.circos.txt}"
pattern: "*circos.txt"
]
}

Expand All @@ -698,7 +705,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" },
pattern: "*{png}"
pattern: "*png"
]
}

Expand All @@ -708,7 +715,7 @@ process{
enabled: params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" },
pattern: "*{mpileup}"
pattern: "*mpileup"
]
}

Expand All @@ -721,7 +728,8 @@ process{
withName: 'GATK4_CALCULATECONTAMINATION' {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" }
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -738,7 +746,8 @@ process{
ext.prefix = {"${meta.id}.filtered"}
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" }
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -748,23 +757,26 @@ process{
publishDir = [
enabled: !params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" }
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'GETPILEUPSUMMARIES.*' {
publishDir = [
enabled: params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" }
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'MERGEMUTECTSTATS' {
ext.prefix = { "${meta.id}.vcf.gz" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" }
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand Down Expand Up @@ -865,6 +877,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -874,8 +887,9 @@ process{
enabled: !params.no_intervals,
mode: params.publish_dir_mode,
//use ${meta.tumor_id}_vs_${meta_normal_id} to publish in the same directory as the remainders of the
//somatic output whilst keeping the filename prefix identifieable for status type
path: { "${params.outdir}/variant_calling/${meta.tumor_id}_vs_${meta.normal_id}/mutect2" }
//somatic output whilst keeping the filename prefix identifiable for status type
path: { "${params.outdir}/variant_calling/${meta.tumor_id}_vs_${meta.normal_id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -884,6 +898,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -892,6 +907,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/msisensorpro" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -910,6 +926,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/bcftools" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand All @@ -919,6 +936,7 @@ process{
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/vcftools" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

Expand Down