diff --git a/CHANGELOG.md b/CHANGELOG.md index cf474927e..5d582e20a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1381](https://github.com/nf-core/sarek/pull/1381) - Swap NGSCheckMate bed file for GATK.GRCh37 to one without the `chr` prefix - [#1383](https://github.com/nf-core/sarek/pull/1383) - Fix `--three_prime_clip_r{1,2}` parameter documentation - [#1390](https://github.com/nf-core/sarek/pull/1390) - Fix badges in README +- [#1400](https://github.com/nf-core/sarek/pull/1400) - Fixed input channel for ASSESS_SIGNIFICANCE module, updated makegraph to makegraph2. - [#1403](https://github.com/nf-core/sarek/pull/1403) - Fix intervals usage with dot in chromosome names ### Removed diff --git a/README.md b/README.md index a5e6e8948..e922c7c32 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ We thank the following people for their extensive assistance in the development - [Malin Larsson](https://github.com/malinlarsson) - [Marcel Martin](https://github.com/marcelm) - [Nick Smith](https://github.com/nickhsmith) +- [Nicolas Schcolnicov](https://github.com/nschcolnicov) - [Nilesh Tawari](https://github.com/nilesh-tawari) - [Olga Botvinnik](https://github.com/olgabot) - [Oskar Wacker](https://github.com/WackerO) diff --git a/conf/modules/controlfreec.config b/conf/modules/controlfreec.config index 8ed3920c4..b6fa043d0 100644 --- a/conf/modules/controlfreec.config +++ b/conf/modules/controlfreec.config @@ -50,8 +50,7 @@ process { ] } - withName: 'MAKEGRAPH' { - ext.args = { "${params.cf_ploidy}" } + withName: 'MAKEGRAPH2' { publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" }, diff --git a/modules.json b/modules.json index 995c350b5..555c3fb73 100644 --- a/modules.json +++ b/modules.json @@ -107,11 +107,10 @@ "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] }, - "controlfreec/makegraph": { + "controlfreec/makegraph2": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"], - "patch": "modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff" + "git_sha": "a7bae48d8bccfae99e3b862fa07bbd50a8df6b82", + "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 13f4208a0..000000000 --- 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 @@ - 'biocontainers/control-freec:11.6b--hdbdd923_0' }" - - 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 -@@ -25,7 +25,7 @@ - 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 - -************************************************************ diff --git a/modules/nf-core/controlfreec/makegraph/environment.yml b/modules/nf-core/controlfreec/makegraph2/environment.yml similarity index 76% rename from modules/nf-core/controlfreec/makegraph/environment.yml rename to modules/nf-core/controlfreec/makegraph2/environment.yml index 897eadf3b..720c2e950 100644 --- a/modules/nf-core/controlfreec/makegraph/environment.yml +++ b/modules/nf-core/controlfreec/makegraph2/environment.yml @@ -1,4 +1,4 @@ -name: controlfreec_makegraph +name: controlfreec_makegraph2 channels: - conda-forge - bioconda diff --git a/modules/nf-core/controlfreec/makegraph/main.nf b/modules/nf-core/controlfreec/makegraph2/main.nf similarity index 72% rename from modules/nf-core/controlfreec/makegraph/main.nf rename to modules/nf-core/controlfreec/makegraph2/main.nf index 8d489f71f..a85589d6f 100644 --- a/modules/nf-core/controlfreec/makegraph/main.nf +++ b/modules/nf-core/controlfreec/makegraph2/main.nf @@ -1,10 +1,10 @@ -process CONTROLFREEC_MAKEGRAPH { +process CONTROLFREEC_MAKEGRAPH2 { tag "$meta.id" label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/control-freec:11.6b--hdbdd923_0' : + 'https://depot.galaxyproject.org/singularity/control-freec:11.6b--hdbdd923_0': 'biocontainers/control-freec:11.6b--hdbdd923_0' }" input: @@ -24,8 +24,9 @@ process CONTROLFREEC_MAKEGRAPH { def args = task.ext.args ?: "" def prefix = task.ext.prefix ?: "${meta.id}" def baf = baf ?: "" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ - cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} + cat \$(which makeGraph2.0.R) | R --slave --args ${args} ${ratio} ${baf} mv *_BAF.txt.png ${prefix}_BAF.png mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png @@ -33,12 +34,13 @@ process CONTROLFREEC_MAKEGRAPH { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}_BAF.png touch ${prefix}_ratio.log2.png @@ -46,7 +48,7 @@ process CONTROLFREEC_MAKEGRAPH { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/controlfreec/makegraph/meta.yml b/modules/nf-core/controlfreec/makegraph2/meta.yml similarity index 89% rename from modules/nf-core/controlfreec/makegraph/meta.yml rename to modules/nf-core/controlfreec/makegraph2/meta.yml index 6f91db38a..1325da4a8 100644 --- a/modules/nf-core/controlfreec/makegraph/meta.yml +++ b/modules/nf-core/controlfreec/makegraph2/meta.yml @@ -1,4 +1,4 @@ -name: controlfreec_makegraph +name: controlfreec_makegraph2 description: Plot Freec output keywords: - cna @@ -14,6 +14,7 @@ tools: tool_dev_url: https://github.com/BoevaLab/FREEC/ doi: "10.1093/bioinformatics/btq635" licence: ["GPL >=2"] + input: # Only when we have meta - meta: @@ -29,9 +30,7 @@ input: type: file description: .BAF file generated by FREEC pattern: "*.BAF" - - ploidy: - type: integer - description: Ploidy value for which graph should be created + output: - meta: type: map @@ -54,7 +53,6 @@ output: type: file description: Image of ratio plot pattern: "*_ratio.png" + authors: - "@FriederikeHanssen" -maintainers: - - "@FriederikeHanssen" diff --git a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf index a2e7e17cf..3be4da8e4 100644 --- a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf @@ -8,7 +8,7 @@ include { CONTROLFREEC_FREEC as FREEC_SOMATIC } from '../../. include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../modules/nf-core/controlfreec/assesssignificance/main' include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../modules/nf-core/controlfreec/freec2bed/main' include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../modules/nf-core/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../modules/nf-core/controlfreec/makegraph/main' +include { CONTROLFREEC_MAKEGRAPH2 as MAKEGRAPH2 } from '../../../modules/nf-core/controlfreec/makegraph2/main' workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { take: @@ -27,16 +27,39 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { FREEC_SOMATIC(controlfreec_input, fasta, fasta_fai, [], dbsnp, dbsnp_tbi, chr_files, mappability, intervals_bed, []) - ASSESS_SIGNIFICANCE(FREEC_SOMATIC.out.CNV.join(FREEC_SOMATIC.out.ratio, failOnDuplicate: true, failOnMismatch: true)) + //Filter the files that come out of freec somatic as ASSESS_SIGNIFICANCE only takes one cnv and one ratio file + //Creates empty channel if file is missing + cnv_files = FREEC_SOMATIC.out.CNV + .map{ meta, cnv -> + def tumor_file = cnv instanceof List ? cnv.find { it.toString().endsWith("gz_CNVs") } : cnv //only find if its a list, else it returns only the filename without the path + if (!tumor_file){ + error("CNVs tumor file not found for sample $meta.id") + } + [meta,tumor_file] + } + + ratio_files = FREEC_SOMATIC.out.ratio + .map{ meta, ratio -> + def tumor_file = ratio instanceof List ? ratio.find { it.toString().endsWith("gz_ratio.txt") } : ratio //same here as cnv + if (!tumor_file){ + error("Ratio tumor file not found for sample $meta.id") + } + [meta,tumor_file] + } + + //Join the pairs + assess_significance_input = cnv_files.join(ratio_files, failOnDuplicate: true, failOnMismatch: true) + + ASSESS_SIGNIFICANCE(assess_significance_input) FREEC2BED(FREEC_SOMATIC.out.ratio) FREEC2CIRCOS(FREEC_SOMATIC.out.ratio) - MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true)) + MAKEGRAPH2(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) ch_versions = ch_versions.mix(FREEC2BED.out.versions) ch_versions = ch_versions.mix(FREEC2CIRCOS.out.versions) - ch_versions = ch_versions.mix(MAKEGRAPH.out.versions) + ch_versions = ch_versions.mix(MAKEGRAPH2.out.versions) emit: versions = ch_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 993faf127..e7178cbaa 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf @@ -8,7 +8,7 @@ include { CONTROLFREEC_FREEC as FREEC_TUMORONLY } from '../../. include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../modules/nf-core/controlfreec/assesssignificance/main' include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../modules/nf-core/controlfreec/freec2bed/main' include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../modules/nf-core/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../modules/nf-core/controlfreec/makegraph/main' +include { CONTROLFREEC_MAKEGRAPH2 as MAKEGRAPH2 } from '../../../modules/nf-core/controlfreec/makegraph2/main' workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { take: @@ -30,13 +30,13 @@ 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)) + MAKEGRAPH2(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) ch_versions = ch_versions.mix(FREEC2CIRCOS.out.versions) - ch_versions = ch_versions.mix(MAKEGRAPH.out.versions) + ch_versions = ch_versions.mix(MAKEGRAPH2.out.versions) emit: versions = ch_versions diff --git a/tests/config/pytesttags.yml b/tests/config/pytesttags.yml index 3664978be..0c3c05c55 100644 --- a/tests/config/pytesttags.yml +++ b/tests/config/pytesttags.yml @@ -248,7 +248,7 @@ controlfreec: - modules/nf-core/controlfreec/freec/** - modules/nf-core/controlfreec/freec2bed/** - modules/nf-core/controlfreec/freec2circos/** - - modules/nf-core/controlfreec/makegraph/** + - modules/nf-core/controlfreec/makegraph2/** - modules/nf-core/samtools/mpileup/** - subworkflows/local/bam_variant_calling_mpileup/** - subworkflows/local/bam_variant_calling_somatic_all/**