From df60b0cea996348772ee9b32df1c0a179975bdd8 Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 28 Mar 2023 13:50:46 +0200 Subject: [PATCH 1/8] allow ploidy as list --- conf/modules/controlfreec.config | 1 - modules.json | 3 ++- .../makegraph/controlfreec-makegraph.diff | 23 +++++++++++++++++++ .../nf-core/controlfreec/makegraph/main.nf | 4 ++-- .../bam_variant_calling_somatic_all/main.nf | 4 +++- .../main.nf | 3 ++- .../main.nf | 4 +++- .../main.nf | 3 ++- 8 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff diff --git a/conf/modules/controlfreec.config b/conf/modules/controlfreec.config index 3945756957..c853241204 100644 --- a/conf/modules/controlfreec.config +++ b/conf/modules/controlfreec.config @@ -51,7 +51,6 @@ process { } withName: 'MAKEGRAPH' { - ext.args = { "${params.cf_ploidy}" } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" }, diff --git a/modules.json b/modules.json index d6c2f040e8..55fbbc6df6 100644 --- a/modules.json +++ b/modules.json @@ -98,7 +98,8 @@ "controlfreec/makegraph": { "branch": "master", "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff" }, "custom/dumpsoftwareversions": { "branch": "master", diff --git a/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff b/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff new file mode 100644 index 0000000000..d6d0bd1a6f --- /dev/null +++ b/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff @@ -0,0 +1,23 @@ +Changes in module 'nf-core/controlfreec/makegraph' +--- modules/nf-core/controlfreec/makegraph/main.nf ++++ modules/nf-core/controlfreec/makegraph/main.nf +@@ -8,7 +8,7 @@ + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: +- tuple val(meta), path(ratio), path(baf) ++ tuple val(meta), path(ratio), path(baf), val(ploidy) + + output: + tuple val(meta), path("*_BAF.png") , emit: png_baf +@@ -25,7 +25,7 @@ + def prefix = task.ext.prefix ?: "${meta.id}" + def baf = baf ?: "" + """ +- cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} ++ cat \$(which makeGraph.R) | R --slave --args ${ploidy} ${args} ${ratio} ${baf} + + mv *_BAF.txt.png ${prefix}_BAF.png + mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png + +************************************************************ diff --git a/modules/nf-core/controlfreec/makegraph/main.nf b/modules/nf-core/controlfreec/makegraph/main.nf index 3c9afe5b3e..92abff46b1 100644 --- a/modules/nf-core/controlfreec/makegraph/main.nf +++ b/modules/nf-core/controlfreec/makegraph/main.nf @@ -8,7 +8,7 @@ process CONTROLFREEC_MAKEGRAPH { 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" input: - tuple val(meta), path(ratio), path(baf) + tuple val(meta), path(ratio), path(baf), val(ploidy) output: tuple val(meta), path("*_BAF.png") , emit: png_baf @@ -25,7 +25,7 @@ process CONTROLFREEC_MAKEGRAPH { def prefix = task.ext.prefix ?: "${meta.id}" def baf = baf ?: "" """ - cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} + cat \$(which makeGraph.R) | R --slave --args ${ploidy} ${args} ${ratio} ${baf} mv *_BAF.txt.png ${prefix}_BAF.png mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png diff --git a/subworkflows/local/bam_variant_calling_somatic_all/main.nf b/subworkflows/local/bam_variant_calling_somatic_all/main.nf index df7f637886..6062a1b12e 100644 --- a/subworkflows/local/bam_variant_calling_somatic_all/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_all/main.nf @@ -93,6 +93,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { mpileup_pair = mpileup_normal.cross(mpileup_tumor).map{ normal, tumor -> [ normal[0], normal[1], tumor[1], [], [], [], [] ] } length_file = cf_chrom_len ?: fasta_fai + ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',') BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC( mpileup_pair, @@ -102,7 +103,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { dbsnp_tbi, chr_files, mappability, - intervals_bed_combined + intervals_bed_combined, + ploidy ) versions = versions.mix(MPILEUP_NORMAL.out.versions) diff --git a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf index 15e2dcc31f..df24c7a69d 100644 --- a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf @@ -14,6 +14,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { chr_files // channel: [mandatory] mappability // channel: [mandatory] intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS + ploidy // channel: [mandatory] list of ploidy values main: @@ -24,7 +25,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_SOMATIC.out.CNV.join(FREEC_SOMATIC.out.ratio)) FREEC2BED(FREEC_SOMATIC.out.ratio) FREEC2CIRCOS(FREEC_SOMATIC.out.ratio) - MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF)) + MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF).combine(ploidy)) ch_versions = ch_versions.mix(FREEC_SOMATIC.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf index 9e5956e2d9..0049e2e9e6 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf @@ -60,6 +60,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { // CONTROLFREEC (depends on MPILEUP) if (tools.split(',').contains('controlfreec')) { length_file = cf_chrom_len ?: fasta_fai + ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',') BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC( // Remap channel to match module/subworkflow @@ -70,7 +71,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { dbsnp_tbi, chr_files, mappability, - intervals_bed_combined + intervals_bed_combined, + ploidy ) versions = versions.mix(BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf index b044360e9d..960a43d039 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf @@ -14,6 +14,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { chr_files // channel: [mandatory] mappability // channel: [mandatory] intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS + ploidy // channel: [mandatory] list of ploidy values main: @@ -24,7 +25,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_TUMORONLY.out.CNV.join(FREEC_TUMORONLY.out.ratio)) FREEC2BED(FREEC_TUMORONLY.out.ratio) FREEC2CIRCOS(FREEC_TUMORONLY.out.ratio) - MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF)) + MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF).combine(ploidy)) ch_versions = ch_versions.mix(FREEC_TUMORONLY.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) From ddfe115071e16843019d4b38fbb35638cf1129d7 Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 28 Mar 2023 14:13:36 +0200 Subject: [PATCH 2/8] rename output according to ploidy --- conf/modules/controlfreec.config | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/modules/controlfreec.config b/conf/modules/controlfreec.config index c853241204..d0c4f246f9 100644 --- a/conf/modules/controlfreec.config +++ b/conf/modules/controlfreec.config @@ -51,6 +51,7 @@ process { } withName: 'MAKEGRAPH' { + ext.prefix = { "${meta.id}_ploidy_${ploidy}" } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" }, From 383d62c6712ef02a4c25915f9292c8a1baaf77c4 Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 28 Mar 2023 14:17:11 +0200 Subject: [PATCH 3/8] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 220faee57a..c72175fcdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#927](https://github.com/nf-core/sarek/pull/927) - Fix tumor only variant calling issues with freebayes following [#896](https://github.com/nf-core/sarek/pull/896) - [#929](https://github.com/nf-core/sarek/pull/929) - Fix somatic variant calling issues with msisensor following [#896](https://github.com/nf-core/sarek/pull/896) - [#941](https://github.com/nf-core/sarek/pull/941) - Fix json validation for `tools`, `skip_tools` and `use_gatk_spark` [#892](https://github.com/nf-core/sarek/issues/892) +- [#980](https://github.com/nf-core/sarek/pull/941) - Fix allowing multiple ploidy values for plotting of controlfreec output ([#808](https://github.com/nf-core/sarek/issues/808)) ### Deprecated From 75f1ffe703154ba9f98059d6e4be26ea5d6e9862 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 29 Mar 2023 10:34:57 +0200 Subject: [PATCH 4/8] Reading the docs help, the ploidy is inferred by the script --- modules.json | 3 +-- .../makegraph/controlfreec-makegraph.diff | 23 ------------------- .../nf-core/controlfreec/makegraph/main.nf | 2 +- .../bam_variant_calling_somatic_all/main.nf | 4 +--- .../main.nf | 3 +-- .../main.nf | 4 +--- .../main.nf | 2 +- 7 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff diff --git a/modules.json b/modules.json index ff9e9e4c35..d2a1641a00 100644 --- a/modules.json +++ b/modules.json @@ -98,8 +98,7 @@ "controlfreec/makegraph": { "branch": "master", "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", - "installed_by": ["modules"], - "patch": "modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff" + "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { "branch": "master", diff --git a/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff b/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff deleted file mode 100644 index d6d0bd1a6f..0000000000 --- a/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff +++ /dev/null @@ -1,23 +0,0 @@ -Changes in module 'nf-core/controlfreec/makegraph' ---- modules/nf-core/controlfreec/makegraph/main.nf -+++ modules/nf-core/controlfreec/makegraph/main.nf -@@ -8,7 +8,7 @@ - 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" - - input: -- tuple val(meta), path(ratio), path(baf) -+ tuple val(meta), path(ratio), path(baf), val(ploidy) - - output: - tuple val(meta), path("*_BAF.png") , emit: png_baf -@@ -25,7 +25,7 @@ - def prefix = task.ext.prefix ?: "${meta.id}" - def baf = baf ?: "" - """ -- cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} -+ cat \$(which makeGraph.R) | R --slave --args ${ploidy} ${args} ${ratio} ${baf} - - mv *_BAF.txt.png ${prefix}_BAF.png - mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png - -************************************************************ diff --git a/modules/nf-core/controlfreec/makegraph/main.nf b/modules/nf-core/controlfreec/makegraph/main.nf index 92abff46b1..b4cde2a661 100644 --- a/modules/nf-core/controlfreec/makegraph/main.nf +++ b/modules/nf-core/controlfreec/makegraph/main.nf @@ -8,7 +8,7 @@ process CONTROLFREEC_MAKEGRAPH { 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" input: - tuple val(meta), path(ratio), path(baf), val(ploidy) + tuple val(meta), path(ratio), path(baf) output: tuple val(meta), path("*_BAF.png") , emit: png_baf diff --git a/subworkflows/local/bam_variant_calling_somatic_all/main.nf b/subworkflows/local/bam_variant_calling_somatic_all/main.nf index 7c7933c903..cc29e4b3a5 100644 --- a/subworkflows/local/bam_variant_calling_somatic_all/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_all/main.nf @@ -93,7 +93,6 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { mpileup_pair = mpileup_normal.cross(mpileup_tumor).map{ normal, tumor -> [ normal[0], normal[1], tumor[1], [], [], [], [] ] } length_file = cf_chrom_len ?: fasta_fai - ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',') BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC( mpileup_pair, @@ -103,8 +102,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { dbsnp_tbi, chr_files, mappability, - intervals_bed_combined, - ploidy + intervals_bed_combined ) versions = versions.mix(MPILEUP_NORMAL.out.versions) diff --git a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf index 9ca08da3a1..93b91e605a 100644 --- a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf @@ -14,7 +14,6 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { chr_files // channel: [mandatory] mappability // channel: [mandatory] intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS - ploidy // channel: [mandatory] list of ploidy values main: @@ -25,7 +24,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_SOMATIC.out.CNV.join(FREEC_SOMATIC.out.ratio, failOnDuplicate: true, failOnMismatch: true)) FREEC2BED(FREEC_SOMATIC.out.ratio) FREEC2CIRCOS(FREEC_SOMATIC.out.ratio) - MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true).combine(ploidy)) + MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true)) ch_versions = ch_versions.mix(FREEC_SOMATIC.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf index 0049e2e9e6..9e5956e2d9 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf @@ -60,7 +60,6 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { // CONTROLFREEC (depends on MPILEUP) if (tools.split(',').contains('controlfreec')) { length_file = cf_chrom_len ?: fasta_fai - ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',') BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC( // Remap channel to match module/subworkflow @@ -71,8 +70,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { dbsnp_tbi, chr_files, mappability, - intervals_bed_combined, - ploidy + intervals_bed_combined ) versions = versions.mix(BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf index 4da0346edb..a3e26ccbd0 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf @@ -25,7 +25,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_TUMORONLY.out.CNV.join(FREEC_TUMORONLY.out.ratio, failOnDuplicate: true, failOnMismatch: true)) FREEC2BED(FREEC_TUMORONLY.out.ratio) FREEC2CIRCOS(FREEC_TUMORONLY.out.ratio) - MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true).combine(ploidy)) + MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true)) ch_versions = ch_versions.mix(FREEC_TUMORONLY.out.versions) From 37c781943536dcf7cc5660f6b36d6ccdaa65b9d7 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 29 Mar 2023 10:38:25 +0200 Subject: [PATCH 5/8] remove changes --- conf/modules/controlfreec.config | 1 - .../local/bam_variant_calling_tumor_only_controlfreec/main.nf | 2 -- 2 files changed, 3 deletions(-) diff --git a/conf/modules/controlfreec.config b/conf/modules/controlfreec.config index d0c4f246f9..c853241204 100644 --- a/conf/modules/controlfreec.config +++ b/conf/modules/controlfreec.config @@ -51,7 +51,6 @@ process { } withName: 'MAKEGRAPH' { - ext.prefix = { "${meta.id}_ploidy_${ploidy}" } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" }, diff --git a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf index a3e26ccbd0..42e0b0567c 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf @@ -14,7 +14,6 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { chr_files // channel: [mandatory] mappability // channel: [mandatory] intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS - ploidy // channel: [mandatory] list of ploidy values main: @@ -27,7 +26,6 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { FREEC2CIRCOS(FREEC_TUMORONLY.out.ratio) MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true)) - ch_versions = ch_versions.mix(FREEC_TUMORONLY.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) ch_versions = ch_versions.mix(FREEC2BED.out.versions) From 4a0ec2410dbf7904515e2e90238150bfbbafa085 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 29 Mar 2023 10:40:14 +0200 Subject: [PATCH 6/8] remove changes --- modules/nf-core/controlfreec/makegraph/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/controlfreec/makegraph/main.nf b/modules/nf-core/controlfreec/makegraph/main.nf index b4cde2a661..3c9afe5b3e 100644 --- a/modules/nf-core/controlfreec/makegraph/main.nf +++ b/modules/nf-core/controlfreec/makegraph/main.nf @@ -25,7 +25,7 @@ process CONTROLFREEC_MAKEGRAPH { def prefix = task.ext.prefix ?: "${meta.id}" def baf = baf ?: "" """ - cat \$(which makeGraph.R) | R --slave --args ${ploidy} ${args} ${ratio} ${baf} + cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} mv *_BAF.txt.png ${prefix}_BAF.png mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png From 91ad68051f7ad3334a2b6e61027b9018cce8a016 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Wed, 29 Mar 2023 10:13:25 +0000 Subject: [PATCH 7/8] [automated] Fix linting with Prettier --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a522c693..1ce77cfc12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#954](https://github.com/nf-core/sarek/pull/954) - Fix missing annotation keys with snpeff and ensemblvep for `hg19` - [#957](https://github.com/nf-core/sarek/pull/957) - Add `failOnDuplicate` and `failOnMismatch` options to all `join()` operator where it was possible - [#980](https://github.com/nf-core/sarek/pull/941) - Fix allowing multiple ploidy values for plotting of controlfreec output ([#808](https://github.com/nf-core/sarek/issues/808)) + ### Deprecated ### Removed From 08d314b106cb805557df57842d8c35db428b9885 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 29 May 2023 12:49:10 +0200 Subject: [PATCH 8/8] need ploidy as mandatory args afterall or channel magic won't work --- modules/nf-core/controlfreec/makegraph/main.nf | 4 ++-- subworkflows/local/bam_variant_calling_somatic_all/main.nf | 4 +++- .../local/bam_variant_calling_somatic_controlfreec/main.nf | 3 ++- subworkflows/local/bam_variant_calling_tumor_only_all/main.nf | 4 +++- .../local/bam_variant_calling_tumor_only_controlfreec/main.nf | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/controlfreec/makegraph/main.nf b/modules/nf-core/controlfreec/makegraph/main.nf index 293cf1feaa..91231ad8c7 100644 --- a/modules/nf-core/controlfreec/makegraph/main.nf +++ b/modules/nf-core/controlfreec/makegraph/main.nf @@ -8,7 +8,7 @@ process CONTROLFREEC_MAKEGRAPH { 'biocontainers/control-freec:11.6--h1b792b2_1' }" input: - tuple val(meta), path(ratio), path(baf) + tuple val(meta), path(ratio), path(baf), val(ploidy) output: tuple val(meta), path("*_BAF.png") , emit: png_baf @@ -25,7 +25,7 @@ process CONTROLFREEC_MAKEGRAPH { def prefix = task.ext.prefix ?: "${meta.id}" def baf = baf ?: "" """ - cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} + cat \$(which makeGraph.R) | R --slave --args ${ploidy} ${args} ${ratio} ${baf} mv *_BAF.txt.png ${prefix}_BAF.png mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png diff --git a/subworkflows/local/bam_variant_calling_somatic_all/main.nf b/subworkflows/local/bam_variant_calling_somatic_all/main.nf index 0644a5cbb4..d2834eb500 100644 --- a/subworkflows/local/bam_variant_calling_somatic_all/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_all/main.nf @@ -92,6 +92,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { mpileup_pair = mpileup_normal.cross(mpileup_tumor).map{ normal, tumor -> [ normal[0], normal[1], tumor[1], [], [], [], [] ] } length_file = cf_chrom_len ?: fasta_fai + ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',') BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC( mpileup_pair, @@ -101,7 +102,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { dbsnp_tbi, chr_files, mappability, - intervals_bed_combined + intervals_bed_combined, + ploidy ) versions = versions.mix(MPILEUP_NORMAL.out.versions) diff --git a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf index 93b91e605a..9ca08da3a1 100644 --- a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf @@ -14,6 +14,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { chr_files // channel: [mandatory] mappability // channel: [mandatory] intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS + ploidy // channel: [mandatory] list of ploidy values main: @@ -24,7 +25,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_SOMATIC.out.CNV.join(FREEC_SOMATIC.out.ratio, failOnDuplicate: true, failOnMismatch: true)) FREEC2BED(FREEC_SOMATIC.out.ratio) FREEC2CIRCOS(FREEC_SOMATIC.out.ratio) - MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true)) + MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true).combine(ploidy)) ch_versions = ch_versions.mix(FREEC_SOMATIC.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf index 8507899366..99c59d7edf 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf @@ -60,6 +60,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { // CONTROLFREEC (depends on MPILEUP) if (tools.split(',').contains('controlfreec')) { length_file = cf_chrom_len ?: fasta_fai + ploidy = params.cf_ploidy && !params.cf_ploidy.toString().contains(",") ? [params.cf_ploidy] : params.cf_ploidy.split(',') BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC( // Remap channel to match module/subworkflow @@ -70,7 +71,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { dbsnp_tbi, chr_files, mappability, - intervals_bed_combined + intervals_bed_combined, + ploidy ) versions = versions.mix(BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf index 42e0b0567c..07bbf9364d 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf @@ -14,6 +14,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { chr_files // channel: [mandatory] mappability // channel: [mandatory] intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS + ploidy // channel: [mandatory] list of ploidy values main: @@ -24,7 +25,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_TUMORONLY.out.CNV.join(FREEC_TUMORONLY.out.ratio, failOnDuplicate: true, failOnMismatch: true)) FREEC2BED(FREEC_TUMORONLY.out.ratio) FREEC2CIRCOS(FREEC_TUMORONLY.out.ratio) - MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true)) + MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true).combine(ploidy)) ch_versions = ch_versions.mix(FREEC_TUMORONLY.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions)