diff --git a/CHANGELOG.md b/CHANGELOG.md index a59a636aef..2e11b9b308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#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) - [#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)) - [#982](https://github.com/nf-core/sarek/pull/982) - Remove usage of exit statements, using `Nextflow.error` instead - [#985](https://github.com/nf-core/sarek/pull/985) - Cache correctly identifies when it needs to be updated - [#988](https://github.com/nf-core/sarek/pull/988) - Updated ascat module to fix seed for reproducibility 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/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)