From c8943532d32f527bb952f12289ef6f43a33ea20b Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 25 Mar 2022 09:58:43 +0100 Subject: [PATCH 01/45] Add in controlfreec sw --- conf/modules.config | 13 +--- modules.json | 2 +- .../nf-core/modules/samtools/mpileup/main.nf | 5 +- .../nf-core/modules/samtools/mpileup/meta.yml | 6 +- .../local/germline_variant_calling.nf | 8 +- subworkflows/local/tumor_variant_calling.nf | 5 ++ .../joint_germline_variant_calling/main.nf | 77 +++++++++---------- .../variantcalling/controlfreec/main.nf | 24 ++++++ .../variantcalling/haplotypecaller/main.nf | 67 ++++++++-------- workflows/sarek.nf | 2 +- 10 files changed, 120 insertions(+), 89 deletions(-) create mode 100644 subworkflows/nf-core/variantcalling/controlfreec/main.nf diff --git a/conf/modules.config b/conf/modules.config index dc243fdcb8..70fd38c589 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -507,7 +507,7 @@ process{ withName: 'CONCAT_HAPLOTYPECALLER' { ext.prefix = {"${meta.id}.g"} publishDir = [ - enabled: "${params.generate_gvcf}", + enabled: "${!params.no_intervals }", mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller" } ] @@ -517,7 +517,7 @@ process{ ext.prefix = {"${meta.id}.g"} ext.when = { params.tools && params.tools.contains('haplotypecaller') } publishDir = [ - enabled: "${params.no_intervals || params.generate_gvcf}", + enabled: "${params.no_intervals}", mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller"}, pattern: "*{vcf.gz,vcf.gz.tbi}" @@ -526,19 +526,12 @@ process{ withName: 'GENOTYPEGVCFS' { ext.when = { params.tools && params.tools.contains('haplotypecaller') && params.joint_germline} publishDir = [ - enabled: true, + enabled: "${params.generate_gvcf}", mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller"}, pattern: "*{vcf.gz,vcf.gz.tbi}" ] } - withName : 'TABIX_VC_HAPLOTYPECALLER' { - publishDir = [ - enabled: "${params.generate_gvcf}", - mode: params.publish_dir_mode, - path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller" } - ] - } // MANTA withName: 'CONCAT_MANTA.*' { diff --git a/modules.json b/modules.json index 603ac393d3..0442fea4fc 100644 --- a/modules.json +++ b/modules.json @@ -191,4 +191,4 @@ } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/modules/samtools/mpileup/main.nf b/modules/nf-core/modules/samtools/mpileup/main.nf index cea4032193..474a249245 100644 --- a/modules/nf-core/modules/samtools/mpileup/main.nf +++ b/modules/nf-core/modules/samtools/mpileup/main.nf @@ -8,7 +8,7 @@ process SAMTOOLS_MPILEUP { 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(input), path(intervals) path fasta output: @@ -21,12 +21,13 @@ process SAMTOOLS_MPILEUP { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def intervals = intervals ? "-l ${intervals}" : "" """ samtools mpileup \\ --fasta-ref $fasta \\ --output ${prefix}.mpileup \\ $args \\ - $bam + $input cat <<-END_VERSIONS > versions.yml "${task.process}": samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') diff --git a/modules/nf-core/modules/samtools/mpileup/meta.yml b/modules/nf-core/modules/samtools/mpileup/meta.yml index c384f5c621..ae499e92ca 100644 --- a/modules/nf-core/modules/samtools/mpileup/meta.yml +++ b/modules/nf-core/modules/samtools/mpileup/meta.yml @@ -21,7 +21,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" @@ -29,6 +29,10 @@ input: type: file description: FASTA reference file pattern: "*.{fasta,fa}" + - intervals: + type: file + description: Interval FILE + pattern: "*.bed" output: - meta: type: map diff --git a/subworkflows/local/germline_variant_calling.nf b/subworkflows/local/germline_variant_calling.nf index 9738880697..ef59cc8cfd 100644 --- a/subworkflows/local/germline_variant_calling.nf +++ b/subworkflows/local/germline_variant_calling.nf @@ -31,7 +31,7 @@ workflow GERMLINE_VARIANT_CALLING { //TODO: Temporary until the if's can be removed and printing to terminal is prevented with "when" in the modules.config deepvariant_vcf = Channel.empty() freebayes_vcf = Channel.empty() - haplotypecaller_gvcf = Channel.empty() + haplotypecaller_vcf = Channel.empty() genotype_gvcf = Channel.empty() manta_vcf = Channel.empty() strelka_vcf = Channel.empty() @@ -91,8 +91,8 @@ workflow GERMLINE_VARIANT_CALLING { intervals_bed_combine_gz_tbi, num_intervals) - haplotypecaller_gvcf = RUN_HAPLOTYPECALLER.out.haplotypecaller_gvcf - genotype_gvcf = RUN_HAPLOTYPECALLER.out.genotype_gvcf + haplotypecaller_vcf = RUN_HAPLOTYPECALLER.out.haplotypecaller_vcf + //genotype_gvcf = RUN_HAPLOTYPECALLER.out.genotype_gvcf ch_versions = ch_versions.mix(RUN_HAPLOTYPECALLER.out.versions) } @@ -126,7 +126,7 @@ workflow GERMLINE_VARIANT_CALLING { emit: deepvariant_vcf freebayes_vcf - haplotypecaller_gvcf + haplotypecaller_vcf genotype_gvcf manta_vcf strelka_vcf diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 59ee2d5cea..41e1ec69ac 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -3,6 +3,7 @@ // Should be only run on patients without normal sample // +include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' include { RUN_FREEBAYES } from '../nf-core/variantcalling/freebayes/main.nf' include { GATK_TUMOR_ONLY_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_only_somatic_variant_calling/main' include { RUN_MANTA_TUMORONLY } from '../nf-core/variantcalling/manta/tumoronly/main.nf' @@ -56,6 +57,10 @@ workflow TUMOR_ONLY_VARIANT_CALLING { [new_meta, cram, crai, new_bed, new_tbi] }.set{cram_recalibrated_intervals_gz_tbi} + if(tools.contains('controlfreec')){ + cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} + RUN_CONTROLFREEC(cram_intervals_no_index, fasta) + } if (tools.contains('freebayes')){ // Remap channel for Freebayes diff --git a/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf b/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf index 9e1d1d95bf..f4e291fc3b 100644 --- a/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf +++ b/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf @@ -11,14 +11,11 @@ include { GATK4_APPLYVQSR as APPLYVQSR } from '../../../../m workflow GATK_JOINT_GERMLINE_VARIANT_CALLING { take: input // channel: [ val(meta), [ input ], [ input_index ], [] ] - run_haplotc // channel: true/false run haplotypecaller portion of workflow or skip to genomicsdbimport when false - run_vqsr // channel: true/false run vqsr portion of subworkflow fasta // channel: /path/to/reference/fasta fai // channel: /path/to/reference/fasta/index dict // channel: /path/to/reference/fasta/dictionary sites // channel: /path/to/known/sites/file sites_index // channel: /path/to/known/sites/index - joint_id // channel: joint id to replace individual sample ids with allelespecific // channel: true/false run allelespecific mode of vqsr modules resources // channel: [[resource, vcfs, forvariantrecal], [resource, tbis, forvariantrecal], [resource, labels, forvariantrecal]] annotation // channel: [annotations, to, use, for, variantrecal, filtering] @@ -32,7 +29,7 @@ workflow GATK_JOINT_GERMLINE_VARIANT_CALLING { // //Convert all sample vcfs into a genomicsdb workspace using genomicsdbimport. // - gendb_input = Channel.of([[ id:joint_id ]]).combine(ch_vcf).combine(ch_index).combine([interval_file]).combine(['']).combine([dict]) + gendb_input = .combine([interval_file]).combine(['']).combine([dict]) GENOMICSDBIMPORT ( gendb_input, false, false, false ) ch_versions = ch_versions.mix(GENOMICSDBIMPORT.out.versions) @@ -40,56 +37,56 @@ workflow GATK_JOINT_GERMLINE_VARIANT_CALLING { // //Joint genotyping performed using GenotypeGVCFs // - ch_genotype_in = GENOMICSDBIMPORT.out.genomicsdb.collect() - //[] is a placeholder for the input where the vcf tbi file would be passed in for non-genomicsdb workspace runs, which is not necessary for this workflow as it uses genomicsdb workspaces. - ch_genotype_in.add([]) + // ch_genotype_in = GENOMICSDBIMPORT.out.genomicsdb.collect() + // //[] is a placeholder for the input where the vcf tbi file would be passed in for non-genomicsdb workspace runs, which is not necessary for this workflow as it uses genomicsdb workspaces. + // ch_genotype_in.add([]) - GENOTYPEGVCFS ( ch_genotype_in, fasta, fai, dict, sites, sites_index ) - ch_versions = ch_versions.mix(GENOTYPEGVCFS.out.versions) + // GENOTYPEGVCFS ( ch_genotype_in, fasta, fai, dict, sites, sites_index ) + // ch_versions = ch_versions.mix(GENOTYPEGVCFS.out.versions) - // setting run_vqsr to false skips the VQSR process, for if user does not wish to perform VQSR, - // or want to run the hard filtering recommended by gatk best practices for runs with a low number of samples instead. - if (run_vqsr) { - // - //Perform first step in VQSR using VariantRecalibrator - // - ch_gvcf = GENOTYPEGVCFS.out.vcf.collect() - ch_gtbi = GENOTYPEGVCFS.out.tbi.collect() - ch_vrecal_in = ch_gvcf.combine(ch_gtbi, by: 0) + // // setting run_vqsr to false skips the VQSR process, for if user does not wish to perform VQSR, + // // or want to run the hard filtering recommended by gatk best practices for runs with a low number of samples instead. + // if (run_vqsr) { + // // + // //Perform first step in VQSR using VariantRecalibrator + // // + // ch_gvcf = GENOTYPEGVCFS.out.vcf.collect() + // ch_gtbi = GENOTYPEGVCFS.out.tbi.collect() + // ch_vrecal_in = ch_gvcf.combine(ch_gtbi, by: 0) - VARIANTRECALIBRATOR ( ch_vrecal_in, fasta, fai, dict, allelespecific, resources, annotation, mode, create_rscript ) + // VARIANTRECALIBRATOR ( ch_vrecal_in, fasta, fai, dict, allelespecific, resources, annotation, mode, create_rscript ) - ch_versions = ch_versions.mix(VARIANTRECALIBRATOR.out.versions) + // ch_versions = ch_versions.mix(VARIANTRECALIBRATOR.out.versions) - // - //Perform second step in VQSR using ApplyVQSR - // - ch_recal = VARIANTRECALIBRATOR.out.recal.collect() - ch_idx = VARIANTRECALIBRATOR.out.idx.collect() - ch_tranches = VARIANTRECALIBRATOR.out.tranches.collect() - ch_vqsr_in = ch_vrecal_in.combine(ch_recal, by: 0).combine(ch_idx, by: 0).combine(ch_tranches, by: 0) + // // + // //Perform second step in VQSR using ApplyVQSR + // // + // ch_recal = VARIANTRECALIBRATOR.out.recal.collect() + // ch_idx = VARIANTRECALIBRATOR.out.idx.collect() + // ch_tranches = VARIANTRECALIBRATOR.out.tranches.collect() + // ch_vqsr_in = ch_vrecal_in.combine(ch_recal, by: 0).combine(ch_idx, by: 0).combine(ch_tranches, by: 0) - APPLYVQSR ( ch_vqsr_in, fasta, fai, dict, allelespecific, truthsensitivity, mode ) + // APPLYVQSR ( ch_vqsr_in, fasta, fai, dict, allelespecific, truthsensitivity, mode ) - ch_versions = ch_versions.mix(APPLYVQSR.out.versions) + // ch_versions = ch_versions.mix(APPLYVQSR.out.versions) - } + // } emit: - haplotc_vcf = run_haplotc ? HAPLOTYPECALLER.out.vcf.collect() : [] // channel: [ val(meta), [ vcf ] ] - haplotc_index = run_haplotc ? HAPLOTYPECALLER.out.tbi.collect() : [] // channel: [ val(meta), [ tbi ] ] + // haplotc_vcf = run_haplotc ? HAPLOTYPECALLER.out.vcf.collect() : [] // channel: [ val(meta), [ vcf ] ] + // haplotc_index = run_haplotc ? HAPLOTYPECALLER.out.tbi.collect() : [] // channel: [ val(meta), [ tbi ] ] - genomicsdb = GENOMICSDBIMPORT.out.genomicsdb.collect() // channel: [ val(meta), [ genomicsdb ] ] + // genomicsdb = GENOMICSDBIMPORT.out.genomicsdb.collect() // channel: [ val(meta), [ genomicsdb ] ] - genotype_vcf = GENOTYPEGVCFS.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] - genotype_index = GENOTYPEGVCFS.out.vcf.collect() // channel: [ val(meta), [ tbi ] ] + // genotype_vcf = GENOTYPEGVCFS.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] + // genotype_index = GENOTYPEGVCFS.out.vcf.collect() // channel: [ val(meta), [ tbi ] ] - recal_file = run_vqsr ? VARIANTRECALIBRATOR.out.recal.collect() : [] // channel: [ val(meta), [ recal ] ] - recal_index = run_vqsr ? VARIANTRECALIBRATOR.out.idx.collect() : [] // channel: [ val(meta), [ idx ] ] - recal_tranches = run_vqsr ? VARIANTRECALIBRATOR.out.tranches.collect() : [] // channel: [ val(meta), [ tranches ] ] + // recal_file = run_vqsr ? VARIANTRECALIBRATOR.out.recal.collect() : [] // channel: [ val(meta), [ recal ] ] + // recal_index = run_vqsr ? VARIANTRECALIBRATOR.out.idx.collect() : [] // channel: [ val(meta), [ idx ] ] + // recal_tranches = run_vqsr ? VARIANTRECALIBRATOR.out.tranches.collect() : [] // channel: [ val(meta), [ tranches ] ] - vqsr_vcf = run_vqsr ? APPLYVQSR.out.vcf.collect() : [] // channel: [ val(meta), [ vcf ] ] - vqsr_index = run_vqsr ? APPLYVQSR.out.tbi.collect() : [] // channel: [ val(meta), [ tbi ] ] + // vqsr_vcf = run_vqsr ? APPLYVQSR.out.vcf.collect() : [] // channel: [ val(meta), [ vcf ] ] + // vqsr_index = run_vqsr ? APPLYVQSR.out.tbi.collect() : [] // channel: [ val(meta), [ tbi ] ] versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf new file mode 100644 index 0000000000..85857e892f --- /dev/null +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -0,0 +1,24 @@ +include { CONTROLFREEC } from '../../../../modules/nf-core/modules/controlfreec/main' +include { SAMTOOLS_MPILEUP as MPILEUP } from '../../../../modules/nf-core/modules/samtools/mpileup/main' + +workflow RUN_CONTROLFREEC { + take: + cram // channel: [mandatory] [meta, cram, crai, interval] + fasta // channel: [mandatory] + fasta_fai // channel: [mandatory] + intervals_bed_gz // channel: [optional] Contains a bed.gz file of all intervals combined provided with the cram input(s). Mandatory if interval files are used. + num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. + + main: + + ch_versions = Channel.empty() + + MPILEUP(cram, fasta) + //MergeMpileup + //CONTROLFREEC() + //CONTROLFREECVis + + + emit: + versions = ch_versions +} diff --git a/subworkflows/nf-core/variantcalling/haplotypecaller/main.nf b/subworkflows/nf-core/variantcalling/haplotypecaller/main.nf index 0a8a6958f5..7e456566e9 100644 --- a/subworkflows/nf-core/variantcalling/haplotypecaller/main.nf +++ b/subworkflows/nf-core/variantcalling/haplotypecaller/main.nf @@ -3,7 +3,6 @@ include { CONCAT_VCF as CONCAT_HAPLOTYPECALLER } from '../../../../modules/l include { GATK4_GENOTYPEGVCFS as GENOTYPEGVCFS } from '../../../../modules/nf-core/modules/gatk4/genotypegvcfs/main' include { GATK4_HAPLOTYPECALLER as HAPLOTYPECALLER } from '../../../../modules/nf-core/modules/gatk4/haplotypecaller/main' include { GATK_JOINT_GERMLINE_VARIANT_CALLING } from '../../../../subworkflows/nf-core/gatk4/joint_germline_variant_calling/main' -include { TABIX_TABIX as TABIX_VC_HAPLOTYPECALLER } from '../../../../modules/nf-core/modules/tabix/tabix/main' workflow RUN_HAPLOTYPECALLER { take: @@ -35,8 +34,10 @@ workflow RUN_HAPLOTYPECALLER { no_intervals: num_intervals == 1 }.set{haplotypecaller_vcf_branch} - // Only when no intervals - TABIX_VC_HAPLOTYPECALLER(haplotypecaller_vcf_branch.no_intervals) + HAPLOTYPECALLER.out.tbi.branch{ + intervals: num_intervals > 1 + no_intervals: num_intervals == 1 + }.set{haplotypecaller_tbi_branch} // Only when using intervals BGZIP_VC_HAPLOTYPECALLER(haplotypecaller_vcf_branch.intervals) @@ -55,7 +56,7 @@ workflow RUN_HAPLOTYPECALLER { CONCAT_HAPLOTYPECALLER.out.vcf, haplotypecaller_vcf_branch.no_intervals) - haplotypecaller_vcf_tbi = Channel.empty().mix( + haplotypecaller_tbi = Channel.empty().mix( CONCAT_HAPLOTYPECALLER.out.tbi, haplotypecaller_vcf_branch.no_intervals) @@ -82,38 +83,44 @@ workflow RUN_HAPLOTYPECALLER { //genotype_gvcf = GENOTYPEGVCFS.out.vcf - // if (joint_germline) { - // run_haplotypecaller = false - // run_vqsr = true //parameter? - // some feedback from gavin - // GATK_JOINT_GERMLINE_VARIANT_CALLING( - // haplotypecaller_vcf_gz_tbi, - // run_haplotypecaller, - // run_vqsr, - // fasta, - // fasta_fai, - // dict, - // dbsnp, - // dbsnp_tbi, - // "joined", - // allelespecific? - // resources? - // annotation? - // "BOTH", - // true, - // truthsensitivity -> parameter or module? - // ) - // ch_versions = ch_versions.mix(GATK_JOINT_GERMLINE_VARIANT_CALLING.out.versions) - // } + if (params.joint_germline) { + + haplotypecaller_vcf_list = haplotypecaller_vcf.toList() + haplotypecaller_tbi_list = haplotypecaller_vcf.toList() + + joint_germline_vcf_tbi = [ [id: "joint_germline"], + haplotypecaller_vcf_list, + haplotypecaller_tbi_list ] + // GATK_JOINT_GERMLINE_VARIANT_CALLING( + // joint_germline_vcf_tbi, + // fasta, + // fasta_fai, + // intervals, + // dict, + // dbsnp, + // dbsnp_tbi, + // allelespecific? + // resources? + // annotation? + // "BOTH", + // true, + // truthsensitivity -> parameter or module? + // ) + // ch_versions = ch_versions.mix(GATK_JOINT_GERMLINE_VARIANT_CALLING.out.versions) + } else { + // CNNScoreVariants + } + + ch_versions = ch_versions.mix(BGZIP_VC_HAPLOTYPECALLER.out.versions) ch_versions = ch_versions.mix(CONCAT_HAPLOTYPECALLER.out.versions) - ch_versions = ch_versions.mix(GENOTYPEGVCFS.out.versions) + //ch_versions = ch_versions.mix(GENOTYPEGVCFS.out.versions) //ch_versions = ch_versions.mix(GATK_JOINT_GERMLINE_VARIANT_CALLING.out.versions) ch_versions = ch_versions.mix(HAPLOTYPECALLER.out.versions) ch_versions = ch_versions.mix(TABIX_VC_HAPLOTYPECALLER.out.versions) emit: versions = ch_versions - genotype_gvcf - haplotypecaller_gvcf + //genotype_gvcf + haplotypecaller_vcf } diff --git a/workflows/sarek.nf b/workflows/sarek.nf index 2810005b62..90909452dd 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -636,7 +636,7 @@ workflow SAREK { vcf_to_annotate = Channel.empty() vcf_to_annotate = vcf_to_annotate.mix(GERMLINE_VARIANT_CALLING.out.deepvariant_vcf) vcf_to_annotate = vcf_to_annotate.mix(GERMLINE_VARIANT_CALLING.out.freebayes_vcf) - vcf_to_annotate = vcf_to_annotate.mix(GERMLINE_VARIANT_CALLING.out.haplotypecaller_gvcf) + vcf_to_annotate = vcf_to_annotate.mix(GERMLINE_VARIANT_CALLING.out.haplotypecaller_vcf) vcf_to_annotate = vcf_to_annotate.mix(GERMLINE_VARIANT_CALLING.out.manta_vcf) vcf_to_annotate = vcf_to_annotate.mix(GERMLINE_VARIANT_CALLING.out.strelka_vcf) vcf_to_annotate = vcf_to_annotate.mix(TUMOR_ONLY_VARIANT_CALLING.out.freebayes_vcf) From 3358c23ddf0febe16f55b1d3e663af3fe42f0443 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 25 Mar 2022 09:59:38 +0100 Subject: [PATCH 02/45] nf-core update mpileup --- modules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.json b/modules.json index 0442fea4fc..db44d1b943 100644 --- a/modules.json +++ b/modules.json @@ -154,7 +154,7 @@ "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/mpileup": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "b5825fe6b336352024aebccd274da1d131188bfc" }, "samtools/stats": { "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" From 98c0ddce15a9e557a5621fc74bee73b1c46074f9 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 25 Mar 2022 15:06:06 +0100 Subject: [PATCH 03/45] first controlfreec version --- conf/modules.config | 46 +++++++++++++++++ modules.json | 3 ++ modules/nf-core/modules/cat/cat/main.nf | 50 +++++++++++++++++++ modules/nf-core/modules/cat/cat/meta.yml | 37 ++++++++++++++ modules/nf-core/modules/controlfreec/main.nf | 2 + subworkflows/local/tumor_variant_calling.nf | 13 ++++- .../joint_germline_variant_calling/main.nf | 6 +-- .../variantcalling/controlfreec/main.nf | 43 ++++++++++++++-- .../variantcalling/deepvariant/main.nf | 2 + workflows/sarek.nf | 5 +- 10 files changed, 197 insertions(+), 10 deletions(-) create mode 100644 modules/nf-core/modules/cat/cat/main.nf create mode 100644 modules/nf-core/modules/cat/cat/meta.yml diff --git a/conf/modules.config b/conf/modules.config index 70fd38c589..93c3d1d6b5 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -598,6 +598,52 @@ process{ // TUMOR_VARIANT_CALLING + //CONTROLFREEC + withName: 'CONTROLFREEC'{ + + ext.args = { [ + "general" :[ + "bedgraphoutput": "TRUE", + //"breakpointthreshold": (optional), + //"breakpointtype": (optional), + //"coefficientofvariation": (optional), + //"contamination": (optional), + //"contaminationadjustment": (optional), + ////"degree": (optional), + //"forcegccontentnormalization": (optional), + //"gccontentprofile": (optional), + //"intercept": (optional), + ////"mincnalength": (optional), + ////"minmappabilityperwindow": (optional), + ////"minexpectedgc": (optional), + ////"maxexpectedgc": (optional), + //"minimalsubclonepresence": (optional), + ////"noisydata": (optional), + //"ploidy": (optional), + ////"printNA": (optional), + //"readcountthreshold": (optional), + "sex": meta.sex, + ////"step": (optional), + ////"telocentromeric": (optional), + ////"uniquematch": (optional), + //"window": (optional) + ], + "sample":[ + "inputformat": "pileup", + "mateorientation": "FR", + ], + //"control":[ + // "inputformat": (required), + // "mateorientation": (optional), + //], + //"BAF":[ + // "minimalcoverageperposition": (optional), + // "minimalqualityperposition": (optional), + // "shiftinquality": (optional) + //] + ]} + } + //MANTA withName: 'CONCAT_MANTA_TUMOR' { ext.prefix = {"${meta.id}.tumor_sv"} diff --git a/modules.json b/modules.json index db44d1b943..4b0caa89f0 100644 --- a/modules.json +++ b/modules.json @@ -21,6 +21,9 @@ "bwamem2/mem": { "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" }, + "cat/cat": { + "git_sha": "3d31fa4d04177579e86044bf111588376e1a0c12" + }, "cat/fastq": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, diff --git a/modules/nf-core/modules/cat/cat/main.nf b/modules/nf-core/modules/cat/cat/main.nf new file mode 100644 index 0000000000..25dcc652a4 --- /dev/null +++ b/modules/nf-core/modules/cat/cat/main.nf @@ -0,0 +1,50 @@ +process CAT_CAT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "conda-forge::pigz=2.3.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pigz:2.3.4' : + 'quay.io/biocontainers/pigz:2.3.4' }" + + input: + tuple val(meta), path(files_in) + + output: + tuple val(meta), path("${prefix}"), emit: file_out + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def file_list = files_in.collect { it.toString() } + + // | input | output | command1 | command2 | + // |-----------|------------|----------|----------| + // | gzipped | gzipped | cat | | + // | ungzipped | ungzipped | cat | | + // | gzipped | ungzipped | zcat | | + // | ungzipped | gzipped | cat | pigz | + + // Use input file ending as default + prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + out_zip = prefix.endsWith('.gz') + in_zip = file_list[0].endsWith('.gz') + command1 = (in_zip && !out_zip) ? 'zcat' : 'cat' + command2 = (!in_zip && out_zip) ? "| pigz -c -p $task.cpus $args2" : '' + """ + $command1 \\ + $args \\ + ${file_list.join(' ')} \\ + $command2 \\ + > ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/cat/cat/meta.yml b/modules/nf-core/modules/cat/cat/meta.yml new file mode 100644 index 0000000000..5eeff5a66e --- /dev/null +++ b/modules/nf-core/modules/cat/cat/meta.yml @@ -0,0 +1,37 @@ +name: cat_cat +description: A module for concatenation of gzipped or uncompressed files +keywords: + - concatenate + - gzip + - cat +tools: + - cat: + description: Just concatenation + homepage: None + documentation: https://man7.org/linux/man-pages/man1/cat.1.html + tool_dev_url: None + licence: ["GPL-3.0-or-later"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - files_in: + type: file + description: List of compressed / uncompressed files + pattern: "*" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - file_out: + type: file + description: Concatenated file. Will be gzipped if file_out ends with ".gz" + pattern: "${file_out}" + +authors: + - "@erikrikarddaniel" + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/controlfreec/main.nf b/modules/nf-core/modules/controlfreec/main.nf index 21084f641b..45dc989e23 100644 --- a/modules/nf-core/modules/controlfreec/main.nf +++ b/modules/nf-core/modules/controlfreec/main.nf @@ -35,6 +35,8 @@ process CONTROLFREEC { task.ext.when == null || task.ext.when script: + + println task.ext.args //"General" configurations def bedgraphoutput = task.ext.args?["general"]?["bedgraphoutput"] ? "BedGraphOutput = ${task.ext.args["general"]["bedgraphoutput"]}" : "" def chr_files = chr_directory ? "chrFiles =\${PWD}/${chr_directory}" : "" diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 41e1ec69ac..113379526e 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -22,12 +22,15 @@ workflow TUMOR_ONLY_VARIANT_CALLING { intervals_bed_gz_tbi // channel: [mandatory] intervals/target regions index zipped and indexed intervals_bed_combine_gz_tbi // channel: [mandatory] intervals/target regions index zipped and indexed intervals_bed_combine_gz // channel: [mandatory] intervals/target regions index zipped and indexed in one file + intervals_bed_combined // channel: [mandatory] intervals/target regions in one file unzipped num_intervals // val: number of intervals that are used to parallelize exection, either based on capture kit or GATK recommended for WGS no_intervals germline_resource // channel: [optional] germline_resource germline_resource_tbi // channel: [optional] germline_resource_tbi panel_of_normals // channel: [optional] panel_of_normals panel_of_normals_tbi // channel: [optional] panel_of_normals_tbi + chr_length + mappability main: @@ -59,7 +62,15 @@ workflow TUMOR_ONLY_VARIANT_CALLING { if(tools.contains('controlfreec')){ cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} - RUN_CONTROLFREEC(cram_intervals_no_index, fasta) + RUN_CONTROLFREEC(cram_intervals_no_index, + fasta, + fasta_fai, + dbsnp, + dbsnp_tbi, + chr_length, + mappability, + intervals_bed_combined, + num_intervals) } if (tools.contains('freebayes')){ diff --git a/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf b/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf index f4e291fc3b..68b1a770db 100644 --- a/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf +++ b/subworkflows/nf-core/gatk4/joint_germline_variant_calling/main.nf @@ -29,10 +29,10 @@ workflow GATK_JOINT_GERMLINE_VARIANT_CALLING { // //Convert all sample vcfs into a genomicsdb workspace using genomicsdbimport. // - gendb_input = .combine([interval_file]).combine(['']).combine([dict]) + // gendb_input = .combine([interval_file]).combine(['']).combine([dict]) - GENOMICSDBIMPORT ( gendb_input, false, false, false ) - ch_versions = ch_versions.mix(GENOMICSDBIMPORT.out.versions) + // GENOMICSDBIMPORT ( gendb_input, false, false, false ) + // ch_versions = ch_versions.mix(GENOMICSDBIMPORT.out.versions) // //Joint genotyping performed using GenotypeGVCFs diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index 85857e892f..9f2d71acb1 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -1,12 +1,17 @@ -include { CONTROLFREEC } from '../../../../modules/nf-core/modules/controlfreec/main' -include { SAMTOOLS_MPILEUP as MPILEUP } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { CAT_CAT as CAT } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC } from '../../../../modules/nf-core/modules/controlfreec/main' +include { SAMTOOLS_MPILEUP as MPILEUP } from '../../../../modules/nf-core/modules/samtools/mpileup/main' workflow RUN_CONTROLFREEC { take: cram // channel: [mandatory] [meta, cram, crai, interval] fasta // channel: [mandatory] fasta_fai // channel: [mandatory] - intervals_bed_gz // channel: [optional] Contains a bed.gz file of all intervals combined provided with the cram input(s). Mandatory if interval files are used. + dbsnp // channel: [mand] + dbsnp_tbi + chr_length + mappability + intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. main: @@ -14,8 +19,36 @@ workflow RUN_CONTROLFREEC { ch_versions = Channel.empty() MPILEUP(cram, fasta) - //MergeMpileup - //CONTROLFREEC() + + MPILEUP.out.mpileup.branch{ + intervals: num_intervals > 1 + no_intervals: num_intervals == 1 + }.set{mpileup} + + //Merge mpileup only when intervals + CAT(mpileup.intervals.map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.sample + [new_meta, pileup] + }.groupTuple(size: num_intervals)) + + controlfeec_input = Channel.empty().mix( + CAT.out.file_out, + mpileup.no_intervals + ).map{ meta, pileup -> + [meta, pileup, [], [], [], [], []] + } + + CONTROLFREEC(controlfeec_input, + fasta, + fasta_fai, + [], + dbsnp, + dbsnp_tbi, + chr_length, + mappability, + intervals_bed, + []) //CONTROLFREECVis diff --git a/subworkflows/nf-core/variantcalling/deepvariant/main.nf b/subworkflows/nf-core/variantcalling/deepvariant/main.nf index e5069f2bab..0e0520aca3 100644 --- a/subworkflows/nf-core/variantcalling/deepvariant/main.nf +++ b/subworkflows/nf-core/variantcalling/deepvariant/main.nf @@ -22,6 +22,8 @@ workflow RUN_DEEPVARIANT { DEEPVARIANT(cram, fasta, fasta_fai) + //TODO Branch annotation? + // Only when no intervals TABIX_VC_DEEPVARIANT_VCF(DEEPVARIANT.out.vcf) TABIX_VC_DEEPVARIANT_GVCF(DEEPVARIANT.out.gvcf) diff --git a/workflows/sarek.nf b/workflows/sarek.nf index 90909452dd..fad7299fa5 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -602,12 +602,15 @@ workflow SAREK { intervals_bed_gz_tbi, intervals_bed_combined_gz_tbi, intervals_bed_combined_gz, + intervals_bed_combined, num_intervals, params.no_intervals, germline_resource, germline_resource_tbi, pon, - pon_tbi + pon_tbi, + chr_length, + mappability ) // PAIR VARIANT CALLING From 2f51ecc041388fb77bafbc313d08779c64626dc1 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 25 Mar 2022 18:24:45 +0100 Subject: [PATCH 04/45] install controlfreec again with significance script --- modules.json | 9 +- .../controlfreec/assesssignificance/main.nf | 30 +++ .../controlfreec/assesssignificance/meta.yml | 50 +++++ .../modules/controlfreec/freec/main.nf | 158 +++++++++++++++ .../modules/controlfreec/freec/meta.yml | 182 ++++++++++++++++++ 5 files changed, 426 insertions(+), 3 deletions(-) create mode 100644 modules/nf-core/modules/controlfreec/assesssignificance/main.nf create mode 100644 modules/nf-core/modules/controlfreec/assesssignificance/meta.yml create mode 100644 modules/nf-core/modules/controlfreec/freec/main.nf create mode 100644 modules/nf-core/modules/controlfreec/freec/meta.yml diff --git a/modules.json b/modules.json index 4b0caa89f0..ba8b6660b5 100644 --- a/modules.json +++ b/modules.json @@ -30,8 +30,11 @@ "cnvkit/batch": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, - "controlfreec": { - "git_sha": "f0800157544a82ae222931764483331a81812012" + "controlfreec/assesssignificance": { + "git_sha": "4efa8da5c5bd8b68d667ddade7ed398e16c145f6" + }, + "controlfreec/freec": { + "git_sha": "4efa8da5c5bd8b68d667ddade7ed398e16c145f6" }, "custom/dumpsoftwareversions": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -194,4 +197,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/nf-core/modules/controlfreec/assesssignificance/main.nf b/modules/nf-core/modules/controlfreec/assesssignificance/main.nf new file mode 100644 index 0000000000..dc9c6e8697 --- /dev/null +++ b/modules/nf-core/modules/controlfreec/assesssignificance/main.nf @@ -0,0 +1,30 @@ +process CONTROLFREEC_ASSESSSIGNIFICANCE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(cnvs), path(ratio) + + output: + tuple val(meta), path("*.p.value.txt"), emit: bam + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio} + + 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" ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/controlfreec/assesssignificance/meta.yml b/modules/nf-core/modules/controlfreec/assesssignificance/meta.yml new file mode 100644 index 0000000000..0451cca349 --- /dev/null +++ b/modules/nf-core/modules/controlfreec/assesssignificance/meta.yml @@ -0,0 +1,50 @@ +name: controlfreec_assesssignificance +description: Add both Wilcoxon test and Kolmogorov-Smirnov test p-values to each CNV output of FREEC +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec/assesssignificance: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cnvs: + type: file + description: _CNVs file generated by FREEC + pattern: "*._CNVs" + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - p_value_txt: + type: file + description: CNV file containing p_values for each call + pattern: "*.p.value.txt" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/controlfreec/freec/main.nf b/modules/nf-core/modules/controlfreec/freec/main.nf new file mode 100644 index 0000000000..ba48ea1e7b --- /dev/null +++ b/modules/nf-core/modules/controlfreec/freec/main.nf @@ -0,0 +1,158 @@ +process CONTROLFREEC_FREEC { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(mpileup_normal), path(mpileup_tumor), path(cpn_normal), path(cpn_tumor), path(minipileup_normal), path(minipileup_tumor) + path fasta + path fai + path snp_position + path known_snps + path known_snps_tbi + path chr_directory + path mappability + path target_bed + path gccontent_profile + + output: + tuple val(meta), path("*_ratio.BedGraph") , emit: bedgraph, optional: true + tuple val(meta), path("*_control.cpn") , emit: control_cpn + tuple val(meta), path("*_sample.cpn") , emit: sample_cpn + tuple val(meta), path("GC_profile.*.cpn") , emit: gcprofile_cpn, optional:true + tuple val(meta), path("*_BAF.txt") , emit: BAF + tuple val(meta), path("*_CNVs") , emit: CNV + tuple val(meta), path("*_info.txt") , emit: info + tuple val(meta), path("*_ratio.txt") , emit: ratio + tuple val(meta), path("config.txt") , emit: config + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + //"General" configurations + def bedgraphoutput = task.ext.args?["general"]?["bedgraphoutput"] ? "BedGraphOutput = ${task.ext.args["general"]["bedgraphoutput"]}" : "" + def chr_files = chr_directory ? "chrFiles =\${PWD}/${chr_directory}" : "" + def chr_length = fai ? "chrLenFile = \${PWD}/${fai}" : "" + def breakpointthreshold = task.ext.args?["general"]?["breakpointthreshold"] ? "breakPointThreshold = ${task.ext.args["general"]["breakpointthreshold"]}" : "" + def breakpointtype = task.ext.args?["general"]?["breakpointtype"] ? "breakPointType = ${task.ext.args["general"]["breakpointtype"]}" : "" + def coefficientofvariation = task.ext.args?["general"]?["coefficient"] ? "coefficientOfVariation = ${task.ext.args["general"]["coefficientofvariation"]}" : "" + def contamination = task.ext.args?["general"]?["contamination"] ? "contamination = ${task.ext.args["general"]["contamination"]}" : "" + def contaminationadjustment = task.ext.args?["general"]?["contaminationadjustment"] ? "contaminationAdjustment = ${task.ext.args["general"]["contaminationadjustment"]}" : "" + def degree = task.ext.args?["general"]?["degree"] ? "degree = ${task.ext.args["general"]["degree"]}" : "" + def forcegccontentnormalization = task.ext.args?["general"]?["forcegccontentnormalization"] ? "forceGCcontentNormalization = ${task.ext.args["general"]["forcegccontentnormalization"]}" : "" + def gccontentprofile = gccontent_profile ? "GCcontentProfile = ${gccontent_profile}" : "" + def mappability = mappability ? "gemMappabilityFile = \${PWD}/${mappability}" : "" + def intercept = task.ext.args?["general"]?["intercept"] ? "intercept = ${task.ext.args["general"]["intercept"]}" : "" + def mincnalength = task.ext.args?["general"]?["mincnalength"] ? "minCNAlength = ${task.ext.args["general"]["mincnalength"]}" : "" + def minmappabilityperwindow = task.ext.args?["general"]?["minmappabilityperwindow"] ? "minMappabilityPerWindow = ${task.ext.args["general"]["minmappabilityperwindow"]}" : "" + def minexpectedgc = task.ext.args?["general"]?["minexpectedgc"] ? "minExpectedGC = ${task.ext.args["general"]["minexpectedgc"]}" : "" + def maxexpectedgc = task.ext.args?["general"]?["maxexpectedgc"] ? "maxExpectedGC = ${task.ext.args["general"]["maxexpectedgc"]}" : "" + def minimalsubclonepresence = task.ext.args?["general"]?["minimalsubclonepresence"] ? "minimalSubclonePresence = ${task.ext.args["general"]["minimalsubclonepresence"]}" : "" + def noisydata = task.ext.args?["general"]?["noisydata"] ? "noisyData = ${task.ext.args["general"]["noisydata"]}" : "" + def output = task.ext.prefix ? "outputDir = \${PWD}/${task.ext.prefix}" : "" + def ploidy = task.ext.args?["general"]?["ploidy"] ? "ploidy = ${task.ext.args["general"]["ploidy"]}" : "" + def printNA = task.ext.args?["general"]?["printNA"] ? "printNA = ${task.ext.args["general"]["printNA"]}" : "" + def readcountthreshold = task.ext.args?["general"]?["readcountthreshold"] ? "readCountThreshold = ${task.ext.args["general"]["readcountthreshold"]}" : "" + def sex = task.ext.args?["general"]?["sex"] ? "sex = ${task.ext.args["general"]["sex"]}" : "" + def step = task.ext.args?["general"]?["step"] ? "step = ${task.ext.args["general"]["step"]}" : "" + def telocentromeric = task.ext.args?["general"]?["telocentromeric"] ? "telocentromeric = ${task.ext.args["general"]["telocentromeric"]} " : "" + def uniquematch = task.ext.args?["general"]?["uniquematch"] ? "uniqueMatch = ${task.ext.args["general"]["uniquematch"]}" : "" + def window = task.ext.args?["general"]?["window"] ? "window = ${task.ext.args["general"]["window"]}" : "" + + //"Control" configurations + def matefile_normal = mpileup_normal ? "mateFile = \${PWD}/${mpileup_normal}" : "" + def matecopynumberfile_normal = cpn_normal ? "mateCopyNumberFile = \${PWD}/${cpn_normal}" : "" + def minipileup_normal = minipileup_normal ? "miniPileup = \${PWD}/${minipileup_normal}" : "" + def inputformat_normal = task.ext.args?["control"]?["inputformat"] ? "inputFormat = ${task.ext.args["control"]["inputformat"]}" : "" + def mateorientation_normal = task.ext.args?["control"]?["mateorientation"] ? "mateOrientation = ${task.ext.args["control"]["mateorientation"]}" : "" + + //"Sample" configuration + def matefile_tumor = mpileup_tumor ? "mateFile = \${PWD}/${mpileup_tumor}" : "" + def matecopynumberfile_tumor = cpn_tumor ? "mateCopyNumberFile = \${PWD}/${cpn_tumor}" : "" + def minipileup_tumor = minipileup_tumor ? "miniPileup = \${PWD}/${minipileup_tumor}" : "" + def inputformat_tumor = task.ext.args?["sample"]?["inputformat"] ? "inputFormat = ${task.ext.args["sample"]["inputformat"]}" : "" + def mateorientation_tumor = task.ext.args?["sample"]?["mateorientation"] ? "mateOrientation = ${task.ext.args["sample"]["mateorientation"]}" : "" + + //"BAF" configuration + def makepileup = snp_position ? "makePileup = \${PWD}/${snp_position}" : "" + def fastafile = fasta ? "fastaFile = \${PWD}/${fasta}" : "" + def minimalcoverageperposition = task.ext.args?["BAF"]?["minimalcoverageperposition"] ? "minimalCoveragePerPosition = ${task.ext.args["BAF"]["minimalcoverageperposition"]}" : "" + def minimalqualityperposition = task.ext.args?["BAF"]?["minimalqualityperposition"] ? "minimalQualityPerPosition = ${task.ext.args["BAF"]["minimalqualityperposition"]}" : "" + def shiftinquality = task.ext.args?["BAF"]?["shiftinquality"] ? "shiftInQuality = ${task.ext.args["BAF"]["shiftinquality"]}" : "" + def snpfile = known_snps ? "SNPfile = \$PWD/${known_snps}" : "" + + //"Target" configuration + def target_bed = target_bed ? "captureRegions = ${target_bed}" : "" + """ + touch config.txt + + echo "[general]" >> config.txt + echo ${bedgraphoutput} >> config.txt + echo ${breakpointthreshold} >> config.txt + echo ${breakpointtype} >> config.txt + echo ${chr_files} >> config.txt + echo ${chr_length} >> config.txt + echo ${coefficientofvariation} >> config.txt + echo ${contamination} >> config.txt + echo ${contaminationadjustment} >> config.txt + echo ${degree} >> config.txt + echo ${forcegccontentnormalization} >> config.txt + echo ${gccontentprofile} >> config.txt + echo ${mappability} >> config.txt + echo ${intercept} >> config.txt + echo ${mincnalength} >> config.txt + echo ${minmappabilityperwindow} >> config.txt + echo ${minexpectedgc} >> config.txt + echo ${maxexpectedgc} >> config.txt + echo ${minimalsubclonepresence} >> config.txt + echo "maxThreads = ${task.cpus}" >> config.txt + echo ${noisydata} >> config.txt + echo ${output} >> config.txt + echo ${ploidy} >> config.txt + echo ${printNA} >> config.txt + echo ${readcountthreshold} >> config.txt + echo ${sex} >> config.txt + echo ${step} >> config.txt + echo ${telocentromeric} >> config.txt + echo ${uniquematch} >> config.txt + echo ${window} >> config.txt + + echo "[control]" >> config.txt + echo ${matefile_normal} >> config.txt + echo ${matecopynumberfile_normal} >> config.txt + echo ${minipileup_normal} >> config.txt + echo ${inputformat_normal} >> config.txt + echo ${mateorientation_normal} >> config.txt + + echo "[sample]" >> config.txt + echo ${matefile_tumor} >> config.txt + echo ${matecopynumberfile_tumor} >> config.txt + echo ${minipileup_tumor} >> config.txt + echo ${inputformat_tumor} >> config.txt + echo ${mateorientation_tumor} >> config.txt + + echo "[BAF]" >> config.txt + echo ${makepileup} >> config.txt + echo ${fastafile} >> config.txt + echo ${minimalcoverageperposition} >> config.txt + echo ${minimalqualityperposition} >> config.txt + echo ${shiftinquality} >> config.txt + echo ${snpfile} >> config.txt + + echo "[target]" >> config.txt + echo ${target_bed} >> config.txt + + freec -conf config.txt + + 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" ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/controlfreec/freec/meta.yml b/modules/nf-core/modules/controlfreec/freec/meta.yml new file mode 100644 index 0000000000..a9a7375e72 --- /dev/null +++ b/modules/nf-core/modules/controlfreec/freec/meta.yml @@ -0,0 +1,182 @@ +name: controlfreec_freec +description: Copy number and genotype annotation from whole genome and whole exome sequencing data +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec/freec: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + - args: + type: map + description: | + Groovy Map containing tool parameters. MUST follow the structure/keywords below and be provided via modules.config. + Parameters marked as (optional) can be removed from the map, if they are not set. All values must be surrounded by quotes, meta map parameters can be set with, i.e. `sex = meta.sex`: + For default values, please check the documentation above. + + ``` + { + [ + "general" :[ + "bedgraphoutput": (optional), + "breakpointthreshold": (optional), + "breakpointtype": (optional), + "coefficientofvariation": (optional), + "contamination": (optional), + "contaminationadjustment": (optional), + "degree": (optional), + "forcegccontentnormalization": (optional), + "gccontentprofile": (optional), + "intercept": (optional), + "mincnalength": (optional), + "minmappabilityperwindow": (optional), + "minexpectedgc": (optional), + "maxexpectedgc": (optional), + "minimalsubclonepresence": (optional), + "noisydata": (optional), + "ploidy": (optional), + "printNA": (optional), + "readcountthreshold": (optional), + "sex": (optional), + "step": (optional), + "telocentromeric": (optional), + "uniquematch": (optional), + "window": (optional) + ], + "control":[ + "inputformat": (required), + "mateorientation": (optional), + ], + "sample":[ + "inputformat": (required), + "mateorientation": (optional), + ], + "BAF":[ + "minimalcoverageperposition": (optional), + "minimalqualityperposition": (optional), + "shiftinquality": (optional) + ] + ] + } + ``` + + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - mateFile_normal: + type: file + description: File with mapped reads + pattern: "*.{sam,bam,pileup(.gz),bowtie(.gz),eland(.gz),arachne(.gz),psl(.gz),bed(.gz)}" + - mateFile_tumor: + type: file + description: File with mapped reads + pattern: "*.{sam,bam,pileup(.gz),bowtie(.gz),eland(.gz),arachne(.gz),psl(.gz),bed(.gz)}" + - cpn_normal: + type: file + description: Raw copy number profiles (optional) + pattern: "*.cpn" + - cpn_tumor: + type: file + description: Raw copy number profiles (optional) + pattern: "*.cpn" + - minipileup_normal: + type: file + description: miniPileup file from previous run (optional) + pattern: "*.pileup" + - minipileup_tumor: + type: file + description: miniPileup file from previous run (optional) + pattern: "*.pileup" + - fasta: + type: file + description: Reference file (optional; required if args 'makePileup' is set) + pattern: "*.{fasta,fna,fa}" + - fai: + type: file + description: Fasta index + pattern: "*.fai" + - snp_position: + type: file + description: + pattern: "*.{}" + - known_snps: + type: file + description: File with known SNPs + pattern: "*.{vcf,vcf.gz}" + - known_snps_tbi: + type: file + description: Index of known_snps + pattern: "*.tbi" + - chr_directory: + type: file + description: Path to directory with chromosome fasta files (optional, required if gccontentprofile is not provided) + pattern: "*/" + - mappability: + type: file + description: Contains information of mappable positions (optional) + pattern: "*.gem" + - target_bed: + type: file + description: Sorted bed file containing capture regions (optional) + pattern: "*.bed" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bedgraph: + type: file + description: Bedgraph format for the UCSC genome browser + pattern: ".bedgraph" + - control_cpn: + type: file + description: files with raw copy number profiles + pattern: "*_control.cpn" + - sample_cpn: + type: file + description: files with raw copy number profiles + pattern: "*_sample.cpn" + - gcprofile_cpn: + type: file + description: file with GC-content profile. + pattern: "GC_profile.*.cpn" + - BAF: + type: file + description: file B-allele frequencies for each possibly heterozygous SNP position + pattern: "*_BAF.txt" + - CNV: + type: file + description: file with coordinates of predicted copy number alterations. + pattern: "*_CNVs" + - info: + type: file + description: parsable file with information about FREEC run + pattern: "*_info.txt" + - ratio: + type: file + description: file with ratios and predicted copy number alterations for each window + pattern: "*_ratio.txt" + - config: + type: file + description: Config file used to run Control-FREEC + pattern: "config.txt" + +authors: + - "@FriederikeHanssen" From 5f070bf348353105761e089421817c1f124d475f Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 25 Mar 2022 21:13:43 +0100 Subject: [PATCH 05/45] add controlfreec plotting modules --- .github/workflows/ci.yml | 1 + conf/modules.config | 62 ++---- modules.json | 10 +- .../controlfreec/assesssignificance/main.nf | 5 +- .../modules/controlfreec/freec2bed/main.nf | 31 +++ .../modules/controlfreec/freec2bed/meta.yml | 45 +++++ .../modules/controlfreec/freec2circos/main.nf | 31 +++ .../controlfreec/freec2circos/meta.yml | 45 +++++ modules/nf-core/modules/controlfreec/main.nf | 160 --------------- .../modules/controlfreec/makegraph/main.nf | 40 ++++ .../modules/controlfreec/makegraph/meta.yml | 58 ++++++ modules/nf-core/modules/controlfreec/meta.yml | 182 ------------------ subworkflows/local/tumor_variant_calling.nf | 1 + .../variantcalling/controlfreec/main.nf | 22 ++- 14 files changed, 299 insertions(+), 394 deletions(-) create mode 100644 modules/nf-core/modules/controlfreec/freec2bed/main.nf create mode 100644 modules/nf-core/modules/controlfreec/freec2bed/meta.yml create mode 100644 modules/nf-core/modules/controlfreec/freec2circos/main.nf create mode 100644 modules/nf-core/modules/controlfreec/freec2circos/meta.yml delete mode 100644 modules/nf-core/modules/controlfreec/main.nf create mode 100644 modules/nf-core/modules/controlfreec/makegraph/main.nf create mode 100644 modules/nf-core/modules/controlfreec/makegraph/meta.yml delete mode 100644 modules/nf-core/modules/controlfreec/meta.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0739d1cf43..977e1eb03c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,7 @@ jobs: - "aligner" - "annotation" - "default" + - "controlfreec" - "deepvariant" - "freebayes" - "gatk4_spark" diff --git a/conf/modules.config b/conf/modules.config index 93c3d1d6b5..0b8bda35b5 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -599,51 +599,29 @@ process{ // TUMOR_VARIANT_CALLING //CONTROLFREEC - withName: 'CONTROLFREEC'{ - + withName:CONTROLFREEC_FREEC{ ext.args = { [ - "general" :[ - "bedgraphoutput": "TRUE", - //"breakpointthreshold": (optional), - //"breakpointtype": (optional), - //"coefficientofvariation": (optional), - //"contamination": (optional), - //"contaminationadjustment": (optional), - ////"degree": (optional), - //"forcegccontentnormalization": (optional), - //"gccontentprofile": (optional), - //"intercept": (optional), - ////"mincnalength": (optional), - ////"minmappabilityperwindow": (optional), - ////"minexpectedgc": (optional), - ////"maxexpectedgc": (optional), - //"minimalsubclonepresence": (optional), - ////"noisydata": (optional), - //"ploidy": (optional), - ////"printNA": (optional), - //"readcountthreshold": (optional), - "sex": meta.sex, - ////"step": (optional), - ////"telocentromeric": (optional), - ////"uniquematch": (optional), - //"window": (optional) - ], - "sample":[ - "inputformat": "pileup", - "mateorientation": "FR", - ], - //"control":[ - // "inputformat": (required), - // "mateorientation": (optional), - //], - //"BAF":[ - // "minimalcoverageperposition": (optional), - // "minimalqualityperposition": (optional), - // "shiftinquality": (optional) - //] - ]} + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + ] + } } + withName: 'MAKEGRAPH' { + ext.args = { "${params.ploidy}" } + } + + //MANTA withName: 'CONCAT_MANTA_TUMOR' { ext.prefix = {"${meta.id}.tumor_sv"} diff --git a/modules.json b/modules.json index ba8b6660b5..aa62c09bfd 100644 --- a/modules.json +++ b/modules.json @@ -31,11 +31,17 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "controlfreec/assesssignificance": { - "git_sha": "4efa8da5c5bd8b68d667ddade7ed398e16c145f6" + "git_sha": "28e5211b3513d80f198beb7090f57242165cc030" }, "controlfreec/freec": { "git_sha": "4efa8da5c5bd8b68d667ddade7ed398e16c145f6" }, + "controlfreec/freec2bed": { + "git_sha": "8a64e73af29a8096e1996e0496df4ae8c449c40b" + }, + "controlfreec/makegraph": { + "git_sha": "28e5211b3513d80f198beb7090f57242165cc030" + }, "custom/dumpsoftwareversions": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, @@ -197,4 +203,4 @@ } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/modules/controlfreec/assesssignificance/main.nf b/modules/nf-core/modules/controlfreec/assesssignificance/main.nf index dc9c6e8697..f85a3c7f1e 100644 --- a/modules/nf-core/modules/controlfreec/assesssignificance/main.nf +++ b/modules/nf-core/modules/controlfreec/assesssignificance/main.nf @@ -11,7 +11,7 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { tuple val(meta), path(cnvs), path(ratio) output: - tuple val(meta), path("*.p.value.txt"), emit: bam + tuple val(meta), path("*.p.value.txt"), emit: p_value_txt path "versions.yml" , emit: versions when: @@ -19,9 +19,12 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio} + mv *.p.value.txt ${prefix}.p.value.txt + 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" ) diff --git a/modules/nf-core/modules/controlfreec/freec2bed/main.nf b/modules/nf-core/modules/controlfreec/freec2bed/main.nf new file mode 100644 index 0000000000..880e4716ab --- /dev/null +++ b/modules/nf-core/modules/controlfreec/freec2bed/main.nf @@ -0,0 +1,31 @@ +process CONTROLFREEC_FREEC2BED { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(ratio) + + output: + tuple val(meta), path("*.bed"), emit: bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + freec2bed.pl -f ${ratio} ${args} > ${prefix}.bed + + 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" ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/controlfreec/freec2bed/meta.yml b/modules/nf-core/modules/controlfreec/freec2bed/meta.yml new file mode 100644 index 0000000000..47fff8ab80 --- /dev/null +++ b/modules/nf-core/modules/controlfreec/freec2bed/meta.yml @@ -0,0 +1,45 @@ +name: controlfreec_freec2bed +description: Plot Freec output +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bed: + type: file + description: Bed file + pattern: "*.bed" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/controlfreec/freec2circos/main.nf b/modules/nf-core/modules/controlfreec/freec2circos/main.nf new file mode 100644 index 0000000000..8879d4c05d --- /dev/null +++ b/modules/nf-core/modules/controlfreec/freec2circos/main.nf @@ -0,0 +1,31 @@ +process CONTROLFREEC_FREEC2CIRCOS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(ratio) + + output: + tuple val(meta), path("*.circos.txt"), emit: circos + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + freec2circos.pl -f ${ratio} ${args} > ${prefix}.circos.txt + + 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" ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/controlfreec/freec2circos/meta.yml b/modules/nf-core/modules/controlfreec/freec2circos/meta.yml new file mode 100644 index 0000000000..ff845a826c --- /dev/null +++ b/modules/nf-core/modules/controlfreec/freec2circos/meta.yml @@ -0,0 +1,45 @@ +name: controlfreec_freec2circos +description: Format Freec output to circos input format +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - circos: + type: file + description: Txt file + pattern: "*.circos.txt" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/controlfreec/main.nf b/modules/nf-core/modules/controlfreec/main.nf deleted file mode 100644 index 45dc989e23..0000000000 --- a/modules/nf-core/modules/controlfreec/main.nf +++ /dev/null @@ -1,160 +0,0 @@ -process CONTROLFREEC { - tag "$meta.id" - label 'process_low' - - conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': - 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" - - input: - tuple val(meta), path(mpileup_normal), path(mpileup_tumor), path(cpn_normal), path(cpn_tumor), path(minipileup_normal), path(minipileup_tumor) - path fasta - path fai - path snp_position - path known_snps - path known_snps_tbi - path chr_directory - path mappability - path target_bed - path gccontent_profile - - output: - tuple val(meta), path("*_ratio.BedGraph") , emit: bedgraph, optional: true - tuple val(meta), path("*_control.cpn") , emit: control_cpn - tuple val(meta), path("*_sample.cpn") , emit: sample_cpn - tuple val(meta), path("GC_profile.*.cpn") , emit: gcprofile_cpn, optional:true - tuple val(meta), path("*_BAF.txt") , emit: BAF - tuple val(meta), path("*_CNVs") , emit: CNV - tuple val(meta), path("*_info.txt") , emit: info - tuple val(meta), path("*_ratio.txt") , emit: ratio - tuple val(meta), path("config.txt") , emit: config - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - - println task.ext.args - //"General" configurations - def bedgraphoutput = task.ext.args?["general"]?["bedgraphoutput"] ? "BedGraphOutput = ${task.ext.args["general"]["bedgraphoutput"]}" : "" - def chr_files = chr_directory ? "chrFiles =\${PWD}/${chr_directory}" : "" - def chr_length = fai ? "chrLenFile = \${PWD}/${fai}" : "" - def breakpointthreshold = task.ext.args?["general"]?["breakpointthreshold"] ? "breakPointThreshold = ${task.ext.args["general"]["breakpointthreshold"]}" : "" - def breakpointtype = task.ext.args?["general"]?["breakpointtype"] ? "breakPointType = ${task.ext.args["general"]["breakpointtype"]}" : "" - def coefficientofvariation = task.ext.args?["general"]?["coefficient"] ? "coefficientOfVariation = ${task.ext.args["general"]["coefficientofvariation"]}" : "" - def contamination = task.ext.args?["general"]?["contamination"] ? "contamination = ${task.ext.args["general"]["contamination"]}" : "" - def contaminationadjustment = task.ext.args?["general"]?["contaminationadjustment"] ? "contaminationAdjustment = ${task.ext.args["general"]["contaminationadjustment"]}" : "" - def degree = task.ext.args?["general"]?["degree"] ? "degree = ${task.ext.args["general"]["degree"]}" : "" - def forcegccontentnormalization = task.ext.args?["general"]?["forcegccontentnormalization"] ? "forceGCcontentNormalization = ${task.ext.args["general"]["forcegccontentnormalization"]}" : "" - def gccontentprofile = gccontent_profile ? "GCcontentProfile = ${gccontent_profile}" : "" - def mappability = mappability ? "gemMappabilityFile = \${PWD}/${mappability}" : "" - def intercept = task.ext.args?["general"]?["intercept"] ? "intercept = ${task.ext.args["general"]["intercept"]}" : "" - def mincnalength = task.ext.args?["general"]?["mincnalength"] ? "minCNAlength = ${task.ext.args["general"]["mincnalength"]}" : "" - def minmappabilityperwindow = task.ext.args?["general"]?["minmappabilityperwindow"] ? "minMappabilityPerWindow = ${task.ext.args["general"]["minmappabilityperwindow"]}" : "" - def minexpectedgc = task.ext.args?["general"]?["minexpectedgc"] ? "minExpectedGC = ${task.ext.args["general"]["minexpectedgc"]}" : "" - def maxexpectedgc = task.ext.args?["general"]?["maxexpectedgc"] ? "maxExpectedGC = ${task.ext.args["general"]["maxexpectedgc"]}" : "" - def minimalsubclonepresence = task.ext.args?["general"]?["minimalsubclonepresence"] ? "minimalSubclonePresence = ${task.ext.args["general"]["minimalsubclonepresence"]}" : "" - def noisydata = task.ext.args?["general"]?["noisydata"] ? "noisyData = ${task.ext.args["general"]["noisydata"]}" : "" - def output = task.ext.prefix ? "outputDir = \${PWD}/${task.ext.prefix}" : "" - def ploidy = task.ext.args?["general"]?["ploidy"] ? "ploidy = ${task.ext.args["general"]["ploidy"]}" : "" - def printNA = task.ext.args?["general"]?["printNA"] ? "printNA = ${task.ext.args["general"]["printNA"]}" : "" - def readcountthreshold = task.ext.args?["general"]?["readcountthreshold"] ? "readCountThreshold = ${task.ext.args["general"]["readcountthreshold"]}" : "" - def sex = task.ext.args?["general"]?["sex"] ? "sex = ${task.ext.args["general"]["sex"]}" : "" - def step = task.ext.args?["general"]?["step"] ? "step = ${task.ext.args["general"]["step"]}" : "" - def telocentromeric = task.ext.args?["general"]?["telocentromeric"] ? "telocentromeric = ${task.ext.args["general"]["telocentromeric"]} " : "" - def uniquematch = task.ext.args?["general"]?["uniquematch"] ? "uniqueMatch = ${task.ext.args["general"]["uniquematch"]}" : "" - def window = task.ext.args?["general"]?["window"] ? "window = ${task.ext.args["general"]["window"]}" : "" - - //"Control" configurations - def matefile_normal = mpileup_normal ? "mateFile = \${PWD}/${mpileup_normal}" : "" - def matecopynumberfile_normal = cpn_normal ? "mateCopyNumberFile = \${PWD}/${cpn_normal}" : "" - def minipileup_normal = minipileup_normal ? "miniPileup = \${PWD}/${minipileup_normal}" : "" - def inputformat_normal = task.ext.args?["control"]?["inputformat"] ? "inputFormat = ${task.ext.args["control"]["inputformat"]}" : "" - def mateorientation_normal = task.ext.args?["control"]?["mateorientation"] ? "mateOrientation = ${task.ext.args["control"]["mateorientation"]}" : "" - - //"Sample" configuration - def matefile_tumor = mpileup_tumor ? "mateFile = \${PWD}/${mpileup_tumor}" : "" - def matecopynumberfile_tumor = cpn_tumor ? "mateCopyNumberFile = \${PWD}/${cpn_tumor}" : "" - def minipileup_tumor = minipileup_tumor ? "miniPileup = \${PWD}/${minipileup_tumor}" : "" - def inputformat_tumor = task.ext.args?["sample"]?["inputformat"] ? "inputFormat = ${task.ext.args["sample"]["inputformat"]}" : "" - def mateorientation_tumor = task.ext.args?["sample"]?["mateorientation"] ? "mateOrientation = ${task.ext.args["sample"]["mateorientation"]}" : "" - - //"BAF" configuration - def makepileup = snp_position ? "makePileup = \${PWD}/${snp_position}" : "" - def fastafile = fasta ? "fastaFile = \${PWD}/${fasta}" : "" - def minimalcoverageperposition = task.ext.args?["BAF"]?["minimalcoverageperposition"] ? "minimalCoveragePerPosition = ${task.ext.args["BAF"]["minimalcoverageperposition"]}" : "" - def minimalqualityperposition = task.ext.args?["BAF"]?["minimalqualityperposition"] ? "minimalQualityPerPosition = ${task.ext.args["BAF"]["minimalqualityperposition"]}" : "" - def shiftinquality = task.ext.args?["BAF"]?["shiftinquality"] ? "shiftInQuality = ${task.ext.args["BAF"]["shiftinquality"]}" : "" - def snpfile = known_snps ? "SNPfile = \$PWD/${known_snps}" : "" - - //"Target" configuration - def target_bed = target_bed ? "captureRegions = ${target_bed}" : "" - """ - touch config.txt - - echo "[general]" >> config.txt - echo ${bedgraphoutput} >> config.txt - echo ${breakpointthreshold} >> config.txt - echo ${breakpointtype} >> config.txt - echo ${chr_files} >> config.txt - echo ${chr_length} >> config.txt - echo ${coefficientofvariation} >> config.txt - echo ${contamination} >> config.txt - echo ${contaminationadjustment} >> config.txt - echo ${degree} >> config.txt - echo ${forcegccontentnormalization} >> config.txt - echo ${gccontentprofile} >> config.txt - echo ${mappability} >> config.txt - echo ${intercept} >> config.txt - echo ${mincnalength} >> config.txt - echo ${minmappabilityperwindow} >> config.txt - echo ${minexpectedgc} >> config.txt - echo ${maxexpectedgc} >> config.txt - echo ${minimalsubclonepresence} >> config.txt - echo "maxThreads = ${task.cpus}" >> config.txt - echo ${noisydata} >> config.txt - echo ${output} >> config.txt - echo ${ploidy} >> config.txt - echo ${printNA} >> config.txt - echo ${readcountthreshold} >> config.txt - echo ${sex} >> config.txt - echo ${step} >> config.txt - echo ${telocentromeric} >> config.txt - echo ${uniquematch} >> config.txt - echo ${window} >> config.txt - - echo "[control]" >> config.txt - echo ${matefile_normal} >> config.txt - echo ${matecopynumberfile_normal} >> config.txt - echo ${minipileup_normal} >> config.txt - echo ${inputformat_normal} >> config.txt - echo ${mateorientation_normal} >> config.txt - - echo "[sample]" >> config.txt - echo ${matefile_tumor} >> config.txt - echo ${matecopynumberfile_tumor} >> config.txt - echo ${minipileup_tumor} >> config.txt - echo ${inputformat_tumor} >> config.txt - echo ${mateorientation_tumor} >> config.txt - - echo "[BAF]" >> config.txt - echo ${makepileup} >> config.txt - echo ${fastafile} >> config.txt - echo ${minimalcoverageperposition} >> config.txt - echo ${minimalqualityperposition} >> config.txt - echo ${shiftinquality} >> config.txt - echo ${snpfile} >> config.txt - - echo "[target]" >> config.txt - echo ${target_bed} >> config.txt - - freec -conf config.txt - - 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" ) - END_VERSIONS - """ -} diff --git a/modules/nf-core/modules/controlfreec/makegraph/main.nf b/modules/nf-core/modules/controlfreec/makegraph/main.nf new file mode 100644 index 0000000000..9a0c7281af --- /dev/null +++ b/modules/nf-core/modules/controlfreec/makegraph/main.nf @@ -0,0 +1,40 @@ +process CONTROLFREEC_MAKEGRAPH { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::control-freec=11.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1': + 'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }" + + input: + tuple val(meta), path(ratio), path(baf) + + output: + tuple val(meta), path("*_BAF.png") , emit: png_baf + tuple val(meta), path("*_ratio.log2.png"), emit: png_ratio_log2 + tuple val(meta), path("*_ratio.png") , emit: png_ratio + + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: "" + def prefix = task.ext.prefix ?: "${meta.id}" + def baf = baf ?: "" + """ + cat /usr/local/bin/makeGraph.R | R --slave --args ${args} ${ratio} ${baf} + + mv *_BAF.txt.png ${prefix}_BAF.png + mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png + mv *_ratio.txt.png ${prefix}_ratio.png + + + 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" ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/controlfreec/makegraph/meta.yml b/modules/nf-core/modules/controlfreec/makegraph/meta.yml new file mode 100644 index 0000000000..a207ec8c8f --- /dev/null +++ b/modules/nf-core/modules/controlfreec/makegraph/meta.yml @@ -0,0 +1,58 @@ +name: controlfreec_makegraph +description: Plot Freec output +keywords: + - cna + - cnv + - somatic + - single + - tumor-only +tools: + - controlfreec: + description: Copy number and genotype annotation from whole genome and whole exome sequencing data. + homepage: http://boevalab.inf.ethz.ch/FREEC + documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html + tool_dev_url: https://github.com/BoevaLab/FREEC/ + doi: "10.1093/bioinformatics/btq635" + licence: ["GPL >=2"] + +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ratio: + type: file + description: ratio file generated by FREEC + pattern: "*.ratio.txt" + - baf: + type: file + description: .BAF file generated by FREEC + pattern: "*.BAF" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - png_baf: + type: file + description: Image of BAF plot + pattern: "*_BAF.png" + - png_ratio_log2: + type: file + description: Image of ratio log2 plot + pattern: "*_ratio.log2.png" + - png_ratio: + type: file + description: Image of ratio plot + pattern: "*_ratio.png" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/controlfreec/meta.yml b/modules/nf-core/modules/controlfreec/meta.yml deleted file mode 100644 index b2a6772b5c..0000000000 --- a/modules/nf-core/modules/controlfreec/meta.yml +++ /dev/null @@ -1,182 +0,0 @@ -name: controlfreec -description: Copy number and genotype annotation from whole genome and whole exome sequencing data -keywords: - - cna - - cnv - - somatic - - single - - tumor-only -tools: - - controlfreec: - description: Copy number and genotype annotation from whole genome and whole exome sequencing data. - homepage: http://boevalab.inf.ethz.ch/FREEC - documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html - tool_dev_url: https://github.com/BoevaLab/FREEC/ - doi: "10.1093/bioinformatics/btq635" - licence: ["GPL >=2"] - -input: - - args: - type: map - description: | - Groovy Map containing tool parameters. MUST follow the structure/keywords below and be provided via modules.config. - Parameters marked as (optional) can be removed from the map, if they are not set. All values must be surrounded by quotes, meta map parameters can be set with, i.e. `sex = meta.sex`: - For default values, please check the documentation above. - - ``` - { - [ - "general" :[ - "bedgraphoutput": (optional), - "breakpointthreshold": (optional), - "breakpointtype": (optional), - "coefficientofvariation": (optional), - "contamination": (optional), - "contaminationadjustment": (optional), - "degree": (optional), - "forcegccontentnormalization": (optional), - "gccontentprofile": (optional), - "intercept": (optional), - "mincnalength": (optional), - "minmappabilityperwindow": (optional), - "minexpectedgc": (optional), - "maxexpectedgc": (optional), - "minimalsubclonepresence": (optional), - "noisydata": (optional), - "ploidy": (optional), - "printNA": (optional), - "readcountthreshold": (optional), - "sex": (optional), - "step": (optional), - "telocentromeric": (optional), - "uniquematch": (optional), - "window": (optional) - ], - "control":[ - "inputformat": (required), - "mateorientation": (optional), - ], - "sample":[ - "inputformat": (required), - "mateorientation": (optional), - ], - "BAF":[ - "minimalcoverageperposition": (optional), - "minimalqualityperposition": (optional), - "shiftinquality": (optional) - ] - ] - } - ``` - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - mateFile_normal: - type: file - description: File with mapped reads - pattern: "*.{sam,bam,pileup(.gz),bowtie(.gz),eland(.gz),arachne(.gz),psl(.gz),bed(.gz)}" - - mateFile_tumor: - type: file - description: File with mapped reads - pattern: "*.{sam,bam,pileup(.gz),bowtie(.gz),eland(.gz),arachne(.gz),psl(.gz),bed(.gz)}" - - cpn_normal: - type: file - description: Raw copy number profiles (optional) - pattern: "*.cpn" - - cpn_tumor: - type: file - description: Raw copy number profiles (optional) - pattern: "*.cpn" - - minipileup_normal: - type: file - description: miniPileup file from previous run (optional) - pattern: "*.pileup" - - minipileup_tumor: - type: file - description: miniPileup file from previous run (optional) - pattern: "*.pileup" - - fasta: - type: file - description: Reference file (optional; required if args 'makePileup' is set) - pattern: "*.{fasta,fna,fa}" - - fai: - type: file - description: Fasta index - pattern: "*.fai" - - snp_position: - type: file - description: - pattern: "*.{}" - - known_snps: - type: file - description: File with known SNPs - pattern: "*.{vcf,vcf.gz}" - - known_snps_tbi: - type: file - description: Index of known_snps - pattern: "*.tbi" - - chr_directory: - type: file - description: Path to directory with chromosome fasta files (optional, required if gccontentprofile is not provided) - pattern: "*/" - - mappability: - type: file - description: Contains information of mappable positions (optional) - pattern: "*.gem" - - target_bed: - type: file - description: Sorted bed file containing capture regions (optional) - pattern: "*.bed" - -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - bedgraph: - type: file - description: Bedgraph format for the UCSC genome browser - pattern: ".bedgraph" - - control_cpn: - type: file - description: files with raw copy number profiles - pattern: "*_control.cpn" - - sample_cpn: - type: file - description: files with raw copy number profiles - pattern: "*_sample.cpn" - - gcprofile_cpn: - type: file - description: file with GC-content profile. - pattern: "GC_profile.*.cpn" - - BAF: - type: file - description: file B-allele frequencies for each possibly heterozygous SNP position - pattern: "*_BAF.txt" - - CNV: - type: file - description: file with coordinates of predicted copy number alterations. - pattern: "*_CNVs" - - info: - type: file - description: parsable file with information about FREEC run - pattern: "*_info.txt" - - ratio: - type: file - description: file with ratios and predicted copy number alterations for each window - pattern: "*_ratio.txt" - - config: - type: file - description: Config file used to run Control-FREEC - pattern: "config.txt" - -authors: - - "@FriederikeHanssen" diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 113379526e..b24b4e6098 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -71,6 +71,7 @@ workflow TUMOR_ONLY_VARIANT_CALLING { mappability, intervals_bed_combined, num_intervals) + ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) } if (tools.contains('freebayes')){ diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index 9f2d71acb1..72a15bfe72 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -1,6 +1,10 @@ -include { CAT_CAT as CAT } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CONTROLFREEC } from '../../../../modules/nf-core/modules/controlfreec/main' -include { SAMTOOLS_MPILEUP as MPILEUP } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { CAT_CAT as CAT } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' +include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' +include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' +include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' +include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' +include { SAMTOOLS_MPILEUP as MPILEUP } from '../../../../modules/nf-core/modules/samtools/mpileup/main' workflow RUN_CONTROLFREEC { take: @@ -32,14 +36,14 @@ workflow RUN_CONTROLFREEC { [new_meta, pileup] }.groupTuple(size: num_intervals)) - controlfeec_input = Channel.empty().mix( + controlfreec_input = Channel.empty().mix( CAT.out.file_out, mpileup.no_intervals ).map{ meta, pileup -> - [meta, pileup, [], [], [], [], []] + [meta, [], pileup, [], [], [], []] } - CONTROLFREEC(controlfeec_input, + FREEC(controlfreec_input, fasta, fasta_fai, [], @@ -49,7 +53,11 @@ workflow RUN_CONTROLFREEC { mappability, intervals_bed, []) - //CONTROLFREECVis + + ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) + FREEC2BED( FREEC.out.ratio ) + FREEC2CIRCOS( FREEC.out.ratio ) + MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) emit: From 44a1a377072dfd437f986e0abce73ffedce15e44 Mon Sep 17 00:00:00 2001 From: Rike Date: Sat, 26 Mar 2022 21:34:14 +0100 Subject: [PATCH 06/45] Install freec2circos --- modules.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules.json b/modules.json index aa62c09bfd..3369f94fbf 100644 --- a/modules.json +++ b/modules.json @@ -39,6 +39,9 @@ "controlfreec/freec2bed": { "git_sha": "8a64e73af29a8096e1996e0496df4ae8c449c40b" }, + "controlfreec/freec2circos": { + "git_sha": "5acf301ddda04072cf7233a6c8f5fa5df867de99" + }, "controlfreec/makegraph": { "git_sha": "28e5211b3513d80f198beb7090f57242165cc030" }, From c0473a9ed4bc488f0aa5c42a63354a50d5d1f618 Mon Sep 17 00:00:00 2001 From: Rike Date: Sat, 26 Mar 2022 23:27:44 +0100 Subject: [PATCH 07/45] Work on pari contronlfreec implementation to get tests to pass --- conf/modules.config | 6 +- subworkflows/local/pair_variant_calling.nf | 22 ++++++ subworkflows/local/tumor_variant_calling.nf | 24 +++--- .../variantcalling/controlfreec/main.nf | 74 ++++++++++++++----- tests/test_tools.yml | 11 +++ workflows/sarek.nf | 4 +- 6 files changed, 110 insertions(+), 31 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 0b8bda35b5..3c6d9b3e5c 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -599,7 +599,7 @@ process{ // TUMOR_VARIANT_CALLING //CONTROLFREEC - withName:CONTROLFREEC_FREEC{ + withName:FREEC{ ext.args = { [ "sample":[ inputformat: 'pileup', @@ -613,6 +613,10 @@ process{ sex: meta.sex, window: "10", ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] ] } } diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index e3ddcc1b0d..ebcf0f49fb 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -3,6 +3,7 @@ // include { GATK_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_normal_somatic_variant_calling/main' include { MSISENSORPRO_MSI_SOMATIC } from '../../modules/nf-core/modules/msisensorpro/msi_somatic/main' +include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' include { RUN_MANTA_SOMATIC } from '../nf-core/variantcalling/manta/somatic/main.nf' include { RUN_STRELKA_SOMATIC } from '../nf-core/variantcalling/strelka/somatic/main.nf' @@ -27,6 +28,8 @@ workflow PAIR_VARIANT_CALLING { germline_resource_tbi // channel: [optional] germline_resource_tbi panel_of_normals // channel: [optional] panel_of_normals panel_of_normals_tbi // channel: [optional] panel_of_normals_tbi + chr_length + mappability main: @@ -60,6 +63,25 @@ workflow PAIR_VARIANT_CALLING { [new_meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals] } + if (tools.contains('controlfreec')){ + cram_pair_intervals.map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals + -> [meta, normal_cram, intervals]}.set{cram_normal_intervals_no_index} + + cram_pair_intervals.map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals + -> [meta, tumor_cram, intervals]}.set{cram_tumor_intervals_no_index} + + RUN_CONTROLFREEC(cram_normal_intervals_no_index, + cram_tumor_intervals_no_index, + fasta, + fasta_fai, + dbsnp, + dbsnp_tbi, + chr_length, + mappability, + intervals_bed_combined, + num_intervals) + ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) + } if (tools.contains('manta')) { RUN_MANTA_SOMATIC( cram_pair_intervals_gz_tbi, fasta, diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index b24b4e6098..69bc233a5e 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -3,7 +3,7 @@ // Should be only run on patients without normal sample // -include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' +//include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' include { RUN_FREEBAYES } from '../nf-core/variantcalling/freebayes/main.nf' include { GATK_TUMOR_ONLY_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_only_somatic_variant_calling/main' include { RUN_MANTA_TUMORONLY } from '../nf-core/variantcalling/manta/tumoronly/main.nf' @@ -61,17 +61,17 @@ workflow TUMOR_ONLY_VARIANT_CALLING { }.set{cram_recalibrated_intervals_gz_tbi} if(tools.contains('controlfreec')){ - cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} - RUN_CONTROLFREEC(cram_intervals_no_index, - fasta, - fasta_fai, - dbsnp, - dbsnp_tbi, - chr_length, - mappability, - intervals_bed_combined, - num_intervals) - ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) + // cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} + // RUN_CONTROLFREEC(cram_intervals_no_index, + // fasta, + // fasta_fai, + // dbsnp, + // dbsnp_tbi, + // chr_length, + // mappability, + // intervals_bed_combined, + // num_intervals) + // ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) } if (tools.contains('freebayes')){ diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index 72a15bfe72..c1e50398b9 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -1,14 +1,17 @@ -include { CAT_CAT as CAT } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' -include { SAMTOOLS_MPILEUP as MPILEUP } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' workflow RUN_CONTROLFREEC { take: - cram // channel: [mandatory] [meta, cram, crai, interval] + cram_normal // channel: [mandatory] [meta, cram, crai, interval] + cram_tumor // channel: [mandatory] [meta, cram, crai, interval] fasta // channel: [mandatory] fasta_fai // channel: [mandatory] dbsnp // channel: [mand] @@ -22,27 +25,65 @@ workflow RUN_CONTROLFREEC { ch_versions = Channel.empty() - MPILEUP(cram, fasta) + MPILEUP_NORMAL(cram_normal, fasta) - MPILEUP.out.mpileup.branch{ + MPILEUP_NORMAL.out.mpileup.branch{ intervals: num_intervals > 1 no_intervals: num_intervals == 1 - }.set{mpileup} + }.set{mpileup_normal} + MPILEUP_TUMOR(cram_tumor, fasta) + + MPILEUP_TUMOR.out.mpileup.branch{ + intervals: num_intervals > 1 + no_intervals: num_intervals == 1 + }.set{mpileup_tumor} + + //TODO Check do the files ned to be sorted by start index? //Merge mpileup only when intervals - CAT(mpileup.intervals.map{ meta, pileup -> + CAT_NORMAL(mpileup_normal.intervals.map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.sample + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_normal" [new_meta, pileup] }.groupTuple(size: num_intervals)) - controlfreec_input = Channel.empty().mix( - CAT.out.file_out, - mpileup.no_intervals + CAT_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" + [new_meta, pileup] + }.groupTuple(size: num_intervals)) + + //TODO fix naming for no intervals + + controlfreec_input_normal = Channel.empty().mix( + CAT_NORMAL.out.file_out, + mpileup_normal.no_intervals ).map{ meta, pileup -> - [meta, [], pileup, [], [], [], []] + new_meta = meta.clone() + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + [new_meta, pileup] } + controlfreec_input_tumor = Channel.empty().mix( + CAT_TUMOR.out.file_out, + mpileup_tumor.no_intervals + ).map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + [new_meta, pileup] + } + + //).map{ meta, pileup_normal, pileup_tumor -> + // [meta, pileup_normal, pileup_tumor, [], [], [], []] + //} + controlfreec_input_normal.view() + controlfreec_input_tumor.view() + + controlfreec_input_normal.join(controlfreec_input_tumor) + .map{ meta, pileup_normal, pileup_tumor -> + [meta, pileup_normal, pileup_tumor, [], [], [], []] + }.set{controlfreec_input} + controlfreec_input.view() FREEC(controlfreec_input, fasta, fasta_fai, @@ -54,11 +95,10 @@ workflow RUN_CONTROLFREEC { intervals_bed, []) - ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) - FREEC2BED( FREEC.out.ratio ) - FREEC2CIRCOS( FREEC.out.ratio ) - MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) - + // ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) + // FREEC2BED( FREEC.out.ratio ) + // FREEC2CIRCOS( FREEC.out.ratio ) + // MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) emit: versions = ch_versions diff --git a/tests/test_tools.yml b/tests/test_tools.yml index c372f93a8f..247c171238 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -1,3 +1,14 @@ +- name: Run variant calling on tumor_only sample with controlfreec + command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec + tags: + - controlfreec + - no_intervals + - tumor_only + - variant_calling + - copy_number_calling + files: + - path: results/variant_calling/sample2/controlfreec/sample2.candidate_small_indels.vcf.gz + - name: Run variant calling on germline sample with deepvariant command: nextflow run main.nf -profile test,tools_germline,docker --tools deepvariant tags: diff --git a/workflows/sarek.nf b/workflows/sarek.nf index fad7299fa5..a032514050 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -633,7 +633,9 @@ workflow SAREK { germline_resource, germline_resource_tbi, pon, - pon_tbi) + pon_tbi, + chr_length, + mappability) // Gather vcf files for annotation vcf_to_annotate = Channel.empty() From ffe76cde48bfcb844f98a0a8fb410f712d6de62b Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 28 Mar 2022 16:02:50 +0200 Subject: [PATCH 08/45] First running version of ControlFreec --- conf/igenomes.config | 3 --- conf/modules.config | 2 +- conf/test.config | 1 + nextflow.config | 4 ++-- nextflow_schema.json | 5 ---- subworkflows/local/pair_variant_calling.nf | 4 ++-- subworkflows/local/tumor_variant_calling.nf | 1 - .../variantcalling/controlfreec/main.nf | 24 ++++++++++++------- workflows/sarek.nf | 6 ++--- 9 files changed, 23 insertions(+), 27 deletions(-) diff --git a/conf/igenomes.config b/conf/igenomes.config index e182f8995f..9aa5983484 100644 --- a/conf/igenomes.config +++ b/conf/igenomes.config @@ -16,7 +16,6 @@ params { ac_loci_gc = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/1000G_phase3_20130502_SNP_maf0.3.loci.gc" bwa = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/BWAIndex/human_g1k_v37_decoy.fasta.{amb,ann,bwt,pac,sa}" chr_dir = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/Chromosomes" - chr_length = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/Length/human_g1k_v37_decoy.len" dbsnp = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/dbsnp_138.b37.vcf" dbsnp_tbi = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/dbsnp_138.b37.vcf.idx" dict = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/WholeGenomeFasta/human_g1k_v37_decoy.dict" @@ -38,7 +37,6 @@ params { ac_loci_gc = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/ASCAT/1000G_phase3_GRCh38_maf0.3.loci.gc" bwa = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/BWAIndex/Homo_sapiens_assembly38.fasta.64.{alt,amb,ann,bwt,pac,sa}" chr_dir = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/Chromosomes" - chr_length = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/Length/Homo_sapiens_assembly38.len" dbsnp = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/dbsnp_146.hg38.vcf.gz" dbsnp_tbi = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/dbsnp_146.hg38.vcf.gz.tbi" dict = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.dict" @@ -67,7 +65,6 @@ params { 'GRCm38' { bwa = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Sequence/BWAIndex/genome.fa.{amb,ann,bwt,pac,sa}" chr_dir = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Sequence/Chromosomes" - chr_length = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Sequence/Length/GRCm38.len" dbsnp = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/MouseGenomeProject/mgp.v5.merged.snps_all.dbSNP142.vcf.gz" dbsnp_tbi = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/MouseGenomeProject/mgp.v5.merged.snps_all.dbSNP142.vcf.gz.tbi" dict = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Sequence/WholeGenomeFasta/genome.dict" diff --git a/conf/modules.config b/conf/modules.config index 3c6d9b3e5c..7dc9eef266 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -610,7 +610,7 @@ process{ noisydata: "TRUE", minexpectedgc: "0", readcountthreshold: "1", - sex: meta.sex, + sex: meta.gender, window: "10", ], "control":[ diff --git a/conf/test.config b/conf/test.config index ac0f738b2f..9de54ea2ac 100644 --- a/conf/test.config +++ b/conf/test.config @@ -123,6 +123,7 @@ profiles { params.wes = true params.genome = 'WBcel235' params.vep_genome = 'WBcel235' + params.chr_dir = '/Users/monarchy/Projects/Coding/modules/work/2a/d04831835d0ab95ba9fad3a461fc4f/chromosomes' } trimming { params.clip_r1 = 1 diff --git a/nextflow.config b/nextflow.config index 7425c188c8..dcd91400a9 100644 --- a/nextflow.config +++ b/nextflow.config @@ -51,12 +51,12 @@ params { sequencing_center = null // No sequencing center to be written in BAM header by bwa/bwa-mem2 mem // Variant Calling - ascat_ploidy = null // Use default value + ploidy = 2 //null // Use default value, you can use 2,3,4 ascat_purity = null // Use default value cf_coeff = 0.05 // default value for Control-FREEC cf_contamination = null // by default not specified in Control-FREEC cf_contamination_adjustment = false // by default we are not using this in Control-FREEC - cf_ploidy = 2 // you can use 2,3,4 + //cf_ploidy = 2 // you can use 2,3,4 cf_window = null // by default we are not using this in Control-FREEC generate_gvcf = false // g.vcf are not produced by HaplotypeCaller by default no_strelka_bp = false // Strelka will use Manta candidateSmallIndels if available diff --git a/nextflow_schema.json b/nextflow_schema.json index cfcfcc18d0..d81c1c70fc 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -416,11 +416,6 @@ "fa_icon": "fas fa-folder-open", "description": "Path to chromosomes folder." }, - "chr_length": { - "type": "string", - "fa_icon": "fas fa-file", - "description": "Path to chromosomes length file." - }, "dbsnp": { "type": "string", "fa_icon": "fas fa-file", diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index ebcf0f49fb..7e0e92c4b7 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -28,7 +28,7 @@ workflow PAIR_VARIANT_CALLING { germline_resource_tbi // channel: [optional] germline_resource_tbi panel_of_normals // channel: [optional] panel_of_normals panel_of_normals_tbi // channel: [optional] panel_of_normals_tbi - chr_length + chr_files mappability main: @@ -76,7 +76,7 @@ workflow PAIR_VARIANT_CALLING { fasta_fai, dbsnp, dbsnp_tbi, - chr_length, + chr_files, mappability, intervals_bed_combined, num_intervals) diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 69bc233a5e..5e71c4645f 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -29,7 +29,6 @@ workflow TUMOR_ONLY_VARIANT_CALLING { germline_resource_tbi // channel: [optional] germline_resource_tbi panel_of_normals // channel: [optional] panel_of_normals panel_of_normals_tbi // channel: [optional] panel_of_normals_tbi - chr_length mappability main: diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index c1e50398b9..0e02109a20 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -8,6 +8,9 @@ include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../. include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { BGZIP_ZIP as BGZIP_ZIP_TUMOR } from '../../../../modules/local/bgzip_zip.nf' +include { BGZIP_ZIP as BGZIP_ZIP_NORMAL } from '../../../../modules/local/bgzip_zip.nf' + workflow RUN_CONTROLFREEC { take: cram_normal // channel: [mandatory] [meta, cram, crai, interval] @@ -16,7 +19,7 @@ workflow RUN_CONTROLFREEC { fasta_fai // channel: [mandatory] dbsnp // channel: [mand] dbsnp_tbi - chr_length + chr_files mappability intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. @@ -72,12 +75,15 @@ workflow RUN_CONTROLFREEC { [new_meta, pileup] } + // BGZIP_ZIP_TUMOR(controlfreec_input_tumor) + // BGZIP_ZIP_NORMAL(controlfreec_input_normal) + //).map{ meta, pileup_normal, pileup_tumor -> // [meta, pileup_normal, pileup_tumor, [], [], [], []] //} - controlfreec_input_normal.view() - controlfreec_input_tumor.view() + // controlfreec_input_normal.view() + // controlfreec_input_tumor.view() controlfreec_input_normal.join(controlfreec_input_tumor) .map{ meta, pileup_normal, pileup_tumor -> @@ -86,19 +92,19 @@ workflow RUN_CONTROLFREEC { controlfreec_input.view() FREEC(controlfreec_input, fasta, - fasta_fai, + fasta_fai, // = chr_length [], dbsnp, dbsnp_tbi, - chr_length, + chr_files, mappability, intervals_bed, []) - // ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) - // FREEC2BED( FREEC.out.ratio ) - // FREEC2CIRCOS( FREEC.out.ratio ) - // MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) + ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) + FREEC2BED( FREEC.out.ratio ) + FREEC2CIRCOS( FREEC.out.ratio ) + MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) emit: versions = ch_versions diff --git a/workflows/sarek.nf b/workflows/sarek.nf index a032514050..59c459c318 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -19,7 +19,6 @@ def checkPathParamList = [ params.cadd_wg_snvs, params.cadd_wg_snvs_tbi, params.chr_dir, - params.chr_length, params.dbsnp, params.dbsnp_tbi, params.dict, @@ -80,7 +79,6 @@ if (anno_readme && file(anno_readme).exists()) { // Initialize file channels based on params, defined in the params.genomes[params.genome] scope chr_dir = params.chr_dir ? Channel.fromPath(params.chr_dir).collect() : [] -chr_length = params.chr_length ? Channel.fromPath(params.chr_length).collect() : [] dbsnp = params.dbsnp ? Channel.fromPath(params.dbsnp).collect() : Channel.empty() fasta = params.fasta ? Channel.fromPath(params.fasta).collect() : Channel.empty() fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() : Channel.empty() @@ -609,11 +607,11 @@ workflow SAREK { germline_resource_tbi, pon, pon_tbi, - chr_length, mappability ) // PAIR VARIANT CALLING + chr_dir.view() PAIR_VARIANT_CALLING( params.tools, cram_variant_calling_pair, @@ -634,7 +632,7 @@ workflow SAREK { germline_resource_tbi, pon, pon_tbi, - chr_length, + chr_dir, mappability) // Gather vcf files for annotation From 245c1d9e26c1ce97a6615486bf4dd9d132477e8d Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 30 Mar 2022 09:50:42 +0200 Subject: [PATCH 09/45] nf-core modules update freec to fix typo --- modules.json | 2 +- modules/nf-core/modules/controlfreec/freec/main.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.json b/modules.json index 3369f94fbf..a089b62d07 100644 --- a/modules.json +++ b/modules.json @@ -34,7 +34,7 @@ "git_sha": "28e5211b3513d80f198beb7090f57242165cc030" }, "controlfreec/freec": { - "git_sha": "4efa8da5c5bd8b68d667ddade7ed398e16c145f6" + "git_sha": "1ec1868264a8429e02ee3dca881b69c80239c9dc" }, "controlfreec/freec2bed": { "git_sha": "8a64e73af29a8096e1996e0496df4ae8c449c40b" diff --git a/modules/nf-core/modules/controlfreec/freec/main.nf b/modules/nf-core/modules/controlfreec/freec/main.nf index ba48ea1e7b..eb66eeaa34 100644 --- a/modules/nf-core/modules/controlfreec/freec/main.nf +++ b/modules/nf-core/modules/controlfreec/freec/main.nf @@ -41,7 +41,7 @@ process CONTROLFREEC_FREEC { def chr_length = fai ? "chrLenFile = \${PWD}/${fai}" : "" def breakpointthreshold = task.ext.args?["general"]?["breakpointthreshold"] ? "breakPointThreshold = ${task.ext.args["general"]["breakpointthreshold"]}" : "" def breakpointtype = task.ext.args?["general"]?["breakpointtype"] ? "breakPointType = ${task.ext.args["general"]["breakpointtype"]}" : "" - def coefficientofvariation = task.ext.args?["general"]?["coefficient"] ? "coefficientOfVariation = ${task.ext.args["general"]["coefficientofvariation"]}" : "" + def coefficientofvariation = task.ext.args?["general"]?["coefficientofvariation"] ? "coefficientOfVariation = ${task.ext.args["general"]["coefficientofvariation"]}" : "" def contamination = task.ext.args?["general"]?["contamination"] ? "contamination = ${task.ext.args["general"]["contamination"]}" : "" def contaminationadjustment = task.ext.args?["general"]?["contaminationadjustment"] ? "contaminationAdjustment = ${task.ext.args["general"]["contaminationadjustment"]}" : "" def degree = task.ext.args?["general"]?["degree"] ? "degree = ${task.ext.args["general"]["degree"]}" : "" From be78070ebb969c839957e15d673dae4e32b9d7fe Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 30 Mar 2022 09:51:07 +0200 Subject: [PATCH 10/45] fix manta-strelka combination output channel name --- subworkflows/local/pair_variant_calling.nf | 2 +- .../nf-core/variantcalling/ascat/main.nf | 0 .../nf-core/variantcalling/cnvkit/main.nf | 0 .../variantcalling/controlfreec/main.nf | 29 +++++-------------- 4 files changed, 9 insertions(+), 22 deletions(-) create mode 100644 subworkflows/nf-core/variantcalling/ascat/main.nf create mode 100644 subworkflows/nf-core/variantcalling/cnvkit/main.nf diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index 7e0e92c4b7..d9544095e5 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -96,7 +96,7 @@ workflow PAIR_VARIANT_CALLING { if (tools.contains('strelka')) { if (tools.contains('manta')) { - cram_pair_strelka = intervals_bed_gz_tbi.join(manta_somatic_sv_vcf).map{ + cram_pair_strelka = intervals_bed_gz_tbi.join(manta_vcf).map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai, bed, tbi, manta_vcf, manta_tbi -> [meta, normal_cram, normal_crai, tumor_cram, tumor_crai, manta_vcf, manta_tbi, bed, tbi] } diff --git a/subworkflows/nf-core/variantcalling/ascat/main.nf b/subworkflows/nf-core/variantcalling/ascat/main.nf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/subworkflows/nf-core/variantcalling/cnvkit/main.nf b/subworkflows/nf-core/variantcalling/cnvkit/main.nf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index 0e02109a20..483f19741d 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -8,9 +8,6 @@ include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../. include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' -include { BGZIP_ZIP as BGZIP_ZIP_TUMOR } from '../../../../modules/local/bgzip_zip.nf' -include { BGZIP_ZIP as BGZIP_ZIP_NORMAL } from '../../../../modules/local/bgzip_zip.nf' - workflow RUN_CONTROLFREEC { take: cram_normal // channel: [mandatory] [meta, cram, crai, interval] @@ -42,21 +39,20 @@ workflow RUN_CONTROLFREEC { no_intervals: num_intervals == 1 }.set{mpileup_tumor} - //TODO Check do the files ned to be sorted by start index? - //Merge mpileup only when intervals - CAT_NORMAL(mpileup_normal.intervals.map{ meta, pileup -> + //Merge mpileup only when intervals and natural order sort them + CAT_NORMAL( mpileup_normal.intervals.map{ meta, pileup -> new_meta = meta.clone() new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_normal" [new_meta, pileup] - }.groupTuple(size: num_intervals)) + }.groupTuple(size: num_intervals, sort:true)) CAT_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> new_meta = meta.clone() new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" [new_meta, pileup] - }.groupTuple(size: num_intervals)) + }.groupTuple(size: num_intervals, sort:true)) - //TODO fix naming for no intervals + // //TODO fix naming for no intervals controlfreec_input_normal = Channel.empty().mix( CAT_NORMAL.out.file_out, @@ -75,24 +71,15 @@ workflow RUN_CONTROLFREEC { [new_meta, pileup] } - // BGZIP_ZIP_TUMOR(controlfreec_input_tumor) - // BGZIP_ZIP_NORMAL(controlfreec_input_normal) - - //).map{ meta, pileup_normal, pileup_tumor -> - // [meta, pileup_normal, pileup_tumor, [], [], [], []] - //} - - // controlfreec_input_normal.view() - // controlfreec_input_tumor.view() - controlfreec_input_normal.join(controlfreec_input_tumor) .map{ meta, pileup_normal, pileup_tumor -> [meta, pileup_normal, pileup_tumor, [], [], [], []] }.set{controlfreec_input} - controlfreec_input.view() + + println params.cf_coeff FREEC(controlfreec_input, fasta, - fasta_fai, // = chr_length + fasta_fai, [], dbsnp, dbsnp_tbi, From 241ef86a83a3bff43f1b502656c0d7ae2d60a63f Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 30 Mar 2022 09:52:13 +0200 Subject: [PATCH 11/45] add nextflow config with test args for freec --- tests/nextflow.config | 27 +++++++++++++++++++++++++++ tests/test_tools.yml | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tests/nextflow.config diff --git a/tests/nextflow.config b/tests/nextflow.config new file mode 100644 index 0000000000..cd309638a9 --- /dev/null +++ b/tests/nextflow.config @@ -0,0 +1,27 @@ +process { + + withName:FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + breakpointthreshold: params.wes ? "1.2" : "0.8", + contamination: params.cf_contamination ? "contamination = ${params.cf_contamination}" : "", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.gender, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } + +} diff --git a/tests/test_tools.yml b/tests/test_tools.yml index 247c171238..13bd4fdc4a 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -1,9 +1,9 @@ - name: Run variant calling on tumor_only sample with controlfreec - command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec + command: nextflow run main.nf -profile test,tools_somatic,docker --tools controlfreec -c ./tests/nextflow.config tags: - controlfreec - no_intervals - - tumor_only + - somatic - variant_calling - copy_number_calling files: From 577cff89ffc5ec119fcd8327f7c2ac2db800ec7c Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 30 Mar 2022 15:55:35 +0200 Subject: [PATCH 12/45] Fix StrelkaBP input mapping --- conf/modules.config | 36 +++++++++++++++---- subworkflows/local/pair_variant_calling.nf | 28 +++++++++++---- .../nf-core/variantcalling/ascat/main.nf | 10 ++++++ .../variantcalling/manta/somatic/main.nf | 19 +++++++++- 4 files changed, 79 insertions(+), 14 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 7dc9eef266..66c61638ae 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -607,18 +607,42 @@ process{ ], "general" :[ bedgraphoutput: "TRUE", - noisydata: "TRUE", - minexpectedgc: "0", - readcountthreshold: "1", + breakpointthreshold: params.wes ? "1.2" : "0.8", + breakpointtype: params.wes ? "4" : "2", + //coefficientofvariation: params.cf_coeff, + //contamination: params.cf_contamination ? "contamination = ${params.cf_contamination}" : "" + //contaminationadjustment: params.cf_contamination_adjustment ? "contaminationAdjustment = TRUE" : "" + //degree not set + //forcegccontentnormalization: "1", //sarek 2.7.1 + //gccontentprofile not set + //intercept not set + //mincnalength not set + //minmappabilityperwindow not set + //minexpectedgc not set + //maxexpectedgc not set + //minimalsubclonepresence min_subclone = 100 + //noisydata: not set + //ploidy: ${params.cf_ploidy} + //printNA not set + //readcountthreshold: params.target_bed ? "50" : "10" sex: meta.gender, - window: "10", + //step not set + //telocentromeric not set + //uniquematch: not set + //window: params.cf_window, //params.cf_window ? "window = ${params.cf_window}" : "" + ], "control":[ inputformat: "pileup", mateorientation: "FR" + ], + "BAF":[ + //"minimalcoverageperposition": (optional),not set + //"minimalqualityperposition": (optional),not set + //"shiftinquality": (optional)not set ] - ] - } + ] + } } withName: 'MAKEGRAPH' { diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index d9544095e5..50def0d2cf 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -89,17 +89,29 @@ workflow PAIR_VARIANT_CALLING { intervals_bed_combine_gz, num_intervals) - manta_vcf = RUN_MANTA_SOMATIC.out.manta_vcf - ch_versions = ch_versions.mix(RUN_MANTA_SOMATIC.out.versions) + manta_vcf = RUN_MANTA_SOMATIC.out.manta_vcf + manta_candidate_small_indels_vcf = RUN_MANTA_SOMATIC.out.manta_candidate_small_indels_vcf + manta_candidate_small_indels_vcf_tbi = RUN_MANTA_SOMATIC.out.manta_candidate_small_indels_vcf_tbi + ch_versions = ch_versions.mix(RUN_MANTA_SOMATIC.out.versions) } if (tools.contains('strelka')) { - + //TODO: Fix manta strelkaBP if (tools.contains('manta')) { - cram_pair_strelka = intervals_bed_gz_tbi.join(manta_vcf).map{ - meta, normal_cram, normal_crai, tumor_cram, tumor_crai, bed, tbi, manta_vcf, manta_tbi -> - [meta, normal_cram, normal_crai, tumor_cram, tumor_crai, manta_vcf, manta_tbi, bed, tbi] - } + + cram_pair_strelka = cram_pair.join(manta_candidate_small_indels_vcf) + .join(manta_candidate_small_indels_vcf_tbi) + .combine(intervals_bed_gz_tbi) + .map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai, vcf, vcf_tbi, bed, bed_tbi -> + normal_id = meta.normal_id + tumor_id = meta.tumor_id + + new_bed = bed.simpleName != "no_intervals" ? bed : [] + new_tbi = bed_tbi.simpleName != "no_intervals" ? bed_tbi : [] + id = bed.simpleName != "no_intervals" ? tumor_id + "_vs_" + normal_id + "_" + bed.simpleName : tumor_id + "_vs_" + normal_id + new_meta = [ id: id, normal_id: meta.normal_id, tumor_id: meta.tumor_id, gender: meta.gender, patient: meta.patient] + [new_meta, normal_cram, normal_crai, tumor_cram, tumor_crai, vcf, vcf_tbi, new_bed, new_tbi] + } } else { cram_pair_strelka = cram_pair_intervals_gz_tbi.map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai, bed, tbi -> @@ -107,6 +119,8 @@ workflow PAIR_VARIANT_CALLING { } } + + RUN_STRELKA_SOMATIC(cram_pair_strelka, fasta, fasta_fai, diff --git a/subworkflows/nf-core/variantcalling/ascat/main.nf b/subworkflows/nf-core/variantcalling/ascat/main.nf index e69de29bb2..88c77e134d 100644 --- a/subworkflows/nf-core/variantcalling/ascat/main.nf +++ b/subworkflows/nf-core/variantcalling/ascat/main.nf @@ -0,0 +1,10 @@ +include { ASCAT } from '../../modules/nf-core/modules/ascat/main' + +workflow RUN_ASCAT { + + take: + + main: + + emit: +} diff --git a/subworkflows/nf-core/variantcalling/manta/somatic/main.nf b/subworkflows/nf-core/variantcalling/manta/somatic/main.nf index 34e2f5eb9c..249b3ec091 100644 --- a/subworkflows/nf-core/variantcalling/manta/somatic/main.nf +++ b/subworkflows/nf-core/variantcalling/manta/somatic/main.nf @@ -28,6 +28,11 @@ workflow RUN_MANTA_SOMATIC { no_intervals: num_intervals == 1 }.set{manta_candidate_small_indels_vcf} + MANTA_SOMATIC.out.candidate_small_indels_vcf_tbi.branch{ + intervals: num_intervals > 1 + no_intervals: num_intervals == 1 + }.set{manta_candidate_small_indels_vcf_tbi} + MANTA_SOMATIC.out.candidate_sv_vcf.branch{ intervals: num_intervals > 1 no_intervals: num_intervals == 1 @@ -94,12 +99,22 @@ workflow RUN_MANTA_SOMATIC { CONCAT_MANTA_SMALL_INDELS.out.vcf, CONCAT_MANTA_DIPLOID.out.vcf, CONCAT_MANTA_SOMATIC.out.vcf, - manta_candidate_small_indels_vcf.no_intervals, manta_candidate_sv_vcf.no_intervals, + manta_candidate_small_indels_vcf.no_intervals, manta_diploid_sv_vcf.no_intervals, manta_somatic_sv_vcf.no_intervals ) + manta_candidate_small_indels_vcf = Channel.empty().mix( + CONCAT_MANTA_SMALL_INDELS.out.vcf, + manta_candidate_small_indels_vcf.no_intervals + ) + + manta_candidate_small_indels_vcf_tbi = Channel.empty().mix( + CONCAT_MANTA_SMALL_INDELS.out.tbi, + manta_candidate_small_indels_vcf_tbi.no_intervals + ) + ch_versions = ch_versions.mix(BGZIP_VC_MANTA_SV.out.versions) ch_versions = ch_versions.mix(BGZIP_VC_MANTA_SMALL_INDELS.out.versions) ch_versions = ch_versions.mix(BGZIP_VC_MANTA_DIPLOID.out.versions) @@ -112,6 +127,8 @@ workflow RUN_MANTA_SOMATIC { emit: manta_vcf + manta_candidate_small_indels_vcf + manta_candidate_small_indels_vcf_tbi versions = ch_versions } From a36a98638848b860a1bb66112948aaae7b4406c1 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 30 Mar 2022 15:57:26 +0200 Subject: [PATCH 13/45] Add StrelkaBP tests --- tests/test_tools.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/tests/test_tools.yml b/tests/test_tools.yml index 13bd4fdc4a..227c34c7a6 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -391,4 +391,36 @@ - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz.tbi - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz.tbi -#TODO: Test for strelka + manta + +- name: Run variant calling on somatic sample with strelka & manta (StrelkaBP) + command: nextflow run main.nf -profile test,tools_somatic,docker --tools strelka,manta + tags: + - somatic + - strelkabp + - variant_calling + files: + - path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz + - path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz.tbi + - path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz + - path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz.tbi + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz.tbi + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz.tbi + +- name: Run variant calling on somatic sample with & manta (StrelkaBP) without intervals + command: nextflow run main.nf -profile test,tools_somatic,docker --tools strelka,manta --no_intervals + tags: + - no_intervals + - somatic + - strelkabp + - variant_calling + files: + - path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz + - path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz.tbi + - path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz + - path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz.tbi + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz.tbi + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz + - path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz.tbi From 20667a7b6217a628d0ff760825eb64940906bfdd Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 30 Mar 2022 18:24:23 +0200 Subject: [PATCH 14/45] Add controlfreec paired conf --- conf/modules.config | 82 ++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 66c61638ae..d70adde92f 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -598,52 +598,7 @@ process{ // TUMOR_VARIANT_CALLING - //CONTROLFREEC - withName:FREEC{ - ext.args = { [ - "sample":[ - inputformat: 'pileup', - mateorientation: 'FR' - ], - "general" :[ - bedgraphoutput: "TRUE", - breakpointthreshold: params.wes ? "1.2" : "0.8", - breakpointtype: params.wes ? "4" : "2", - //coefficientofvariation: params.cf_coeff, - //contamination: params.cf_contamination ? "contamination = ${params.cf_contamination}" : "" - //contaminationadjustment: params.cf_contamination_adjustment ? "contaminationAdjustment = TRUE" : "" - //degree not set - //forcegccontentnormalization: "1", //sarek 2.7.1 - //gccontentprofile not set - //intercept not set - //mincnalength not set - //minmappabilityperwindow not set - //minexpectedgc not set - //maxexpectedgc not set - //minimalsubclonepresence min_subclone = 100 - //noisydata: not set - //ploidy: ${params.cf_ploidy} - //printNA not set - //readcountthreshold: params.target_bed ? "50" : "10" - sex: meta.gender, - //step not set - //telocentromeric not set - //uniquematch: not set - //window: params.cf_window, //params.cf_window ? "window = ${params.cf_window}" : "" - ], - "control":[ - inputformat: "pileup", - mateorientation: "FR" - ], - "BAF":[ - //"minimalcoverageperposition": (optional),not set - //"minimalqualityperposition": (optional),not set - //"shiftinquality": (optional)not set - ] - ] - } - } withName: 'MAKEGRAPH' { ext.args = { "${params.ploidy}" } @@ -722,6 +677,43 @@ process{ // PAIR_VARIANT_CALLING + //CONTROLFREEC + withName:*.:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + breakpointthreshold: params.wes ? "1.2" : "0.8", //Values taken from Freec example configs + breakpointtype: params.wes ? "4" : "2", // Values taken from Freec example configs + coefficientofvariation: params.cf_coeff, + contamination: params.cf_contamination ?: "", + contaminationadjustment: params.cf_contamination_adjustment ? "TRUE" : "", + forcegccontentnormalization: params.wes ? "1" : "0", + minimalsubclonepresence: params.wes ? "30" : "20", + noisydata: params.wes ? "TRUE" : "FALSE", + ploidy: params.ploidy, + printNA: params.wes ? "FALSE" : "TRUE", + readcountthreshold: params.wes ? "50" : "10", + sex: meta.gender, + //uniquematch: not set + window: params.cf_window ?: "" + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ], + "BAF":[ + minimalcoverageperposition: params.cf_mincov ?: "", + minimalqualityperposition: params.cf_minqual ?: "", + //"shiftinquality": (optional)not set + ] + ] + } + } + //MANTA withName: 'CONCAT_MANTA_SOMATIC' { ext.prefix = {"${meta.id}.somatic_sv"} From 0a33326924f01f8bd5c067626c975cb8dcec60e6 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 31 Mar 2022 12:56:33 +0200 Subject: [PATCH 15/45] Copy controlfreec map :crying: --- conf/modules.config | 84 +++++++++++++++++++++++++++++++++++++++---- nextflow.config | 7 ++-- tests/nextflow.config | 5 ++- 3 files changed, 85 insertions(+), 11 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index d70adde92f..2732ff1831 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -598,10 +598,82 @@ process{ // TUMOR_VARIANT_CALLING + //CONTROLFREEC + withName:FREEC{ + ext.when = { params.tools && params.tools.contains('controlfreec') } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{BedGraph,cpn,txt,_CNVs}" + ] + } + + withName: 'NFCORE_SAREK:SAREK:TUMOR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ + ext.args = {[ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + breakpointthreshold: params.wes ? "1.2" : "0.8", //Values taken from Freec example configs + breakpointtype: params.wes ? "4" : "2", // Values taken from Freec example configs + coefficientofvariation: params.cf_coeff, + contamination: params.cf_contamination ?: "", + contaminationadjustment: params.cf_contamination_adjustment ? "TRUE" : "", + forcegccontentnormalization: params.wes ? "1" : "0", + minimalsubclonepresence: params.wes ? "30" : "20", + noisydata: params.wes ? "TRUE" : "FALSE", + ploidy: params.ploidy, + printNA: params.wes ? "FALSE" : "TRUE", + readcountthreshold: params.wes ? "50" : "10", + sex: meta.gender, + //uniquematch: not set + window: params.cf_window ?: "" + ], + "BAF":[ + minimalcoverageperposition: params.cf_mincov ?: "", + minimalqualityperposition: params.cf_minqual ?: "", + //"shiftinquality": (optional)not set + ] + ] + } + } + + withName: 'ASSESS_SIGNIFICANCE' { + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{.p.value.txt}" + ] + } + + withName: 'FREEC2BED' { + ext.args = { "${params.ploidy}" } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{.bed}" + ] + } + + withName: 'FREEC2CIRCOS' { + ext.args = { "${params.ploidy}" } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{.circos.txt}" + ] + } withName: 'MAKEGRAPH' { ext.args = { "${params.ploidy}" } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{png}" + ] } @@ -678,8 +750,8 @@ process{ // PAIR_VARIANT_CALLING //CONTROLFREEC - withName:*.:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC{ - ext.args = { [ + withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ + ext.args = {[ "sample":[ inputformat: 'pileup', mateorientation: 'FR' @@ -701,14 +773,14 @@ process{ //uniquematch: not set window: params.cf_window ?: "" ], - "control":[ - inputformat: "pileup", - mateorientation: "FR" - ], "BAF":[ minimalcoverageperposition: params.cf_mincov ?: "", minimalqualityperposition: params.cf_minqual ?: "", //"shiftinquality": (optional)not set + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" ] ] } diff --git a/nextflow.config b/nextflow.config index dcd91400a9..6512044e6e 100644 --- a/nextflow.config +++ b/nextflow.config @@ -51,13 +51,16 @@ params { sequencing_center = null // No sequencing center to be written in BAM header by bwa/bwa-mem2 mem // Variant Calling - ploidy = 2 //null // Use default value, you can use 2,3,4 + ploidy = 2 //null (in ascat, test this works) // Use default value, you can use 2,3,4 ascat_purity = null // Use default value cf_coeff = 0.05 // default value for Control-FREEC - cf_contamination = null // by default not specified in Control-FREEC + cf_contamination = 0 // default value for Control-FREEC cf_contamination_adjustment = false // by default we are not using this in Control-FREEC //cf_ploidy = 2 // you can use 2,3,4 cf_window = null // by default we are not using this in Control-FREEC + cf_mincov = null + cf_minqual = null + generate_gvcf = false // g.vcf are not produced by HaplotypeCaller by default no_strelka_bp = false // Strelka will use Manta candidateSmallIndels if available pon = null // No default PON (Panel of Normals) file for GATK Mutect2 / Sentieon TNscope diff --git a/tests/nextflow.config b/tests/nextflow.config index cd309638a9..4eb41943f5 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1,6 +1,6 @@ process { - withName:FREEC{ + withName:'FREEC'{ ext.args = { [ "sample":[ inputformat: 'pileup', @@ -8,8 +8,6 @@ process { ], "general" :[ bedgraphoutput: "TRUE", - breakpointthreshold: params.wes ? "1.2" : "0.8", - contamination: params.cf_contamination ? "contamination = ${params.cf_contamination}" : "", noisydata: "TRUE", minexpectedgc: "0", readcountthreshold: "1", @@ -19,6 +17,7 @@ process { "control":[ inputformat: "pileup", mateorientation: "FR" + ] ] ] } From afda89c7c6e844ff4527a4a4f92eee8671be4d6e Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 31 Mar 2022 13:30:34 +0200 Subject: [PATCH 16/45] same quotes, same spaces --- conf/modules.config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 2732ff1831..421dff9186 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -226,7 +226,7 @@ process{ // SPLIT FASTQ process { - withName: "SEQKIT_SPLIT2" { + withName: 'SEQKIT_SPLIT2' { ext.args = { "--by-size ${params.split_fastq}" } ext.when = { params.split_fastq > 1 } publishDir = [ @@ -241,14 +241,14 @@ process { // MAPPING process { - withName: "BWAMEM1_MEM" { + withName: 'BWAMEM1_MEM' { ext.when = { params.aligner == "bwa-mem" } } - withName: "BWAMEM2_MEM" { + withName: 'BWAMEM2_MEM' { ext.when = { params.aligner == "bwa-mem2" } } - withName: "NFCORE_SAREK:SAREK:GATK4_MAPPING:BWAMEM.*_MEM" { + withName: 'NFCORE_SAREK:SAREK:GATK4_MAPPING:BWAMEM.*_MEM' { // Using -B 3 for tumor samples ext.args = { meta.status == 1 ? '-K 100000000 -M -B 3' : '-K 100000000 -M' } // Markduplicates Spark NEEDS name-sorted reads or runtime goes through the roof @@ -599,7 +599,7 @@ process{ // TUMOR_VARIANT_CALLING //CONTROLFREEC - withName:FREEC{ + withName: 'FREEC' { ext.when = { params.tools && params.tools.contains('controlfreec') } publishDir = [ mode: params.publish_dir_mode, @@ -792,7 +792,7 @@ process{ } //MUTECT2 - withName: 'CALCULATECONTAMINATION'{ + withName: 'CALCULATECONTAMINATION' { //ext.args = { params.ignore_soft_clipped_bases ? "--dont-use-soft-clipped-bases true" : "" } publishDir = [ mode: params.publish_dir_mode, @@ -811,7 +811,7 @@ process{ ] } - withName: 'LEARNREADORIENTATIONMODEL'{ + withName: 'LEARNREADORIENTATIONMODEL' { ext.prefix = { "${meta.id}.learnreadorientationmodel" } publishDir = [ mode: params.publish_dir_mode, @@ -820,7 +820,7 @@ process{ } //MSISENSORPRO - withName: 'MSISENSORPRO_MSI_SOMATIC'{ + withName: 'MSISENSORPRO_MSI_SOMATIC' { publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/${meta.id}/msisensorpro" }, From a7ce499ddc069aa8e43f5dd4c435e0ffe462c082 Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 5 Apr 2022 12:06:50 +0200 Subject: [PATCH 17/45] Add tumor only controlfreec (can't test, as test data won't pass) --- conf/modules.config | 36 ++++++-- subworkflows/local/pair_variant_calling.nf | 18 ++-- subworkflows/local/tumor_variant_calling.nf | 23 ++--- .../controlfreec/single/main.nf | 84 +++++++++++++++++++ .../controlfreec/{ => somatic}/main.nf | 23 +++-- tests/nextflow.config | 1 - 6 files changed, 149 insertions(+), 36 deletions(-) create mode 100644 subworkflows/nf-core/variantcalling/controlfreec/single/main.nf rename subworkflows/nf-core/variantcalling/controlfreec/{ => somatic}/main.nf (78%) diff --git a/conf/modules.config b/conf/modules.config index 421dff9186..83c4da6302 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -599,6 +599,24 @@ process{ // TUMOR_VARIANT_CALLING //CONTROLFREEC + + withName: 'ASSESS_SIGNIFICANCE' { + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{.p.value.txt}" + ] + } + + // withName: 'CAT_MPILEUP_.*' { + // publishDir = [ + // enabled: "${!params.no_intervals}", + // mode: params.publish_dir_mode, + // path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + // pattern: "*{pileup}" + // ] + // } + withName: 'FREEC' { ext.when = { params.tools && params.tools.contains('controlfreec') } publishDir = [ @@ -606,7 +624,6 @@ process{ path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, pattern: "*{BedGraph,cpn,txt,_CNVs}" ] - } withName: 'NFCORE_SAREK:SAREK:TUMOR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ @@ -641,14 +658,6 @@ process{ } } - withName: 'ASSESS_SIGNIFICANCE' { - publishDir = [ - mode: params.publish_dir_mode, - path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, - pattern: "*{.p.value.txt}" - ] - } - withName: 'FREEC2BED' { ext.args = { "${params.ploidy}" } publishDir = [ @@ -676,6 +685,15 @@ process{ ] } + // withName: 'MPILEUP_.*' { + // publishDir = [ + // enabled: "${params.no_intervals}", + // mode: params.publish_dir_mode, + // path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + // pattern: "*{pileup}" + // ] + // } + //MANTA withName: 'CONCAT_MANTA_TUMOR' { diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index 50def0d2cf..5021f4d251 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -3,7 +3,7 @@ // include { GATK_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_normal_somatic_variant_calling/main' include { MSISENSORPRO_MSI_SOMATIC } from '../../modules/nf-core/modules/msisensorpro/msi_somatic/main' -include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' +include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/somatic/main.nf' include { RUN_MANTA_SOMATIC } from '../nf-core/variantcalling/manta/somatic/main.nf' include { RUN_STRELKA_SOMATIC } from '../nf-core/variantcalling/strelka/somatic/main.nf' @@ -64,11 +64,15 @@ workflow PAIR_VARIANT_CALLING { } if (tools.contains('controlfreec')){ - cram_pair_intervals.map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals - -> [meta, normal_cram, intervals]}.set{cram_normal_intervals_no_index} + cram_normal_intervals_no_index = cram_pair_intervals + .map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals -> + [meta, normal_cram, intervals] + } - cram_pair_intervals.map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals - -> [meta, tumor_cram, intervals]}.set{cram_tumor_intervals_no_index} + cram_tumor_intervals_no_index = cram_pair_intervals + .map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals -> + [meta, tumor_cram, intervals] + } RUN_CONTROLFREEC(cram_normal_intervals_no_index, cram_tumor_intervals_no_index, @@ -96,7 +100,7 @@ workflow PAIR_VARIANT_CALLING { } if (tools.contains('strelka')) { - //TODO: Fix manta strelkaBP + if (tools.contains('manta')) { cram_pair_strelka = cram_pair.join(manta_candidate_small_indels_vcf) @@ -119,8 +123,6 @@ workflow PAIR_VARIANT_CALLING { } } - - RUN_STRELKA_SOMATIC(cram_pair_strelka, fasta, fasta_fai, diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 5e71c4645f..80d4d32cbf 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -8,6 +8,7 @@ include { RUN_FREEBAYES } from '../nf-core/variantcall include { GATK_TUMOR_ONLY_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_only_somatic_variant_calling/main' include { RUN_MANTA_TUMORONLY } from '../nf-core/variantcalling/manta/tumoronly/main.nf' include { RUN_STRELKA_SINGLE } from '../nf-core/variantcalling/strelka/single/main.nf' +include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/somatic/main.nf' workflow TUMOR_ONLY_VARIANT_CALLING { take: @@ -60,17 +61,17 @@ workflow TUMOR_ONLY_VARIANT_CALLING { }.set{cram_recalibrated_intervals_gz_tbi} if(tools.contains('controlfreec')){ - // cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} - // RUN_CONTROLFREEC(cram_intervals_no_index, - // fasta, - // fasta_fai, - // dbsnp, - // dbsnp_tbi, - // chr_length, - // mappability, - // intervals_bed_combined, - // num_intervals) - // ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) + cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} + RUN_CONTROLFREEC(cram_intervals_no_index, + fasta, + fasta_fai, + dbsnp, + dbsnp_tbi, + chr_files, + mappability, + intervals_bed_combined, + num_intervals) + ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) } if (tools.contains('freebayes')){ diff --git a/subworkflows/nf-core/variantcalling/controlfreec/single/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/single/main.nf new file mode 100644 index 0000000000..c8092e1fdc --- /dev/null +++ b/subworkflows/nf-core/variantcalling/controlfreec/single/main.nf @@ -0,0 +1,84 @@ +include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' +include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' +include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' +include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' +include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' +include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' + +workflow RUN_CONTROLFREEC { + take: + cram_tumor // channel: [mandatory] [meta, cram, crai, interval] + fasta // channel: [mandatory] + fasta_fai // channel: [mandatory] + dbsnp // channel: [mand] + dbsnp_tbi + chr_files + mappability + intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS + num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. + + main: + + ch_versions = Channel.empty() + + MPILEUP_TUMOR(cram_tumor, fasta) + + MPILEUP_TUMOR.out.mpileup.branch{ + intervals: num_intervals > 1 + no_intervals: num_intervals == 1 + }.set{mpileup_tumor} + + //Merge mpileup only when intervals and natural order sort them + + CAT_MPILEUP_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" + [new_meta, pileup] + }.groupTuple(size: num_intervals, sort:true)) + + // //TODO fix naming for no intervals + + controlfreec_input_tumor = Channel.empty().mix( + CAT_MPILEUP_TUMOR.out.file_out, + mpileup_tumor.no_intervals + ).map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + [new_meta, pileup] + } + + controlfreec_input_tumor + .map{ meta, pileup_tumor -> + [meta, [], pileup_tumor, [], [], [], []] + }.set{controlfreec_input} + + FREEC(controlfreec_input, + fasta, + fasta_fai, + [], + dbsnp, + dbsnp_tbi, + chr_files, + mappability, + intervals_bed, + []) + + ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) + FREEC2BED( FREEC.out.ratio ) + FREEC2CIRCOS( FREEC.out.ratio ) + MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) + + ch_versions = ch_versions.mix(MPILEUP_TUMOR.out.versions) + ch_versions = ch_versions.mix(CAT_MPILEUP_TUMOR.out.versions) + ch_versions = ch_versions.mix(FREEC.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) + + emit: + versions = ch_versions +} diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf similarity index 78% rename from subworkflows/nf-core/variantcalling/controlfreec/main.nf rename to subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf index 483f19741d..0ab7fd611d 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf @@ -1,5 +1,5 @@ -include { CAT_CAT as CAT_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CAT_CAT as CAT_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' @@ -40,13 +40,13 @@ workflow RUN_CONTROLFREEC { }.set{mpileup_tumor} //Merge mpileup only when intervals and natural order sort them - CAT_NORMAL( mpileup_normal.intervals.map{ meta, pileup -> + CAT_MPILEUP_NORMAL( mpileup_normal.intervals.map{ meta, pileup -> new_meta = meta.clone() new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_normal" [new_meta, pileup] }.groupTuple(size: num_intervals, sort:true)) - CAT_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> + CAT_MPILEUP_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> new_meta = meta.clone() new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" [new_meta, pileup] @@ -55,7 +55,7 @@ workflow RUN_CONTROLFREEC { // //TODO fix naming for no intervals controlfreec_input_normal = Channel.empty().mix( - CAT_NORMAL.out.file_out, + CAT_MPILEUP_NORMAL.out.file_out, mpileup_normal.no_intervals ).map{ meta, pileup -> new_meta = meta.clone() @@ -63,7 +63,7 @@ workflow RUN_CONTROLFREEC { [new_meta, pileup] } controlfreec_input_tumor = Channel.empty().mix( - CAT_TUMOR.out.file_out, + CAT_MPILEUP_TUMOR.out.file_out, mpileup_tumor.no_intervals ).map{ meta, pileup -> new_meta = meta.clone() @@ -76,7 +76,6 @@ workflow RUN_CONTROLFREEC { [meta, pileup_normal, pileup_tumor, [], [], [], []] }.set{controlfreec_input} - println params.cf_coeff FREEC(controlfreec_input, fasta, fasta_fai, @@ -93,6 +92,16 @@ workflow RUN_CONTROLFREEC { FREEC2CIRCOS( FREEC.out.ratio ) MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) + ch_versions = ch_versions.mix(MPILEUP_NORMAL.out.versions) + ch_versions = ch_versions.mix(MPILEUP_TUMOR.out.versions) + ch_versions = ch_versions.mix(CAT_MPILEUP_NORMAL.out.versions) + ch_versions = ch_versions.mix(CAT_MPILEUP_TUMOR.out.versions) + ch_versions = ch_versions.mix(FREEC.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) + emit: versions = ch_versions } diff --git a/tests/nextflow.config b/tests/nextflow.config index 4eb41943f5..70d29aed1e 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -19,7 +19,6 @@ process { mateorientation: "FR" ] ] - ] } } From 6ab729e62dd4b715e60c81e3403b991ba3fa4e90 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 7 Apr 2022 11:45:44 +0200 Subject: [PATCH 18/45] Make controlfreec workflow agnostic to paired or single input --- nextflow.config | 2 +- subworkflows/local/tumor_variant_calling.nf | 4 +- .../nf-core/variantcalling/ascat/main.nf | 8 ++++ .../controlfreec/somatic/main.nf | 45 ++++++++++--------- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/nextflow.config b/nextflow.config index 6512044e6e..fcce7ab84f 100644 --- a/nextflow.config +++ b/nextflow.config @@ -51,7 +51,7 @@ params { sequencing_center = null // No sequencing center to be written in BAM header by bwa/bwa-mem2 mem // Variant Calling - ploidy = 2 //null (in ascat, test this works) // Use default value, you can use 2,3,4 + ploidy = 2 //null (in ascat, test this works) // Use default value, you can use 2,3,4 ascat_purity = null // Use default value cf_coeff = 0.05 // default value for Control-FREEC cf_contamination = 0 // default value for Control-FREEC diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 80d4d32cbf..83054d9f80 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -30,6 +30,7 @@ workflow TUMOR_ONLY_VARIANT_CALLING { germline_resource_tbi // channel: [optional] germline_resource_tbi panel_of_normals // channel: [optional] panel_of_normals panel_of_normals_tbi // channel: [optional] panel_of_normals_tbi + chr_files mappability main: @@ -62,7 +63,8 @@ workflow TUMOR_ONLY_VARIANT_CALLING { if(tools.contains('controlfreec')){ cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} - RUN_CONTROLFREEC(cram_intervals_no_index, + RUN_CONTROLFREEC( Channel.empty(), + cram_intervals_no_index, fasta, fasta_fai, dbsnp, diff --git a/subworkflows/nf-core/variantcalling/ascat/main.nf b/subworkflows/nf-core/variantcalling/ascat/main.nf index 88c77e134d..36e370a19c 100644 --- a/subworkflows/nf-core/variantcalling/ascat/main.nf +++ b/subworkflows/nf-core/variantcalling/ascat/main.nf @@ -3,8 +3,16 @@ include { ASCAT } from '../../modules/nf-core/modules/ascat/main' workflow RUN_ASCAT { take: + cram // channel: [mandatory] [meta, normal_cram, normal_crai, interval] + allele_files // channel: [mandatory] + loci_files // channel: [mandatory] main: + ch_versions = Channel.empty() + + ASCAT(cram,allele_files,loci_files) + emit: + versions = ch_versions } diff --git a/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf index 0ab7fd611d..849f2fdf00 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf @@ -1,20 +1,20 @@ -include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' -include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' -include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' -include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' -include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' -include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC_FREEC as FREEC } from '../../../../../modules/nf-core/modules/controlfreec/freec/main' +include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' +include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../../modules/nf-core/modules/controlfreec/freec2bed/main' +include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../../modules/nf-core/modules/controlfreec/freec2circos/main' +include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../../modules/nf-core/modules/controlfreec/makegraph/main' +include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' +include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' workflow RUN_CONTROLFREEC { take: - cram_normal // channel: [mandatory] [meta, cram, crai, interval] - cram_tumor // channel: [mandatory] [meta, cram, crai, interval] + cram_normal // channel: [mandatory] [meta, cram, crai, interval] + cram_tumor // channel: [mandatory] [meta, cram, crai, interval] fasta // channel: [mandatory] fasta_fai // channel: [mandatory] - dbsnp // channel: [mand] + dbsnp // channel: [mand] dbsnp_tbi chr_files mappability @@ -48,12 +48,11 @@ workflow RUN_CONTROLFREEC { CAT_MPILEUP_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" + new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" : new_meta.sample [new_meta, pileup] }.groupTuple(size: num_intervals, sort:true)) - // //TODO fix naming for no intervals - + //TODO fix naming for no intervals controlfreec_input_normal = Channel.empty().mix( CAT_MPILEUP_NORMAL.out.file_out, mpileup_normal.no_intervals @@ -62,20 +61,26 @@ workflow RUN_CONTROLFREEC { new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id [new_meta, pileup] } + controlfreec_input_tumor = Channel.empty().mix( CAT_MPILEUP_TUMOR.out.file_out, mpileup_tumor.no_intervals ).map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" : new_meta.sample [new_meta, pileup] } + controlfreec_input_normal.view() + controlfreec_input_tumor.view() + - controlfreec_input_normal.join(controlfreec_input_tumor) - .map{ meta, pileup_normal, pileup_tumor -> - [meta, pileup_normal, pileup_tumor, [], [], [], []] - }.set{controlfreec_input} + controlfreec_input_normal.join(controlfreec_input_tumor, remainder: true) + .map{ meta, pileup_normal, pileup_tumor -> + p = pileup_normal ?: [] + [meta, p, pileup_tumor, [], [], [], []] + }.set{controlfreec_input} + controlfreec_input.view() FREEC(controlfreec_input, fasta, fasta_fai, From 47e04972ea17d229208021fb8484fffcca8c4f01 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 7 Apr 2022 11:46:12 +0200 Subject: [PATCH 19/45] add required cf input to tumor vc workflow --- workflows/sarek.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/sarek.nf b/workflows/sarek.nf index 59c459c318..946bc3f2f9 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -607,11 +607,11 @@ workflow SAREK { germline_resource_tbi, pon, pon_tbi, + chr_dir, mappability ) // PAIR VARIANT CALLING - chr_dir.view() PAIR_VARIANT_CALLING( params.tools, cram_variant_calling_pair, From 163c1545f7f25a2738ad761d91a0685670fefe21 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 7 Apr 2022 11:48:59 +0200 Subject: [PATCH 20/45] Adapt fodler structure to use controlfreec subworkflow --- conf/modules.config | 20 +++++ subworkflows/local/pair_variant_calling.nf | 2 +- subworkflows/local/tumor_variant_calling.nf | 2 +- .../controlfreec/{somatic => }/main.nf | 14 ++-- .../controlfreec/single/main.nf | 84 ------------------- 5 files changed, 27 insertions(+), 95 deletions(-) rename subworkflows/nf-core/variantcalling/controlfreec/{somatic => }/main.nf (92%) delete mode 100644 subworkflows/nf-core/variantcalling/controlfreec/single/main.nf diff --git a/conf/modules.config b/conf/modules.config index 83c4da6302..2c03947b50 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -767,6 +767,26 @@ process{ // PAIR_VARIANT_CALLING + //ASCAT + withName: 'ASCAT' { + ext.args = { + [ + "gender": meta.sex, + //"genomeVersion": "hg19" + //"purity": (optional), + //"ploidy": params.ploidy, + //"gc_files": (optional), + //"minCounts": (optional), + //"chrom_names": (optional), + //"min_base_qual": (optional), + //"min_map_qual": (optional), + //"ref_fasta": (optional), + //"skip_allele_counting_tumour": (optional), + //"skip_allele_counting_normal": (optional) + ] + } + } + //CONTROLFREEC withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ ext.args = {[ diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index 5021f4d251..0a74dcd94f 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -3,7 +3,7 @@ // include { GATK_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_normal_somatic_variant_calling/main' include { MSISENSORPRO_MSI_SOMATIC } from '../../modules/nf-core/modules/msisensorpro/msi_somatic/main' -include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/somatic/main.nf' +include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' include { RUN_MANTA_SOMATIC } from '../nf-core/variantcalling/manta/somatic/main.nf' include { RUN_STRELKA_SOMATIC } from '../nf-core/variantcalling/strelka/somatic/main.nf' diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index 83054d9f80..e39ec912f6 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -8,7 +8,7 @@ include { RUN_FREEBAYES } from '../nf-core/variantcall include { GATK_TUMOR_ONLY_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_only_somatic_variant_calling/main' include { RUN_MANTA_TUMORONLY } from '../nf-core/variantcalling/manta/tumoronly/main.nf' include { RUN_STRELKA_SINGLE } from '../nf-core/variantcalling/strelka/single/main.nf' -include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/somatic/main.nf' +include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' workflow TUMOR_ONLY_VARIANT_CALLING { take: diff --git a/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf similarity index 92% rename from subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf rename to subworkflows/nf-core/variantcalling/controlfreec/main.nf index 849f2fdf00..efe29d496a 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -70,17 +70,13 @@ workflow RUN_CONTROLFREEC { new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" : new_meta.sample [new_meta, pileup] } - controlfreec_input_normal.view() - controlfreec_input_tumor.view() + controlfreec_input_normal.join(controlfreec_input_tumor, remainder: true) + .map{ meta, pileup_normal, pileup_tumor -> + p = pileup_normal ?: [] + [meta, p, pileup_tumor, [], [], [], []] + }.set{controlfreec_input} - controlfreec_input_normal.join(controlfreec_input_tumor, remainder: true) - .map{ meta, pileup_normal, pileup_tumor -> - p = pileup_normal ?: [] - [meta, p, pileup_tumor, [], [], [], []] - }.set{controlfreec_input} - - controlfreec_input.view() FREEC(controlfreec_input, fasta, fasta_fai, diff --git a/subworkflows/nf-core/variantcalling/controlfreec/single/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/single/main.nf deleted file mode 100644 index c8092e1fdc..0000000000 --- a/subworkflows/nf-core/variantcalling/controlfreec/single/main.nf +++ /dev/null @@ -1,84 +0,0 @@ -include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' -include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' -include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' -include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' -include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' -include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' - -workflow RUN_CONTROLFREEC { - take: - cram_tumor // channel: [mandatory] [meta, cram, crai, interval] - fasta // channel: [mandatory] - fasta_fai // channel: [mandatory] - dbsnp // channel: [mand] - dbsnp_tbi - chr_files - mappability - intervals_bed // channel: [optional] Contains a bed file of all intervals combined provided with the cram input(s). Should be empty for WGS - num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. - - main: - - ch_versions = Channel.empty() - - MPILEUP_TUMOR(cram_tumor, fasta) - - MPILEUP_TUMOR.out.mpileup.branch{ - intervals: num_intervals > 1 - no_intervals: num_intervals == 1 - }.set{mpileup_tumor} - - //Merge mpileup only when intervals and natural order sort them - - CAT_MPILEUP_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> - new_meta = meta.clone() - new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" - [new_meta, pileup] - }.groupTuple(size: num_intervals, sort:true)) - - // //TODO fix naming for no intervals - - controlfreec_input_tumor = Channel.empty().mix( - CAT_MPILEUP_TUMOR.out.file_out, - mpileup_tumor.no_intervals - ).map{ meta, pileup -> - new_meta = meta.clone() - new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id - [new_meta, pileup] - } - - controlfreec_input_tumor - .map{ meta, pileup_tumor -> - [meta, [], pileup_tumor, [], [], [], []] - }.set{controlfreec_input} - - FREEC(controlfreec_input, - fasta, - fasta_fai, - [], - dbsnp, - dbsnp_tbi, - chr_files, - mappability, - intervals_bed, - []) - - ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) - FREEC2BED( FREEC.out.ratio ) - FREEC2CIRCOS( FREEC.out.ratio ) - MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) - - ch_versions = ch_versions.mix(MPILEUP_TUMOR.out.versions) - ch_versions = ch_versions.mix(CAT_MPILEUP_TUMOR.out.versions) - ch_versions = ch_versions.mix(FREEC.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) - - emit: - versions = ch_versions -} From 6390a5de1aec6110c2999ae5f829609a0237c7e0 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 8 Apr 2022 11:48:46 +0200 Subject: [PATCH 21/45] nf-core modules update -all --- modules/nf-core/modules/ascat/main.nf | 5 +- modules/nf-core/modules/bwamem2/index/main.nf | 15 ++++ modules/nf-core/modules/bwamem2/mem/main.nf | 11 +++ modules/nf-core/modules/cat/cat/main.nf | 14 +++- .../controlfreec/assesssignificance/main.nf | 13 +++- .../modules/controlfreec/freec/main.nf | 20 +++++- .../modules/controlfreec/freec2bed/main.nf | 11 +++ .../modules/controlfreec/freec2circos/main.nf | 11 +++ .../modules/controlfreec/makegraph/main.nf | 14 +++- .../modules/deeptools/bamcoverage/main.nf | 10 +-- modules/nf-core/modules/deepvariant/main.nf | 12 ++++ modules/nf-core/modules/fastqc/main.nf | 12 ++++ .../gatk4/createsequencedictionary/main.nf | 10 +++ .../nf-core/modules/manta/germline/main.nf | 3 +- modules/nf-core/modules/multiqc/main.nf | 12 ++++ .../nf-core/modules/qualimap/bamqc/main.nf | 68 +++++++++++++++++++ .../nf-core/modules/samtools/faidx/main.nf | 10 +++ .../nf-core/modules/samtools/index/main.nf | 12 ++++ .../nf-core/modules/samtools/merge/main.nf | 12 ++++ .../nf-core/modules/samtools/stats/main.nf | 11 +++ .../nf-core/modules/tabix/bgziptabix/main.nf | 12 ++++ modules/nf-core/modules/tabix/tabix/main.nf | 11 +++ modules/nf-core/modules/tiddit/sv/main.nf | 13 ++++ 23 files changed, 310 insertions(+), 12 deletions(-) diff --git a/modules/nf-core/modules/ascat/main.nf b/modules/nf-core/modules/ascat/main.nf index 35f262dd53..3b53bc0991 100644 --- a/modules/nf-core/modules/ascat/main.nf +++ b/modules/nf-core/modules/ascat/main.nf @@ -9,6 +9,7 @@ process ASCAT { input: tuple val(meta), path(input_normal), path(index_normal), path(input_tumor), path(index_tumor) + path fasta path(allele_files) path(loci_files) @@ -26,7 +27,7 @@ process ASCAT { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def gender = args.gender ? "$args.gender" : "NULL" - def genomeVersion = args.genomeVersion ? "$args.genomeVersion" : "NULL" + def genomeVersion = args.genomeVersion ? "$args.genomeVersion" : "NULL" //either "hg19" or "hg38" def purity = args.purity ? "$args.purity" : "NULL" def ploidy = args.ploidy ? "$args.ploidy" : "NULL" def gc_files = args.gc_files ? "$args.gc_files" : "NULL" @@ -35,7 +36,7 @@ process ASCAT { def chrom_names_arg = args.chrom_names ? ",chrom_names = $args.chrom_names" : "" def min_base_qual_arg = args.min_base_qual ? ",min_base_qual = $args.min_base_qual" : "" def min_map_qual_arg = args.min_map_qual ? ",min_map_qual = $args.min_map_qual" : "" - def ref_fasta_arg = args.ref_fasta ? ",ref.fasta = '$args.ref_fasta'" : "" + def ref_fasta_arg = fasta ? ",ref.fasta = '$args.ref_fasta'" : "" def skip_allele_counting_tumour_arg = args.skip_allele_counting_tumour ? ",skip_allele_counting_tumour = $args.skip_allele_counting_tumour" : "" def skip_allele_counting_normal_arg = args.skip_allele_counting_normal ? ",skip_allele_counting_normal = $args.skip_allele_counting_normal" : "" diff --git a/modules/nf-core/modules/bwamem2/index/main.nf b/modules/nf-core/modules/bwamem2/index/main.nf index 0e9cc2f8ba..900f27d472 100644 --- a/modules/nf-core/modules/bwamem2/index/main.nf +++ b/modules/nf-core/modules/bwamem2/index/main.nf @@ -31,4 +31,19 @@ process BWAMEM2_INDEX { bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') END_VERSIONS """ + + stub: + """ + mkdir bwamem2 + touch bwamem2/${fasta}.0123 + touch bwamem2/${fasta}.ann + touch bwamem2/${fasta}.pac + touch bwamem2/${fasta}.amb + touch bwamem2/${fasta}.bwt.2bit.64 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/bwamem2/mem/main.nf b/modules/nf-core/modules/bwamem2/mem/main.nf index 21dfb1d614..e3a3d164ea 100644 --- a/modules/nf-core/modules/bwamem2/mem/main.nf +++ b/modules/nf-core/modules/bwamem2/mem/main.nf @@ -43,4 +43,15 @@ process BWAMEM2_MEM { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/cat/cat/main.nf b/modules/nf-core/modules/cat/cat/main.nf index 25dcc652a4..40e53f3eda 100644 --- a/modules/nf-core/modules/cat/cat/main.nf +++ b/modules/nf-core/modules/cat/cat/main.nf @@ -30,7 +30,7 @@ process CAT_CAT { // | ungzipped | gzipped | cat | pigz | // Use input file ending as default - prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" out_zip = prefix.endsWith('.gz') in_zip = file_list[0].endsWith('.gz') command1 = (in_zip && !out_zip) ? 'zcat' : 'cat' @@ -47,4 +47,16 @@ process CAT_CAT { pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ + + stub: + def file_list = files_in.collect { it.toString() } + prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + """ + touch $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/controlfreec/assesssignificance/main.nf b/modules/nf-core/modules/controlfreec/assesssignificance/main.nf index f85a3c7f1e..4bdb00b386 100644 --- a/modules/nf-core/modules/controlfreec/assesssignificance/main.nf +++ b/modules/nf-core/modules/controlfreec/assesssignificance/main.nf @@ -21,7 +21,7 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio} + cat \$(which assess_significance.R) | R --slave --args ${cnvs} ${ratio} mv *.p.value.txt ${prefix}.p.value.txt @@ -30,4 +30,15 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.p.value.txt + + 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" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/controlfreec/freec/main.nf b/modules/nf-core/modules/controlfreec/freec/main.nf index eb66eeaa34..857ffdee17 100644 --- a/modules/nf-core/modules/controlfreec/freec/main.nf +++ b/modules/nf-core/modules/controlfreec/freec/main.nf @@ -21,7 +21,7 @@ process CONTROLFREEC_FREEC { output: tuple val(meta), path("*_ratio.BedGraph") , emit: bedgraph, optional: true - tuple val(meta), path("*_control.cpn") , emit: control_cpn + tuple val(meta), path("*_control.cpn") , emit: control_cpn, optional: true tuple val(meta), path("*_sample.cpn") , emit: sample_cpn tuple val(meta), path("GC_profile.*.cpn") , emit: gcprofile_cpn, optional:true tuple val(meta), path("*_BAF.txt") , emit: BAF @@ -155,4 +155,22 @@ process CONTROLFREEC_FREEC { controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_ratio.BedGraph + touch ${prefix}_sample.cpn + touch GC_profile.${prefix}.cpn + touch ${prefix}_BAF.txt + touch ${prefix}_CNVs + touch ${prefix}_info.txt + touch ${prefix}_ratio.txt + touch config.txt + + 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" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/controlfreec/freec2bed/main.nf b/modules/nf-core/modules/controlfreec/freec2bed/main.nf index 880e4716ab..aefc200e81 100644 --- a/modules/nf-core/modules/controlfreec/freec2bed/main.nf +++ b/modules/nf-core/modules/controlfreec/freec2bed/main.nf @@ -28,4 +28,15 @@ process CONTROLFREEC_FREEC2BED { controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bed + + 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" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/controlfreec/freec2circos/main.nf b/modules/nf-core/modules/controlfreec/freec2circos/main.nf index 8879d4c05d..8f9be30097 100644 --- a/modules/nf-core/modules/controlfreec/freec2circos/main.nf +++ b/modules/nf-core/modules/controlfreec/freec2circos/main.nf @@ -28,4 +28,15 @@ process CONTROLFREEC_FREEC2CIRCOS { controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.circos.txt + + 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" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/controlfreec/makegraph/main.nf b/modules/nf-core/modules/controlfreec/makegraph/main.nf index 9a0c7281af..a8954d726a 100644 --- a/modules/nf-core/modules/controlfreec/makegraph/main.nf +++ b/modules/nf-core/modules/controlfreec/makegraph/main.nf @@ -25,12 +25,24 @@ process CONTROLFREEC_MAKEGRAPH { def prefix = task.ext.prefix ?: "${meta.id}" def baf = baf ?: "" """ - cat /usr/local/bin/makeGraph.R | R --slave --args ${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 mv *_ratio.txt.png ${prefix}_ratio.png + 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" ) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_BAF.png + touch ${prefix}_ratio.log2.png + touch ${prefix}_ratio.png cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/deeptools/bamcoverage/main.nf b/modules/nf-core/modules/deeptools/bamcoverage/main.nf index 83e3ffebae..926bf0ad88 100644 --- a/modules/nf-core/modules/deeptools/bamcoverage/main.nf +++ b/modules/nf-core/modules/deeptools/bamcoverage/main.nf @@ -23,11 +23,11 @@ process DEEPTOOLS_BAMCOVERAGE { def prefix = task.ext.prefix ?: "${meta.id}.bigWig" """ - bamCoverage \ - --bam $input \ - $args \ - --numberOfProcessors ${task.cpus} \ - --outFileName ${prefix} + bamCoverage \\ + --bam $input \\ + $args \\ + --numberOfProcessors ${task.cpus} \\ + --outFileName ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/deepvariant/main.nf b/modules/nf-core/modules/deepvariant/main.nf index 8e5f10df65..e2a0bee732 100644 --- a/modules/nf-core/modules/deepvariant/main.nf +++ b/modules/nf-core/modules/deepvariant/main.nf @@ -44,4 +44,16 @@ process DEEPVARIANT { deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' ) END_VERSIONS """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.vcf.gz + touch ${prefix}.g.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/fastqc/main.nf b/modules/nf-core/modules/fastqc/main.nf index ed6b8c50b1..05730368b2 100644 --- a/modules/nf-core/modules/fastqc/main.nf +++ b/modules/nf-core/modules/fastqc/main.nf @@ -44,4 +44,16 @@ process FASTQC { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.html + touch ${prefix}.zip + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/gatk4/createsequencedictionary/main.nf b/modules/nf-core/modules/gatk4/createsequencedictionary/main.nf index 87d52a596a..dea77a1d3f 100644 --- a/modules/nf-core/modules/gatk4/createsequencedictionary/main.nf +++ b/modules/nf-core/modules/gatk4/createsequencedictionary/main.nf @@ -37,4 +37,14 @@ process GATK4_CREATESEQUENCEDICTIONARY { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + """ + touch test.dict + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/manta/germline/main.nf b/modules/nf-core/modules/manta/germline/main.nf index ef6bd4a32e..5ddba51be2 100644 --- a/modules/nf-core/modules/manta/germline/main.nf +++ b/modules/nf-core/modules/manta/germline/main.nf @@ -8,9 +8,10 @@ process MANTA_GERMLINE { 'quay.io/biocontainers/manta:1.6.0--h9ee0642_1' }" input: - tuple val(meta), path(input), path(index), path(target_bed), path(target_bed_tbi) + tuple val(meta), path(input), path(index) path fasta path fasta_fai + tuple path(target_bed), path(target_bed_tbi) output: diff --git a/modules/nf-core/modules/multiqc/main.nf b/modules/nf-core/modules/multiqc/main.nf index 1264aac1eb..ae019dbf0b 100644 --- a/modules/nf-core/modules/multiqc/main.nf +++ b/modules/nf-core/modules/multiqc/main.nf @@ -28,4 +28,16 @@ process MULTIQC { multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) END_VERSIONS """ + + stub: + """ + touch multiqc_data + touch multiqc_plots + touch multiqc_report.html + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/qualimap/bamqc/main.nf b/modules/nf-core/modules/qualimap/bamqc/main.nf index 92f38f8c46..3bfcb4c1f5 100644 --- a/modules/nf-core/modules/qualimap/bamqc/main.nf +++ b/modules/nf-core/modules/qualimap/bamqc/main.nf @@ -52,4 +52,72 @@ process QUALIMAP_BAMQC { qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') END_VERSIONS """ + + stub: + prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" + """ + mkdir -p $prefix/css + mkdir $prefix/images_qualimapReport + mkdir $prefix/raw_data_qualimapReport + cd $prefix/css + touch agogo.css + touch basic.css + touch bgtop.png + touch comment-close.png + touch doctools.js + touch down-pressed.png + touch jquery.js + touch plus.png + touch qualimap_logo_small.png + touch searchtools.js + touch up.png + touch websupport.js + touch ajax-loader.gif + touch bgfooter.png + touch comment-bright.png + touch comment.png + touch down.png + touch file.png + touch minus.png + touch pygments.css + touch report.css + touch underscore.js + touch up-pressed.png + cd ../images_qualimapReport/ + touch genome_coverage_0to50_histogram.png + touch genome_coverage_quotes.png + touch genome_insert_size_across_reference.png + touch genome_mapping_quality_histogram.png + touch genome_uniq_read_starts_histogram.png + touch genome_coverage_across_reference.png + touch genome_gc_content_per_window.png + touch genome_insert_size_histogram.png + touch genome_reads_clipping_profile.png + touch genome_coverage_histogram.png + touch genome_homopolymer_indels.png + touch genome_mapping_quality_across_reference.png + touch genome_reads_content_per_read_position.png + cd ../raw_data_qualimapReport + touch coverage_across_reference.txt + touch genome_fraction_coverage.txt + touch insert_size_histogram.txt + touch mapped_reads_nucleotide_content.txt + touch coverage_histogram.txt + touch homopolymer_indels.txt + touch mapped_reads_clipping_profile.txt + touch mapping_quality_across_reference.txt + touch duplication_rate_histogram.txt + touch insert_size_across_reference.txt + touch mapped_reads_gc-content_distribution.txt + touch mapping_quality_histogram.txt + cd ../ + touch genome_results.txt + touch qualimapReport.html + cd ../ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/samtools/faidx/main.nf b/modules/nf-core/modules/samtools/faidx/main.nf index 7732a4ec10..053279ff4f 100644 --- a/modules/nf-core/modules/samtools/faidx/main.nf +++ b/modules/nf-core/modules/samtools/faidx/main.nf @@ -29,4 +29,14 @@ process SAMTOOLS_FAIDX { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + """ + touch ${fasta}.fai + cat <<-END_VERSIONS > versions.yml + + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/samtools/index/main.nf b/modules/nf-core/modules/samtools/index/main.nf index e41cdcc888..fff6e1b84b 100644 --- a/modules/nf-core/modules/samtools/index/main.nf +++ b/modules/nf-core/modules/samtools/index/main.nf @@ -33,4 +33,16 @@ process SAMTOOLS_INDEX { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + """ + touch ${input}.bai + touch ${input}.crai + touch ${input}.csi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/samtools/merge/main.nf b/modules/nf-core/modules/samtools/merge/main.nf index 7b77167730..9f962a4b01 100644 --- a/modules/nf-core/modules/samtools/merge/main.nf +++ b/modules/nf-core/modules/samtools/merge/main.nf @@ -38,4 +38,16 @@ process SAMTOOLS_MERGE { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" + def file_type = input_files[0].getExtension() + """ + touch ${prefix}.${file_type} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/samtools/stats/main.nf b/modules/nf-core/modules/samtools/stats/main.nf index 6efc9d9a56..85cb64f3c2 100644 --- a/modules/nf-core/modules/samtools/stats/main.nf +++ b/modules/nf-core/modules/samtools/stats/main.nf @@ -34,4 +34,15 @@ process SAMTOOLS_STATS { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${input}.stats + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/tabix/bgziptabix/main.nf b/modules/nf-core/modules/tabix/bgziptabix/main.nf index 12657599aa..77fd91a58d 100644 --- a/modules/nf-core/modules/tabix/bgziptabix/main.nf +++ b/modules/nf-core/modules/tabix/bgziptabix/main.nf @@ -30,4 +30,16 @@ process TABIX_BGZIPTABIX { tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.gz + touch ${prefix}.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/tabix/tabix/main.nf b/modules/nf-core/modules/tabix/tabix/main.nf index 5f51626146..c9dab068a2 100644 --- a/modules/nf-core/modules/tabix/tabix/main.nf +++ b/modules/nf-core/modules/tabix/tabix/main.nf @@ -27,4 +27,15 @@ process TABIX_TABIX { tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${tab}.tbi + cat <<-END_VERSIONS > versions.yml + + "${task.process}": + tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/modules/tiddit/sv/main.nf b/modules/nf-core/modules/tiddit/sv/main.nf index 454dfc54ce..1bf7146afe 100644 --- a/modules/nf-core/modules/tiddit/sv/main.nf +++ b/modules/nf-core/modules/tiddit/sv/main.nf @@ -38,4 +38,17 @@ process TIDDIT_SV { tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.vcf + touch ${prefix}.ploidy.tab + touch ${prefix}.signals.tab + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') + END_VERSIONS + """ } From fa6de98efa50062b570ce989b2d0b7bbdb438b29 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 8 Apr 2022 11:49:00 +0200 Subject: [PATCH 22/45] nf-core modules update -all --- modules.json | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/modules.json b/modules.json index a089b62d07..770b548ade 100644 --- a/modules.json +++ b/modules.json @@ -16,13 +16,13 @@ "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" }, "bwamem2/index": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "bwamem2/mem": { - "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "cat/cat": { - "git_sha": "3d31fa4d04177579e86044bf111588376e1a0c12" + "git_sha": "eeda4136c096688d04cc40bb3c70d948213ed641" }, "cat/fastq": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -31,34 +31,34 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "controlfreec/assesssignificance": { - "git_sha": "28e5211b3513d80f198beb7090f57242165cc030" + "git_sha": "9ae34a01d1747019fd37753ff4cafb05aec35a2b" }, "controlfreec/freec": { - "git_sha": "1ec1868264a8429e02ee3dca881b69c80239c9dc" + "git_sha": "9ae34a01d1747019fd37753ff4cafb05aec35a2b" }, "controlfreec/freec2bed": { - "git_sha": "8a64e73af29a8096e1996e0496df4ae8c449c40b" + "git_sha": "9ae34a01d1747019fd37753ff4cafb05aec35a2b" }, "controlfreec/freec2circos": { - "git_sha": "5acf301ddda04072cf7233a6c8f5fa5df867de99" + "git_sha": "9ae34a01d1747019fd37753ff4cafb05aec35a2b" }, "controlfreec/makegraph": { - "git_sha": "28e5211b3513d80f198beb7090f57242165cc030" + "git_sha": "9ae34a01d1747019fd37753ff4cafb05aec35a2b" }, "custom/dumpsoftwareversions": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "deeptools/bamcoverage": { - "git_sha": "f0800157544a82ae222931764483331a81812012" + "git_sha": "fe088745e03f21d07477cc0c655c24ae9f72ac31" }, "deepvariant": { - "git_sha": "c450b08a75cda8878876ccbbe42493d6774397bd" + "git_sha": "fd5f6f5f4ffef4ab5a4e809bd3211bbc71c38d30" }, "ensemblvep": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "fastqc": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "fgbio/callmolecularconsensusreads": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -85,7 +85,7 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "gatk4/createsequencedictionary": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "fd5f6f5f4ffef4ab5a4e809bd3211bbc71c38d30" }, "gatk4/estimatelibrarycomplexity": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -130,7 +130,7 @@ "git_sha": "f0800157544a82ae222931764483331a81812012" }, "manta/germline": { - "git_sha": "979e57b7ac6a405a395dd7a6dbe1a275c5bc226b" + "git_sha": "fd5f6f5f4ffef4ab5a4e809bd3211bbc71c38d30" }, "manta/somatic": { "git_sha": "979e57b7ac6a405a395dd7a6dbe1a275c5bc226b" @@ -145,10 +145,10 @@ "git_sha": "f0800157544a82ae222931764483331a81812012" }, "multiqc": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "qualimap/bamqc": { - "git_sha": "e31f1ff3b1375b30db08637d8937e25cc046f3cc" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "qualimap/bamqccram": { "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" @@ -160,19 +160,19 @@ "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/faidx": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "samtools/index": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "samtools/merge": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "samtools/mpileup": { "git_sha": "b5825fe6b336352024aebccd274da1d131188bfc" }, "samtools/stats": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "samtools/view": { "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" @@ -190,13 +190,13 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "tabix/bgziptabix": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "tabix/tabix": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "tiddit/sv": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "fd5f6f5f4ffef4ab5a4e809bd3211bbc71c38d30" }, "trimgalore": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" From 817d71870061537ff5b3364a0c61855988626823 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 8 Apr 2022 11:51:37 +0200 Subject: [PATCH 23/45] prettier --- modules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.json b/modules.json index 770b548ade..7e1c6386a1 100644 --- a/modules.json +++ b/modules.json @@ -206,4 +206,4 @@ } } } -} \ No newline at end of file +} From 50b1dda24b9b04f12f340c3eb1495224994ea0e5 Mon Sep 17 00:00:00 2001 From: Rike Date: Fri, 8 Apr 2022 12:50:34 +0200 Subject: [PATCH 24/45] tests pass --- conf/modules.config | 39 +++++++++++-------- .../variantcalling/controlfreec/main.nf | 26 ++++++------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 2c03947b50..bcb22a2251 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -599,6 +599,10 @@ process{ // TUMOR_VARIANT_CALLING //CONTROLFREEC + //TODO: when nextflow will be able to not show disabled processes this will clean up the output + withName: 'NFCORE_SAREK:SAREK:TUMOR_ONLY_VARIANT_CALLING:RUN_CONTROLFREEC:.*_NORMAL'{ + ext.when = false + } withName: 'ASSESS_SIGNIFICANCE' { publishDir = [ @@ -608,14 +612,14 @@ process{ ] } - // withName: 'CAT_MPILEUP_.*' { - // publishDir = [ - // enabled: "${!params.no_intervals}", - // mode: params.publish_dir_mode, - // path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, - // pattern: "*{pileup}" - // ] - // } + withName: 'CAT_MPILEUP_.*' { + publishDir = [ + enabled: "${!params.no_intervals}", + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{pileup}" + ] + } withName: 'FREEC' { ext.when = { params.tools && params.tools.contains('controlfreec') } @@ -626,7 +630,7 @@ process{ ] } - withName: 'NFCORE_SAREK:SAREK:TUMOR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ + withName: 'NFCORE_SAREK:SAREK:TUMOR_ONLY_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ ext.args = {[ "sample":[ inputformat: 'pileup', @@ -685,14 +689,15 @@ process{ ] } - // withName: 'MPILEUP_.*' { - // publishDir = [ - // enabled: "${params.no_intervals}", - // mode: params.publish_dir_mode, - // path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, - // pattern: "*{pileup}" - // ] - // } + withName: 'MPILEUP_.*' { + ext.when = { params.tools && params.tools.contains('controlfreec') } + publishDir = [ + enabled: "${params.no_intervals}", + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, + pattern: "*{pileup}" + ] + } //MANTA diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index efe29d496a..d621b20a91 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -1,12 +1,12 @@ -include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CONTROLFREEC_FREEC as FREEC } from '../../../../../modules/nf-core/modules/controlfreec/freec/main' -include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' -include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../../modules/nf-core/modules/controlfreec/freec2bed/main' -include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../../modules/nf-core/modules/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../../modules/nf-core/modules/controlfreec/makegraph/main' -include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' -include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' +include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' +include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' +include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' +include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' +include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' +include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' +include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' workflow RUN_CONTROLFREEC { take: @@ -14,10 +14,10 @@ workflow RUN_CONTROLFREEC { cram_tumor // channel: [mandatory] [meta, cram, crai, interval] fasta // channel: [mandatory] fasta_fai // channel: [mandatory] - dbsnp // channel: [mand] - dbsnp_tbi - chr_files - mappability + dbsnp // channel: [mandatory] + dbsnp_tbi // channel: [mandatory] + 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 num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. From fffedb774cf071dc7e6f4b488954c8c0fbd3655b Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 11 Apr 2022 14:28:46 +0200 Subject: [PATCH 25/45] update samtools to 1.15.1 --- modules.json | 24 +++++++++---------- modules/local/samtools/fastq/main.nf | 6 ++--- modules/local/samtools/index/main.nf | 6 ++--- modules/local/samtools/mergecram/main.nf | 6 ++--- modules/local/samtools/viewindex/main.nf | 6 ++--- modules/local/samtoolsview.nf | 6 ++--- modules/nf-core/modules/bwa/mem/main.nf | 6 ++--- modules/nf-core/modules/bwamem2/mem/main.nf | 6 ++--- .../modules/qualimap/bamqccram/main.nf | 6 ++--- modules/nf-core/modules/samblaster/main.nf | 6 ++--- .../nf-core/modules/samtools/bam2fq/main.nf | 6 ++--- .../nf-core/modules/samtools/faidx/main.nf | 6 ++--- .../nf-core/modules/samtools/index/main.nf | 6 ++--- .../nf-core/modules/samtools/merge/main.nf | 6 ++--- .../nf-core/modules/samtools/mpileup/main.nf | 7 +++--- .../nf-core/modules/samtools/stats/main.nf | 6 ++--- modules/nf-core/modules/samtools/view/main.nf | 6 ++--- 17 files changed, 60 insertions(+), 61 deletions(-) diff --git a/modules.json b/modules.json index 7e1c6386a1..05ed0cc035 100644 --- a/modules.json +++ b/modules.json @@ -13,13 +13,13 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "bwa/mem": { - "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "bwamem2/index": { "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "bwamem2/mem": { - "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "cat/cat": { "git_sha": "eeda4136c096688d04cc40bb3c70d948213ed641" @@ -151,31 +151,31 @@ "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" }, "qualimap/bamqccram": { - "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samblaster": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/bam2fq": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/faidx": { - "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/index": { - "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/merge": { - "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/mpileup": { - "git_sha": "b5825fe6b336352024aebccd274da1d131188bfc" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/stats": { - "git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/view": { - "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "seqkit/split2": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -206,4 +206,4 @@ } } } -} +} \ No newline at end of file diff --git a/modules/local/samtools/fastq/main.nf b/modules/local/samtools/fastq/main.nf index 87978d05d6..a86fb45bdc 100644 --- a/modules/local/samtools/fastq/main.nf +++ b/modules/local/samtools/fastq/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_FASTQ { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input) diff --git a/modules/local/samtools/index/main.nf b/modules/local/samtools/index/main.nf index 8d8f91dbe9..48d5c461f6 100644 --- a/modules/local/samtools/index/main.nf +++ b/modules/local/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input) diff --git a/modules/local/samtools/mergecram/main.nf b/modules/local/samtools/mergecram/main.nf index 9e91e09964..0769b689cb 100644 --- a/modules/local/samtools/mergecram/main.nf +++ b/modules/local/samtools/mergecram/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_MERGE_CRAM { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(crams) diff --git a/modules/local/samtools/viewindex/main.nf b/modules/local/samtools/viewindex/main.nf index d37735d1f6..e72dde1dca 100644 --- a/modules/local/samtools/viewindex/main.nf +++ b/modules/local/samtools/viewindex/main.nf @@ -3,10 +3,10 @@ process SAMTOOLS_VIEWINDEX { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input), path(index) diff --git a/modules/local/samtoolsview.nf b/modules/local/samtoolsview.nf index 112d22d9e3..70eba8c705 100644 --- a/modules/local/samtoolsview.nf +++ b/modules/local/samtoolsview.nf @@ -2,10 +2,10 @@ process SAMTOOLS_VIEW { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/modules/bwa/mem/main.nf b/modules/nf-core/modules/bwa/mem/main.nf index 27ea6f42e5..ffa5190813 100644 --- a/modules/nf-core/modules/bwa/mem/main.nf +++ b/modules/nf-core/modules/bwa/mem/main.nf @@ -2,10 +2,10 @@ process BWA_MEM { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:c56a3aabc8d64e52d5b9da1e8ecec2031668596d-0' : - 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:c56a3aabc8d64e52d5b9da1e8ecec2031668596d-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:8110a70be2bfe7f75a2ea7f2a89cda4cc7732095-0' : + 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:8110a70be2bfe7f75a2ea7f2a89cda4cc7732095-0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/modules/bwamem2/mem/main.nf b/modules/nf-core/modules/bwamem2/mem/main.nf index e3a3d164ea..50d84cb0ca 100644 --- a/modules/nf-core/modules/bwamem2/mem/main.nf +++ b/modules/nf-core/modules/bwamem2/mem/main.nf @@ -2,10 +2,10 @@ process BWAMEM2_MEM { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::bwa-mem2=2.2.1 bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::bwa-mem2=2.2.1 bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:8ee25ae85d7a2bacac3e3139db209aff3d605a18-0' : - 'quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:8ee25ae85d7a2bacac3e3139db209aff3d605a18-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:38aed4501da19db366dc7c8d52d31d94e760cfaf-0' : + 'quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:38aed4501da19db366dc7c8d52d31d94e760cfaf-0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/modules/qualimap/bamqccram/main.nf b/modules/nf-core/modules/qualimap/bamqccram/main.nf index ab3fd51a17..e136b8e24f 100644 --- a/modules/nf-core/modules/qualimap/bamqccram/main.nf +++ b/modules/nf-core/modules/qualimap/bamqccram/main.nf @@ -2,10 +2,10 @@ process QUALIMAP_BAMQCCRAM { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::qualimap=2.2.2d bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::qualimap=2.2.2d bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:9838874d42d4477d5042782ee019cec9854da7d5-0' : - 'quay.io/biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:9838874d42d4477d5042782ee019cec9854da7d5-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:61f6d4658ac88635fc37623af50bba77561988ab-0' : + 'quay.io/biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:61f6d4658ac88635fc37623af50bba77561988ab-0' }" input: tuple val(meta), path(cram), path(crai) diff --git a/modules/nf-core/modules/samblaster/main.nf b/modules/nf-core/modules/samblaster/main.nf index c881389acd..225c715280 100644 --- a/modules/nf-core/modules/samblaster/main.nf +++ b/modules/nf-core/modules/samblaster/main.nf @@ -2,10 +2,10 @@ process SAMBLASTER { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samblaster=0.1.26 bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samblaster=0.1.26 bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:ba4a02b56f3e524a6e006bcd99fe8cc1d7fe09eb-0' : - 'quay.io/biocontainers/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:ba4a02b56f3e524a6e006bcd99fe8cc1d7fe09eb-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:fff03944e664bbf9a139f7b174b9cb2d4163271a-0' : + 'quay.io/biocontainers/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:fff03944e664bbf9a139f7b174b9cb2d4163271a-0' }" input: tuple val(meta), path(bam) diff --git a/modules/nf-core/modules/samtools/bam2fq/main.nf b/modules/nf-core/modules/samtools/bam2fq/main.nf index 8dd64dc019..5d6aa79d46 100644 --- a/modules/nf-core/modules/samtools/bam2fq/main.nf +++ b/modules/nf-core/modules/samtools/bam2fq/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_BAM2FQ { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(inputbam) diff --git a/modules/nf-core/modules/samtools/faidx/main.nf b/modules/nf-core/modules/samtools/faidx/main.nf index 053279ff4f..fdce7d9b8b 100644 --- a/modules/nf-core/modules/samtools/faidx/main.nf +++ b/modules/nf-core/modules/samtools/faidx/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_FAIDX { tag "$fasta" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/modules/samtools/index/main.nf b/modules/nf-core/modules/samtools/index/main.nf index fff6e1b84b..e04e63e859 100644 --- a/modules/nf-core/modules/samtools/index/main.nf +++ b/modules/nf-core/modules/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/modules/samtools/merge/main.nf b/modules/nf-core/modules/samtools/merge/main.nf index 9f962a4b01..bbf7e8fbd6 100644 --- a/modules/nf-core/modules/samtools/merge/main.nf +++ b/modules/nf-core/modules/samtools/merge/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_MERGE { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input_files) diff --git a/modules/nf-core/modules/samtools/mpileup/main.nf b/modules/nf-core/modules/samtools/mpileup/main.nf index 474a249245..fcd498becb 100644 --- a/modules/nf-core/modules/samtools/mpileup/main.nf +++ b/modules/nf-core/modules/samtools/mpileup/main.nf @@ -2,11 +2,10 @@ process SAMTOOLS_MPILEUP { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" - + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input), path(intervals) path fasta diff --git a/modules/nf-core/modules/samtools/stats/main.nf b/modules/nf-core/modules/samtools/stats/main.nf index 85cb64f3c2..bbdc3240d6 100644 --- a/modules/nf-core/modules/samtools/stats/main.nf +++ b/modules/nf-core/modules/samtools/stats/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_STATS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/modules/samtools/view/main.nf b/modules/nf-core/modules/samtools/view/main.nf index 75aad0635c..5f14fbbf2c 100644 --- a/modules/nf-core/modules/samtools/view/main.nf +++ b/modules/nf-core/modules/samtools/view/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_VIEW { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::samtools=1.15" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : + 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" input: tuple val(meta), path(input) From 5c26303c53b5ebeeeee570864bdebf2b5c028d31 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 11 Apr 2022 17:08:05 +0200 Subject: [PATCH 26/45] Add CF testing --- conf/modules.config | 18 +++++++- .../variantcalling/controlfreec/main.nf | 15 ++++--- tests/nextflow.config | 4 +- tests/test_tools.yml | 43 +++++++++++++++++-- 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index bcb22a2251..0ff6a36698 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -613,6 +613,7 @@ process{ } withName: 'CAT_MPILEUP_.*' { + ext.when = { !params.no_intervals } publishDir = [ enabled: "${!params.no_intervals}", mode: params.publish_dir_mode, @@ -699,7 +700,6 @@ process{ ] } - //MANTA withName: 'CONCAT_MANTA_TUMOR' { ext.prefix = {"${meta.id}.tumor_sv"} @@ -793,6 +793,22 @@ process{ } //CONTROLFREEC + withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:MPILEUP_NORMAL' { + ext.prefix = { "${meta.id}.normal" } + } + + withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:MPILEUP_TUMOR' { + ext.prefix = { "${meta.id}.tumor" } + } + + withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:CAT_MPILEUP_NORMAL' { + ext.prefix = { "${meta.id}.normal.pileup" } + } + + withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:CAT_MPILEUP_TUMOR' { + ext.prefix = { "${meta.id}.tumor.pileup" } + } + withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ ext.args = {[ "sample":[ diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/main.nf index d621b20a91..1c3047c264 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/main.nf @@ -42,15 +42,19 @@ workflow RUN_CONTROLFREEC { //Merge mpileup only when intervals and natural order sort them CAT_MPILEUP_NORMAL( mpileup_normal.intervals.map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_normal" + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id [new_meta, pileup] }.groupTuple(size: num_intervals, sort:true)) - CAT_MPILEUP_TUMOR(mpileup_tumor.intervals.map{ meta, pileup -> + CAT_MPILEUP_TUMOR(mpileup_tumor.intervals + .map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" : new_meta.sample + new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id : new_meta.sample [new_meta, pileup] - }.groupTuple(size: num_intervals, sort:true)) + } + .groupTuple(size: num_intervals, sort:true)) + + mpileup_normal.no_intervals.view() //TODO fix naming for no intervals controlfreec_input_normal = Channel.empty().mix( @@ -67,7 +71,7 @@ workflow RUN_CONTROLFREEC { mpileup_tumor.no_intervals ).map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id + "_tumor" : new_meta.sample + new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id : new_meta.sample [new_meta, pileup] } @@ -77,6 +81,7 @@ workflow RUN_CONTROLFREEC { [meta, p, pileup_tumor, [], [], [], []] }.set{controlfreec_input} + controlfreec_input.view() FREEC(controlfreec_input, fasta, fasta_fai, diff --git a/tests/nextflow.config b/tests/nextflow.config index 70d29aed1e..21ac8a6d72 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1,6 +1,6 @@ process { - withName:'FREEC'{ + withName:'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ ext.args = { [ "sample":[ inputformat: 'pileup', @@ -17,8 +17,8 @@ process { "control":[ inputformat: "pileup", mateorientation: "FR" - ] ] + ] } } diff --git a/tests/test_tools.yml b/tests/test_tools.yml index 227c34c7a6..4b09456969 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -1,13 +1,50 @@ -- name: Run variant calling on tumor_only sample with controlfreec +- name: Run variant calling on somatic samples with controlfreec command: nextflow run main.nf -profile test,tools_somatic,docker --tools controlfreec -c ./tests/nextflow.config tags: - controlfreec - - no_intervals - somatic - variant_calling - copy_number_calling files: - - path: results/variant_calling/sample2/controlfreec/sample2.candidate_small_indels.vcf.gz + - path: results/variant_calling/sample4_vs_sample3/controlfreec/config.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_BAF.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.log2.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.bed + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.circos.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup_control.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.p.value.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_BAF.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_CNVs + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_info.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.BedGraph + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn + +- name: Run variant calling on tumor_only sample with controlfreec + command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec -c ./tests/nextflow.config -stub-run + tags: + - controlfreec + - tumor_only + - variant_calling + - copy_number_calling + files: + - path: results/variant_calling/sample2/controlfreec/config.txt + - path: results/variant_calling/sample2/controlfreec/GC_profile.sample2.cpn + - path: results/variant_calling/sample2/controlfreec/sample2_BAF.png + - path: results/variant_calling/sample2/controlfreec/sample2_BAF.txt + - path: results/variant_calling/sample2/controlfreec/sample2_info.txt + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.BedGraph + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.log2.png + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.png + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.txt + - path: results/variant_calling/sample2/controlfreec/sample2_sample.cpn + - path: results/variant_calling/sample2/controlfreec/sample2.bed + - path: results/variant_calling/sample2/controlfreec/sample2.circos.txt + - path: results/variant_calling/sample2/controlfreec/sample2.mpileup + - path: results/variant_calling/sample2/controlfreec/sample2.p.value.txt - name: Run variant calling on germline sample with deepvariant command: nextflow run main.nf -profile test,tools_germline,docker --tools deepvariant From f8681b22a65f580f3f720666aa2156457e6aed15 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 11 Apr 2022 17:12:01 +0200 Subject: [PATCH 27/45] see if removing controlfreec tests fixes log not found error --- tests/test_tools.yml | 48 -------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/tests/test_tools.yml b/tests/test_tools.yml index 4b09456969..3621c8d3c0 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -1,51 +1,3 @@ -- name: Run variant calling on somatic samples with controlfreec - command: nextflow run main.nf -profile test,tools_somatic,docker --tools controlfreec -c ./tests/nextflow.config - tags: - - controlfreec - - somatic - - variant_calling - - copy_number_calling - files: - - path: results/variant_calling/sample4_vs_sample3/controlfreec/config.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_BAF.png - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.log2.png - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.png - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.bed - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.circos.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup_control.cpn - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.p.value.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_BAF.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_CNVs - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_info.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.BedGraph - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn - -- name: Run variant calling on tumor_only sample with controlfreec - command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec -c ./tests/nextflow.config -stub-run - tags: - - controlfreec - - tumor_only - - variant_calling - - copy_number_calling - files: - - path: results/variant_calling/sample2/controlfreec/config.txt - - path: results/variant_calling/sample2/controlfreec/GC_profile.sample2.cpn - - path: results/variant_calling/sample2/controlfreec/sample2_BAF.png - - path: results/variant_calling/sample2/controlfreec/sample2_BAF.txt - - path: results/variant_calling/sample2/controlfreec/sample2_info.txt - - path: results/variant_calling/sample2/controlfreec/sample2_ratio.BedGraph - - path: results/variant_calling/sample2/controlfreec/sample2_ratio.log2.png - - path: results/variant_calling/sample2/controlfreec/sample2_ratio.png - - path: results/variant_calling/sample2/controlfreec/sample2_ratio.txt - - path: results/variant_calling/sample2/controlfreec/sample2_sample.cpn - - path: results/variant_calling/sample2/controlfreec/sample2.bed - - path: results/variant_calling/sample2/controlfreec/sample2.circos.txt - - path: results/variant_calling/sample2/controlfreec/sample2.mpileup - - path: results/variant_calling/sample2/controlfreec/sample2.p.value.txt - - name: Run variant calling on germline sample with deepvariant command: nextflow run main.nf -profile test,tools_germline,docker --tools deepvariant tags: From 6e8b5b936536615bfdcea54f68acf2c2e048eee2 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 11 Apr 2022 17:13:28 +0200 Subject: [PATCH 28/45] see if removing controlfreec tests fixes log not found error --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 977e1eb03c..97cd8e7f65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - "aligner" - "annotation" - "default" - - "controlfreec" + #- "controlfreec" - "deepvariant" - "freebayes" - "gatk4_spark" From 16372f832b5074097eb40bcf4df789e8eb65534e Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 12 Apr 2022 11:24:54 +0200 Subject: [PATCH 29/45] update manta --- modules.json | 6 +++--- modules/nf-core/modules/dragmap/align/main.nf | 6 +++--- modules/nf-core/modules/manta/germline/main.nf | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules.json b/modules.json index fbb27cf883..1ce1d1d1f9 100644 --- a/modules.json +++ b/modules.json @@ -55,7 +55,7 @@ "git_sha": "fd5f6f5f4ffef4ab5a4e809bd3211bbc71c38d30" }, "dragmap/align": { - "git_sha": "e786457fb0da9653659b921fc47985554f28273c" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "dragmap/hashtable": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -136,7 +136,7 @@ "git_sha": "f0800157544a82ae222931764483331a81812012" }, "manta/germline": { - "git_sha": "fd5f6f5f4ffef4ab5a4e809bd3211bbc71c38d30" + "git_sha": "ffedf09b6e84b479c9c901274f74bb33f3777243" }, "manta/somatic": { "git_sha": "979e57b7ac6a405a395dd7a6dbe1a275c5bc226b" @@ -212,4 +212,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/nf-core/modules/dragmap/align/main.nf b/modules/nf-core/modules/dragmap/align/main.nf index ee94a9a8d9..b7f1e33bc3 100644 --- a/modules/nf-core/modules/dragmap/align/main.nf +++ b/modules/nf-core/modules/dragmap/align/main.nf @@ -2,10 +2,10 @@ process DRAGMAP_ALIGN { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::dragmap=1.2.1 bioconda::samtools=1.14 conda-forge::pigz=2.3.4" : null) + conda (params.enable_conda ? "bioconda::dragmap=1.2.1 bioconda::samtools=1.15.1 conda-forge::pigz=2.3.4" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:f7aad9060cde739c95685fc5ff6d6f7e3ec629c8-0': - 'quay.io/biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:f7aad9060cde739c95685fc5ff6d6f7e3ec629c8-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:5ebebbc128cd624282eaa37d2c7fe01505a91a69-0': + 'quay.io/biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:5ebebbc128cd624282eaa37d2c7fe01505a91a69-0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/modules/manta/germline/main.nf b/modules/nf-core/modules/manta/germline/main.nf index 5ddba51be2..c680dc9d3d 100644 --- a/modules/nf-core/modules/manta/germline/main.nf +++ b/modules/nf-core/modules/manta/germline/main.nf @@ -8,11 +8,10 @@ process MANTA_GERMLINE { 'quay.io/biocontainers/manta:1.6.0--h9ee0642_1' }" input: - tuple val(meta), path(input), path(index) + //Matching the target bed with the input sample allows to parallelize the same sample run across different intervals or a single bed file + tuple val(meta), path(input), path(index), path(target_bed), path(target_bed_tbi) path fasta path fasta_fai - tuple path(target_bed), path(target_bed_tbi) - output: tuple val(meta), path("*candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf From 71c317c3fa6178adefa92ae687b3ab5d17f51029 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 11:09:16 +0200 Subject: [PATCH 30/45] Finish up somatic CF, works locally tests won't pass because of local folder --- conf/modules.config | 19 ++--- conf/test.config | 2 +- subworkflows/local/pair_variant_calling.nf | 8 +- subworkflows/local/tumor_variant_calling.nf | 6 +- .../controlfreec/{ => somatic}/main.nf | 51 ++++++------ .../controlfreec/tumoronly/main.nf | 83 +++++++++++++++++++ tests/nextflow.config | 2 +- tests/test_tools.yml | 74 +++++++++++++++++ 8 files changed, 198 insertions(+), 47 deletions(-) rename subworkflows/nf-core/variantcalling/controlfreec/{ => somatic}/main.nf (70%) create mode 100644 subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf diff --git a/conf/modules.config b/conf/modules.config index a52a0cbf86..2eb748c088 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -620,11 +620,6 @@ process{ // TUMOR_VARIANT_CALLING //CONTROLFREEC - //TODO: when nextflow will be able to not show disabled processes this will clean up the output - withName: 'NFCORE_SAREK:SAREK:TUMOR_ONLY_VARIANT_CALLING:RUN_CONTROLFREEC:.*_NORMAL'{ - ext.when = false - } - withName: 'ASSESS_SIGNIFICANCE' { publishDir = [ mode: params.publish_dir_mode, @@ -643,7 +638,7 @@ process{ ] } - withName: 'FREEC' { + withName: 'FREEC_.*' { ext.when = { params.tools && params.tools.contains('controlfreec') } publishDir = [ mode: params.publish_dir_mode, @@ -652,7 +647,7 @@ process{ ] } - withName: 'NFCORE_SAREK:SAREK:TUMOR_ONLY_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ + withName: 'FREEC_TUMORONLY'{ ext.args = {[ "sample":[ inputformat: 'pileup', @@ -814,23 +809,23 @@ process{ } //CONTROLFREEC - withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:MPILEUP_NORMAL' { + withName: 'MPILEUP_NORMAL' { ext.prefix = { "${meta.id}.normal" } } - withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:MPILEUP_TUMOR' { + withName: 'MPILEUP_TUMOR' { ext.prefix = { "${meta.id}.tumor" } } - withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:CAT_MPILEUP_NORMAL' { + withName: 'CAT_MPILEUP_NORMAL' { ext.prefix = { "${meta.id}.normal.pileup" } } - withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:CAT_MPILEUP_TUMOR' { + withName: 'CAT_MPILEUP_TUMOR' { ext.prefix = { "${meta.id}.tumor.pileup" } } - withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ + withName: 'FREEC_SOMATIC'{ ext.args = {[ "sample":[ inputformat: 'pileup', diff --git a/conf/test.config b/conf/test.config index 9de54ea2ac..80050f4d05 100644 --- a/conf/test.config +++ b/conf/test.config @@ -123,7 +123,7 @@ profiles { params.wes = true params.genome = 'WBcel235' params.vep_genome = 'WBcel235' - params.chr_dir = '/Users/monarchy/Projects/Coding/modules/work/2a/d04831835d0ab95ba9fad3a461fc4f/chromosomes' + params.chr_dir = '/Users/monarchy/Downloads/chromosomes' } trimming { params.clip_r1 = 1 diff --git a/subworkflows/local/pair_variant_calling.nf b/subworkflows/local/pair_variant_calling.nf index 0a74dcd94f..c06bf700f9 100644 --- a/subworkflows/local/pair_variant_calling.nf +++ b/subworkflows/local/pair_variant_calling.nf @@ -3,7 +3,7 @@ // include { GATK_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_normal_somatic_variant_calling/main' include { MSISENSORPRO_MSI_SOMATIC } from '../../modules/nf-core/modules/msisensorpro/msi_somatic/main' -include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' +include { RUN_CONTROLFREEC_SOMATIC } from '../nf-core/variantcalling/controlfreec/somatic/main.nf' include { RUN_MANTA_SOMATIC } from '../nf-core/variantcalling/manta/somatic/main.nf' include { RUN_STRELKA_SOMATIC } from '../nf-core/variantcalling/strelka/somatic/main.nf' @@ -74,7 +74,7 @@ workflow PAIR_VARIANT_CALLING { [meta, tumor_cram, intervals] } - RUN_CONTROLFREEC(cram_normal_intervals_no_index, + RUN_CONTROLFREEC_SOMATIC(cram_normal_intervals_no_index, cram_tumor_intervals_no_index, fasta, fasta_fai, @@ -84,8 +84,9 @@ workflow PAIR_VARIANT_CALLING { mappability, intervals_bed_combined, num_intervals) - ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) + ch_versions = ch_versions.mix(RUN_CONTROLFREEC_SOMATIC.out.versions) } + if (tools.contains('manta')) { RUN_MANTA_SOMATIC( cram_pair_intervals_gz_tbi, fasta, @@ -102,7 +103,6 @@ workflow PAIR_VARIANT_CALLING { if (tools.contains('strelka')) { if (tools.contains('manta')) { - cram_pair_strelka = cram_pair.join(manta_candidate_small_indels_vcf) .join(manta_candidate_small_indels_vcf_tbi) .combine(intervals_bed_gz_tbi) diff --git a/subworkflows/local/tumor_variant_calling.nf b/subworkflows/local/tumor_variant_calling.nf index e39ec912f6..566ed83499 100644 --- a/subworkflows/local/tumor_variant_calling.nf +++ b/subworkflows/local/tumor_variant_calling.nf @@ -8,7 +8,7 @@ include { RUN_FREEBAYES } from '../nf-core/variantcall include { GATK_TUMOR_ONLY_SOMATIC_VARIANT_CALLING } from '../../subworkflows/nf-core/gatk4/tumor_only_somatic_variant_calling/main' include { RUN_MANTA_TUMORONLY } from '../nf-core/variantcalling/manta/tumoronly/main.nf' include { RUN_STRELKA_SINGLE } from '../nf-core/variantcalling/strelka/single/main.nf' -include { RUN_CONTROLFREEC } from '../nf-core/variantcalling/controlfreec/main.nf' +include { RUN_CONTROLFREEC_TUMORONLY } from '../nf-core/variantcalling/controlfreec/tumoronly/main.nf' workflow TUMOR_ONLY_VARIANT_CALLING { take: @@ -63,7 +63,7 @@ workflow TUMOR_ONLY_VARIANT_CALLING { if(tools.contains('controlfreec')){ cram_recalibrated_intervals.map {meta, cram, crai, intervals -> [meta, cram, intervals]}.set{cram_intervals_no_index} - RUN_CONTROLFREEC( Channel.empty(), + RUN_CONTROLFREEC_TUMORONLY( cram_intervals_no_index, fasta, fasta_fai, @@ -73,7 +73,7 @@ workflow TUMOR_ONLY_VARIANT_CALLING { mappability, intervals_bed_combined, num_intervals) - ch_versions = ch_versions.mix(RUN_CONTROLFREEC.out.versions) + ch_versions = ch_versions.mix(RUN_CONTROLFREEC_TUMORONLY.out.versions) } if (tools.contains('freebayes')){ diff --git a/subworkflows/nf-core/variantcalling/controlfreec/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf similarity index 70% rename from subworkflows/nf-core/variantcalling/controlfreec/main.nf rename to subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf index 1c3047c264..32b85445e1 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf @@ -1,14 +1,14 @@ -include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/cat/cat/main.nf' -include { CONTROLFREEC_FREEC as FREEC } from '../../../../modules/nf-core/modules/controlfreec/freec/main' -include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' -include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../modules/nf-core/modules/controlfreec/freec2bed/main' -include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../modules/nf-core/modules/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../modules/nf-core/modules/controlfreec/makegraph/main' -include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../modules/nf-core/modules/samtools/mpileup/main' -include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../modules/nf-core/modules/samtools/mpileup/main' - -workflow RUN_CONTROLFREEC { +include { CAT_CAT as CAT_MPILEUP_NORMAL } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC_FREEC as FREEC_SOMATIC } from '../../../../../modules/nf-core/modules/controlfreec/freec/main' +include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' +include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../../modules/nf-core/modules/controlfreec/freec2bed/main' +include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../../modules/nf-core/modules/controlfreec/freec2circos/main' +include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../../modules/nf-core/modules/controlfreec/makegraph/main' +include { SAMTOOLS_MPILEUP as MPILEUP_NORMAL } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' +include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' + +workflow RUN_CONTROLFREEC_SOMATIC { take: cram_normal // channel: [mandatory] [meta, cram, crai, interval] cram_tumor // channel: [mandatory] [meta, cram, crai, interval] @@ -49,14 +49,13 @@ workflow RUN_CONTROLFREEC { CAT_MPILEUP_TUMOR(mpileup_tumor.intervals .map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id : new_meta.sample + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id [new_meta, pileup] } .groupTuple(size: num_intervals, sort:true)) mpileup_normal.no_intervals.view() - //TODO fix naming for no intervals controlfreec_input_normal = Channel.empty().mix( CAT_MPILEUP_NORMAL.out.file_out, mpileup_normal.no_intervals @@ -71,18 +70,18 @@ workflow RUN_CONTROLFREEC { mpileup_tumor.no_intervals ).map{ meta, pileup -> new_meta = meta.clone() - new_meta.id = new_meta.tumor_id ? new_meta.tumor_id + "_vs_" + new_meta.normal_id : new_meta.sample + new_meta.id = new_meta.tumor_id + "_vs_" + new_meta.normal_id [new_meta, pileup] } - controlfreec_input_normal.join(controlfreec_input_tumor, remainder: true) - .map{ meta, pileup_normal, pileup_tumor -> - p = pileup_normal ?: [] - [meta, p, pileup_tumor, [], [], [], []] - }.set{controlfreec_input} + controlfreec_input_normal.cross(controlfreec_input_tumor) + .map{ normal, tumor -> + // [meta, normal_pileup, tumor_pileup, [] , [], [], []] + [normal[0], normal[1], tumor[1], [], [], [], []] + } + .set{controlfreec_input} - controlfreec_input.view() - FREEC(controlfreec_input, + FREEC_SOMATIC(controlfreec_input, fasta, fasta_fai, [], @@ -93,16 +92,16 @@ workflow RUN_CONTROLFREEC { intervals_bed, []) - ASSESS_SIGNIFICANCE( FREEC.out.CNV.join(FREEC.out.ratio)) - FREEC2BED( FREEC.out.ratio ) - FREEC2CIRCOS( FREEC.out.ratio ) - MAKEGRAPH(FREEC.out.ratio.join(FREEC.out.BAF)) + 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)) ch_versions = ch_versions.mix(MPILEUP_NORMAL.out.versions) ch_versions = ch_versions.mix(MPILEUP_TUMOR.out.versions) ch_versions = ch_versions.mix(CAT_MPILEUP_NORMAL.out.versions) ch_versions = ch_versions.mix(CAT_MPILEUP_TUMOR.out.versions) - ch_versions = ch_versions.mix(FREEC.out.versions) + 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) diff --git a/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf new file mode 100644 index 0000000000..ee79ae6244 --- /dev/null +++ b/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf @@ -0,0 +1,83 @@ +include { CAT_CAT as CAT_MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/cat/cat/main.nf' +include { CONTROLFREEC_FREEC as FREEC_TUMORONLY } from '../../../../../modules/nf-core/modules/controlfreec/freec/main' +include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../../../modules/nf-core/modules/controlfreec/assesssignificance/main' +include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../../../modules/nf-core/modules/controlfreec/freec2bed/main' +include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../../../modules/nf-core/modules/controlfreec/freec2circos/main' +include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../../../modules/nf-core/modules/controlfreec/makegraph/main' +include { SAMTOOLS_MPILEUP as MPILEUP_TUMOR } from '../../../../../modules/nf-core/modules/samtools/mpileup/main' + +workflow RUN_CONTROLFREEC_TUMORONLY { + take: + cram_tumor // channel: [mandatory] [meta, cram, crai, interval] + fasta // channel: [mandatory] + fasta_fai // channel: [mandatory] + dbsnp // channel: [mandatory] + dbsnp_tbi // channel: [mandatory] + 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 + num_intervals // val: [optional] Number of used intervals, mandatory when intervals are provided. + + main: + + ch_versions = Channel.empty() + + MPILEUP_TUMOR(cram_tumor, fasta) + + MPILEUP_TUMOR.out.mpileup.branch{ + intervals: num_intervals > 1 + no_intervals: num_intervals == 1 + }.set{mpileup_tumor} + + //Merge mpileup only when intervals and natural order sort them + CAT_MPILEUP_TUMOR(mpileup_tumor.intervals + .map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.sample + [new_meta, pileup] + } + .groupTuple(size: num_intervals, sort:true)) + + + //TODO fix naming for no intervals + controlfreec_input_tumor = Channel.empty().mix( + CAT_MPILEUP_TUMOR.out.file_out, + mpileup_tumor.no_intervals + ).map{ meta, pileup -> + new_meta = meta.clone() + new_meta.id = new_meta.sample + [new_meta, pileup] + } + + controlfreec_input_tumor + .map{ meta, pileup_tumor -> + [meta, pileup_tumor, [], [], [], []] + }.set{controlfreec_input} + + FREEC_TUMORONLY(controlfreec_input, + fasta, + fasta_fai, + [], + dbsnp, + dbsnp_tbi, + chr_files, + mappability, + intervals_bed, + []) + + 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)) + + ch_versions = ch_versions.mix(MPILEUP_TUMOR.out.versions) + ch_versions = ch_versions.mix(CAT_MPILEUP_TUMOR.out.versions) + 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) + + emit: + versions = ch_versions +} diff --git a/tests/nextflow.config b/tests/nextflow.config index 21ac8a6d72..ca18d021f9 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1,6 +1,6 @@ process { - withName:'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_CONTROLFREEC:FREEC'{ + withName:'FREEC_SOMATIC'{ ext.args = { [ "sample":[ inputformat: 'pileup', diff --git a/tests/test_tools.yml b/tests/test_tools.yml index 3621c8d3c0..d160a0082c 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -1,3 +1,77 @@ +- name: Run variant calling on somatic samples with controlfreec + command: nextflow run main.nf -profile test,tools_somatic,docker --tools controlfreec -c ./tests/nextflow.config + tags: + - controlfreec + - somatic + - variant_calling + - copy_number_calling + files: + - path: results/variant_calling/sample4_vs_sample3/controlfreec/config.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_BAF.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.log2.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.bed + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.circos.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup_control.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.p.value.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_BAF.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_CNVs + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_info.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.BedGraph + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn + +- name: Run variant calling on somatic samples with controlfreec without intervals + command: nextflow run main.nf -profile test,tools_somatic,docker --tools controlfreec -c ./tests/nextflow.config --no_intervals + tags: + - controlfreec + - no_intervals + - somatic + - variant_calling + - copy_number_calling + files: + - path: results/variant_calling/sample4_vs_sample3/controlfreec/config.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_BAF.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.log2.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.png + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.bed + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.circos.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup_control.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.p.value.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_BAF.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_CNVs + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_info.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.BedGraph + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn + +- name: Run variant calling on tumor_only sample with controlfreec + command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec -c ./tests/nextflow.config -stub-run + tags: + - controlfreec + - tumor_only + - variant_calling + - copy_number_calling + files: + - path: results/variant_calling/sample2/controlfreec/config.txt + - path: results/variant_calling/sample2/controlfreec/GC_profile.sample2.cpn + - path: results/variant_calling/sample2/controlfreec/sample2_BAF.png + - path: results/variant_calling/sample2/controlfreec/sample2_BAF.txt + - path: results/variant_calling/sample2/controlfreec/sample2_info.txt + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.BedGraph + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.log2.png + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.png + - path: results/variant_calling/sample2/controlfreec/sample2_ratio.txt + - path: results/variant_calling/sample2/controlfreec/sample2_sample.cpn + - path: results/variant_calling/sample2/controlfreec/sample2.bed + - path: results/variant_calling/sample2/controlfreec/sample2.circos.txt + - path: results/variant_calling/sample2/controlfreec/sample2.mpileup + - path: results/variant_calling/sample2/controlfreec/sample2.p.value.txt + - name: Run variant calling on germline sample with deepvariant command: nextflow run main.nf -profile test,tools_germline,docker --tools deepvariant tags: From c34c4fdec033bdb4968c0f1672128d632599ac84 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 11:17:43 +0200 Subject: [PATCH 31/45] Functional Tumoronly Cf workflow --- .../nf-core/variantcalling/controlfreec/tumoronly/main.nf | 2 +- tests/test_tools.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf index ee79ae6244..c1e0389653 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf @@ -51,7 +51,7 @@ workflow RUN_CONTROLFREEC_TUMORONLY { controlfreec_input_tumor .map{ meta, pileup_tumor -> - [meta, pileup_tumor, [], [], [], []] + [meta, [], pileup_tumor, [], [], [], []] }.set{controlfreec_input} FREEC_TUMORONLY(controlfreec_input, diff --git a/tests/test_tools.yml b/tests/test_tools.yml index d160a0082c..4c2c8519dc 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -50,7 +50,7 @@ - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn - name: Run variant calling on tumor_only sample with controlfreec - command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec -c ./tests/nextflow.config -stub-run + command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec -stub-run tags: - controlfreec - tumor_only From 50f413742d020da5e710ac51968edd4ce9d23c32 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 16:34:37 +0200 Subject: [PATCH 32/45] add optional tar.gz for chromosome files --- subworkflows/local/prepare_genome.nf | 11 ++++++++++- .../variantcalling/controlfreec/tumoronly/main.nf | 2 -- workflows/sarek.nf | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index 842ed1aa20..8ef9511a90 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -19,9 +19,11 @@ include { TABIX_TABIX as TABIX_DBSNP } from '../../modules/nf-core/m include { TABIX_TABIX as TABIX_GERMLINE_RESOURCE } from '../../modules/nf-core/modules/tabix/tabix/main' include { TABIX_TABIX as TABIX_KNOWN_INDELS } from '../../modules/nf-core/modules/tabix/tabix/main' include { TABIX_TABIX as TABIX_PON } from '../../modules/nf-core/modules/tabix/tabix/main' +include { UNTAR as UNTAR_CHR_DIR } from '../../modules/nf-core/modules/untar/main' workflow PREPARE_GENOME { take: + chr_dir // channel: [optional] chromosome files dbsnp // channel: [optional] dbsnp fasta // channel: [mandatory] fasta fasta_fai // channel: [optional] fasta_fai @@ -49,6 +51,13 @@ workflow PREPARE_GENOME { TABIX_KNOWN_INDELS(known_indels.map{ it -> [[id:it[0].baseName], it] }) TABIX_PON(pon.map{ it -> [[id:it[0].baseName], it] }) + chr_files = chr_dir + if ( params.chr_dir.endsWith('tar.gz')){ + UNTAR_CHR_DIR(chr_dir.map{ it -> [[id:it[0].baseName], it] }) + chr_files = UNTAR_CHR_DIR.out.untar.map{ it[1] } + ch_versions = ch_versions.mix(UNTAR_CHR_DIR.out.versions) + } + // Gather versions of all tools used ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) ch_versions = ch_versions.mix(BWAMEM1_INDEX.out.versions) @@ -69,6 +78,6 @@ workflow PREPARE_GENOME { known_indels_tbi = TABIX_KNOWN_INDELS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi msisensorpro_scan = MSISENSORPRO_SCAN.out.list.map{ meta, list -> [list] } // path: genome_msi.list pon_tbi = TABIX_PON.out.tbi.map{ meta, tbi -> [tbi] } // path: pon.vcf.gz.tbi - + chr_files = chr_files versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf b/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf index c1e0389653..3eaff249f4 100644 --- a/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf +++ b/subworkflows/nf-core/variantcalling/controlfreec/tumoronly/main.nf @@ -38,8 +38,6 @@ workflow RUN_CONTROLFREEC_TUMORONLY { } .groupTuple(size: num_intervals, sort:true)) - - //TODO fix naming for no intervals controlfreec_input_tumor = Channel.empty().mix( CAT_MPILEUP_TUMOR.out.file_out, mpileup_tumor.no_intervals diff --git a/workflows/sarek.nf b/workflows/sarek.nf index 946bc3f2f9..ba1d1211be 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek.nf @@ -215,6 +215,7 @@ workflow SAREK { // Build indices if needed PREPARE_GENOME( + chr_dir, dbsnp, fasta, fasta_fai, @@ -224,6 +225,7 @@ workflow SAREK { // Gather built indices or get them from the params bwa = params.fasta ? params.bwa ? Channel.fromPath(params.bwa).collect() : PREPARE_GENOME.out.bwa : [] + chr_files = PREPARE_GENOME.out.chr_files dict = params.fasta ? params.dict ? Channel.fromPath(params.dict).collect() : PREPARE_GENOME.out.dict : [] fasta_fai = params.fasta ? params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() : PREPARE_GENOME.out.fasta_fai : [] dbsnp_tbi = params.dbsnp ? params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi).collect() : PREPARE_GENOME.out.dbsnp_tbi : Channel.empty() @@ -607,7 +609,7 @@ workflow SAREK { germline_resource_tbi, pon, pon_tbi, - chr_dir, + chr_files, mappability ) @@ -632,7 +634,7 @@ workflow SAREK { germline_resource_tbi, pon, pon_tbi, - chr_dir, + chr_files, mappability) // Gather vcf files for annotation From 2ba2458ebfe9641b13957625df8a3ec38f606ad7 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 16:35:17 +0200 Subject: [PATCH 33/45] comment my decisions --- subworkflows/local/prepare_genome.nf | 1 + 1 file changed, 1 insertion(+) diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index 8ef9511a90..f05f062013 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -52,6 +52,7 @@ workflow PREPARE_GENOME { TABIX_PON(pon.map{ it -> [[id:it[0].baseName], it] }) chr_files = chr_dir + //TODO this works, but is not pretty. I will leave this in yuor hands during refactoring @Maxime if ( params.chr_dir.endsWith('tar.gz')){ UNTAR_CHR_DIR(chr_dir.map{ it -> [[id:it[0].baseName], it] }) chr_files = UNTAR_CHR_DIR.out.untar.map{ it[1] } From 79865e4c3ba145f39275498b6d692a3fa4588c20 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 16:39:08 +0200 Subject: [PATCH 34/45] use test data from test data repo --- conf/test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/test.config b/conf/test.config index 80050f4d05..57884bd794 100644 --- a/conf/test.config +++ b/conf/test.config @@ -123,7 +123,7 @@ profiles { params.wes = true params.genome = 'WBcel235' params.vep_genome = 'WBcel235' - params.chr_dir = '/Users/monarchy/Downloads/chromosomes' + params.chr_dir = "${params.genomes_base}/data/genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz" } trimming { params.clip_r1 = 1 From 1b8daca0bada5778dc8b7e0c9ab289c70524c249 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 16:43:05 +0200 Subject: [PATCH 35/45] Add untar module --- modules.json | 8 ++- .../modules/gatk4/markduplicatesspark/main.nf | 50 ++++++++++++++++ .../gatk4/markduplicatesspark/meta.yml | 60 +++++++++++++++++++ modules/nf-core/modules/untar/main.nf | 47 +++++++++++++++ modules/nf-core/modules/untar/meta.yml | 38 ++++++++++++ 5 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/modules/gatk4/markduplicatesspark/main.nf create mode 100644 modules/nf-core/modules/gatk4/markduplicatesspark/meta.yml create mode 100644 modules/nf-core/modules/untar/main.nf create mode 100644 modules/nf-core/modules/untar/meta.yml diff --git a/modules.json b/modules.json index 1ce1d1d1f9..4a239dfe18 100644 --- a/modules.json +++ b/modules.json @@ -126,6 +126,9 @@ "gatk4/markduplicates": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "gatk4/markduplicatesspark": { + "git_sha": "e04970b7d249365cafa5a52912f9a28840481c05" + }, "gatk4/mergemutectstats": { "git_sha": "3f364e2f31443f6742e8c63bf2083b5583431ef7" }, @@ -207,9 +210,12 @@ "trimgalore": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "untar": { + "git_sha": "9ae34a01d1747019fd37753ff4cafb05aec35a2b" + }, "vcftools": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/modules/gatk4/markduplicatesspark/main.nf b/modules/nf-core/modules/gatk4/markduplicatesspark/main.nf new file mode 100644 index 0000000000..77e135db42 --- /dev/null +++ b/modules/nf-core/modules/gatk4/markduplicatesspark/main.nf @@ -0,0 +1,50 @@ +process GATK4_MARKDUPLICATES_SPARK { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'broadinstitute/gatk:4.2.3.0' }" + + input: + tuple val(meta), path(bam) + path fasta + path fasta_fai + path dict + + output: + tuple val(meta), path("${prefix}"), emit: output + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input_list = bam.collect{"--input $it"}.join(' ') + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK MarkDuplicatesSpark] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + export SPARK_USER=spark3 + + gatk --java-options "-Xmx${avail_mem}g" MarkDuplicatesSpark \\ + $input_list \\ + --output $prefix \\ + --reference $fasta \\ + --spark-master local[${task.cpus}] \\ + --tmp-dir . \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/gatk4/markduplicatesspark/meta.yml b/modules/nf-core/modules/gatk4/markduplicatesspark/meta.yml new file mode 100644 index 0000000000..bf3e02baa1 --- /dev/null +++ b/modules/nf-core/modules/gatk4/markduplicatesspark/meta.yml @@ -0,0 +1,60 @@ +name: gatk4_markduplicates_spark +description: This tool locates and tags duplicate reads in a BAM or SAM file, where duplicate reads are defined as originating from a single fragment of DNA. +keywords: + - markduplicates + - bam + - sort +tools: + - gatk4: + description: + Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools + with a primary focus on variant discovery and genotyping. Its powerful processing engine + and high-performance computing features make it capable of taking on projects of any size. + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/articles/360037052812-MarkDuplicates-Picard- + tool_dev_url: https://github.com/broadinstitute/gatk + doi: 10.1158/1538-7445.AM2017-3590 + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Sorted BAM file + pattern: "*.{bam}" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bam: + type: file + description: Marked duplicates BAM file + pattern: "*.{bam}" + +authors: + - "@ajodeh-juma" + - "@FriederikeHanssen" + - "@maxulysse" diff --git a/modules/nf-core/modules/untar/main.nf b/modules/nf-core/modules/untar/main.nf new file mode 100644 index 0000000000..bbfa0bfe71 --- /dev/null +++ b/modules/nf-core/modules/untar/main.nf @@ -0,0 +1,47 @@ +process UNTAR { + tag "$archive" + label 'process_low' + + conda (params.enable_conda ? "conda-forge::tar=1.34" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv2/biocontainers_v1.2.0_cv2.img' : + 'biocontainers/biocontainers:v1.2.0_cv2' }" + + input: + tuple val(meta), path(archive) + + output: + tuple val(meta), path("$untar"), emit: untar + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + untar = archive.toString() - '.tar.gz' + """ + tar \\ + -xzvf \\ + $args \\ + $archive \\ + $args2 \\ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') + END_VERSIONS + """ + + stub: + untar = archive.toString() - '.tar.gz' + """ + touch $untar + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/untar/meta.yml b/modules/nf-core/modules/untar/meta.yml new file mode 100644 index 0000000000..d426919bd3 --- /dev/null +++ b/modules/nf-core/modules/untar/meta.yml @@ -0,0 +1,38 @@ +name: untar +description: Extract files. +keywords: + - untar + - uncompress +tools: + - untar: + description: | + Extract tar.gz files. + documentation: https://www.gnu.org/software/tar/manual/ + licence: ["GPL-3.0-or-later"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - archive: + type: file + description: File to be untar + pattern: "*.{tar}.{gz}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - untar: + type: file + description: + pattern: "*.*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@joseespinosa" + - "@drpatelh" From c0187afd5c913cac65e42728df9cbde63b91abe4 Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 16:46:51 +0200 Subject: [PATCH 36/45] make the linters happy --- conf/modules.config | 4 ++-- modules.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 2eb748c088..f3801ebb36 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -791,7 +791,7 @@ process{ //ASCAT withName: 'ASCAT' { ext.args = { - [ + [ "gender": meta.sex, //"genomeVersion": "hg19" //"purity": (optional), @@ -804,7 +804,7 @@ process{ //"ref_fasta": (optional), //"skip_allele_counting_tumour": (optional), //"skip_allele_counting_normal": (optional) - ] + ] } } diff --git a/modules.json b/modules.json index 4a239dfe18..79428f6d0e 100644 --- a/modules.json +++ b/modules.json @@ -218,4 +218,4 @@ } } } -} \ No newline at end of file +} From a82f58800d54ab3e275d9cbead2cbb3b4607a98c Mon Sep 17 00:00:00 2001 From: Rike Date: Wed, 13 Apr 2022 17:20:15 +0200 Subject: [PATCH 37/45] add cf to CI test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2658ffd220..16dc1a4458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - "aligner" - "annotation" - "default" - #- "controlfreec" + - "controlfreec" - "deepvariant" - "freebayes" - "gatk4_spark" From 3351d2a323c6a5a0a1e7f252e068275d012a5b58 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 10:02:08 +0200 Subject: [PATCH 38/45] Fix output paths --- conf/modules.config | 8 ++++---- tests/test_tools.yml | 38 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index c358c472e0..f06c896c5e 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -627,7 +627,7 @@ process{ enabled: "${!params.no_intervals}", mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, - pattern: "*{pileup}" + pattern: "*{mpileup}" ] } @@ -705,7 +705,7 @@ process{ enabled: "${params.no_intervals}", mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" }, - pattern: "*{pileup}" + pattern: "*{mpileup}" ] } @@ -811,11 +811,11 @@ process{ } withName: 'CAT_MPILEUP_NORMAL' { - ext.prefix = { "${meta.id}.normal.pileup" } + ext.prefix = { "${meta.id}.normal.mpileup" } } withName: 'CAT_MPILEUP_TUMOR' { - ext.prefix = { "${meta.id}.tumor.pileup" } + ext.prefix = { "${meta.id}.tumor.mpileup" } } withName: 'FREEC_SOMATIC'{ diff --git a/tests/test_tools.yml b/tests/test_tools.yml index 4c2c8519dc..38a4efacb4 100644 --- a/tests/test_tools.yml +++ b/tests/test_tools.yml @@ -12,16 +12,16 @@ - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.png - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.bed - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.circos.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup_control.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.mpileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.mpileup_control.cpn - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.p.value.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_BAF.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_CNVs - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_info.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.BedGraph - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_BAF.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_CNVs + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_info.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_ratio.BedGraph + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_ratio.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_sample.cpn - name: Run variant calling on somatic samples with controlfreec without intervals command: nextflow run main.nf -profile test,tools_somatic,docker --tools controlfreec -c ./tests/nextflow.config --no_intervals @@ -38,16 +38,16 @@ - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3_ratio.png - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.bed - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.circos.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.pileup_control.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.mpileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.normal.mpileup_control.cpn - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.p.value.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_BAF.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_CNVs - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_info.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.BedGraph - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_ratio.txt - - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.pileup_sample.cpn + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_BAF.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_CNVs + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_info.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_ratio.BedGraph + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_ratio.txt + - path: results/variant_calling/sample4_vs_sample3/controlfreec/sample4_vs_sample3.tumor.mpileup_sample.cpn - name: Run variant calling on tumor_only sample with controlfreec command: nextflow run main.nf -profile test,tools_tumoronly,docker --tools controlfreec -stub-run @@ -69,7 +69,7 @@ - path: results/variant_calling/sample2/controlfreec/sample2_sample.cpn - path: results/variant_calling/sample2/controlfreec/sample2.bed - path: results/variant_calling/sample2/controlfreec/sample2.circos.txt - - path: results/variant_calling/sample2/controlfreec/sample2.mpileup + - path: results/variant_calling/sample2/controlfreec/sample2.tumor.mpileup - path: results/variant_calling/sample2/controlfreec/sample2.p.value.txt - name: Run variant calling on germline sample with deepvariant From 97b0999317d71f54f24c4465f6aecd7d4e98550f Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Thu, 14 Apr 2022 10:04:02 +0200 Subject: [PATCH 39/45] Update conf/modules.config Co-authored-by: Maxime U. Garcia --- conf/modules.config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index f06c896c5e..3f03365e44 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -824,6 +824,10 @@ process{ inputformat: 'pileup', mateorientation: 'FR' ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ], "general" :[ bedgraphoutput: "TRUE", breakpointthreshold: params.wes ? "1.2" : "0.8", //Values taken from Freec example configs @@ -845,10 +849,6 @@ process{ minimalcoverageperposition: params.cf_mincov ?: "", minimalqualityperposition: params.cf_minqual ?: "", //"shiftinquality": (optional)not set - ], - "control":[ - inputformat: "pileup", - mateorientation: "FR" ] ] } From 33d908f35ef96a65061722f891fbd4cf50e1498c Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 10:19:48 +0200 Subject: [PATCH 40/45] update schema --- nextflow.config | 5 ++- nextflow_schema.json | 73 ++++++++++++++++++++++++++++++-------------- 2 files changed, 52 insertions(+), 26 deletions(-) diff --git a/nextflow.config b/nextflow.config index 1ed130acf2..638b60ef96 100644 --- a/nextflow.config +++ b/nextflow.config @@ -56,10 +56,9 @@ params { cf_coeff = 0.05 // default value for Control-FREEC cf_contamination = 0 // default value for Control-FREEC cf_contamination_adjustment = false // by default we are not using this in Control-FREEC - //cf_ploidy = 2 // you can use 2,3,4 + cf_mincov = 0 // ControlFreec default values + cf_minqual = 0 // ControlFreec default values cf_window = null // by default we are not using this in Control-FREEC - cf_mincov = null - cf_minqual = null generate_gvcf = false // g.vcf are not produced by HaplotypeCaller by default no_strelka_bp = false // Strelka will use Manta candidateSmallIndels if available diff --git a/nextflow_schema.json b/nextflow_schema.json index 3061b9aed9..c22bfa6c30 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,7 +10,11 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": ["input", "outdir", "step"], + "required": [ + "step", + "input", + "outdir" + ], "properties": { "step": { "type": "string", @@ -112,7 +116,6 @@ "type": "boolean", "fa_icon": "fas fa-cut", "description": "Run Trim Galore.", - "default": false, "hidden": true, "help_text": "Use this to perform adapter trimming with Trim Galore.\ncf [Trim Galore User Guide](https://github.com/FelixKrueger/TrimGalore/blob/master/Docs/Trim_Galore_User_Guide.md)" }, @@ -199,7 +202,11 @@ "type": "string", "default": "bwa-mem", "fa_icon": "fas fa-puzzle-piece", - "enum": ["bwa-mem", "bwa-mem2", "dragmap"], + "enum": [ + "bwa-mem", + "bwa-mem2", + "dragmap" + ], "description": "Specify aligner to be used to map reads to reference genome.", "help_text": "> **WARNING** Current indices for `bwa` in AWS iGenomes are not compatible with `bwa-mem2` and `dragmap`.\n> Use `--bwa=false` to have `Sarek` build them automatically.\n\n> **WARNING** BWA-mem2 is in active development\n> Sarek might not be able to require the right amount of resources for it at the moment\n> We recommend to use pre-built indexes", "hidden": true @@ -233,16 +240,12 @@ "default": "", "fa_icon": "fas fa-toolbox", "properties": { - "joint_germline": { - "type": "boolean", - "fa_icon": "fas fa-align-justify", - "description": "Enables GATK4 joint germline variant calling, if also haplotypecaller is selected" - }, - "ascat_ploidy": { + "ploidy": { "type": "number", - "fa_icon": "fas fa-wrench", - "description": "Overwrite ASCAT ploidy", - "help_text": "Requires that `--ascat_purity` is set" + "fa_icon": "fas fa-bacon", + "default": 2, + "hidden": true, + "description": "genome ploidy; In case of doubt, you can set different values and Control-FREEC will select the one that explains most observed CNAs" }, "ascat_purity": { "type": "number", @@ -254,29 +257,46 @@ "type": "number", "default": 0.05, "fa_icon": "fas fa-wrench", - "description": "Overwrite Control-FREEC coefficientOfVariation" + "description": "Overwrite Control-FREEC coefficientOfVariation", + "hidden": true }, "cf_contamination_adjustment": { "type": "boolean", "fa_icon": "fas fa-wrench", - "description": "Overwrite Control-FREEC contaminationAdjustement" + "description": "Overwrite Control-FREEC contaminationAdjustement", + "hidden": true }, "cf_contamination": { "type": "number", "fa_icon": "fas fa-wrench", - "description": "Design known contamination value for Control-FREEC" + "description": "Design known contamination value for Control-FREEC", + "hidden": true }, - "cf_ploidy": { - "type": "integer", - "default": 2, - "fa_icon": "fas fa-wrench", - "description": "Overwrite Control-FREEC ploidy" + "cf_minqual": { + "type": "string", + "default": "0", + "fa_icon": "fas fa-greater-than", + "hidden": true, + "description": "Minimal sequencing quality for a position to be considered in BAF analysis" + }, + "cf_mincov": { + "type": "string", + "default": "0", + "fa_icon": "fas fa-align-center", + "hidden": true, + "description": "Minimal read coverage for a position to be considered in BAF analysis" }, "cf_window": { "type": "number", "fa_icon": "fas fa-wrench", "description": "Overwrite Control-FREEC window size", - "help_text": "It is recommended to use a window size of 0 for exome data" + "help_text": "It is recommended to use a window size of 0 for exome data", + "hidden": true + }, + "joint_germline": { + "type": "boolean", + "fa_icon": "fas fa-align-justify", + "description": "Enables GATK4 joint germline variant calling, if also haplotypecaller is selected" }, "generate_gvcf": { "type": "boolean", @@ -652,7 +672,14 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], + "enum": [ + "symlink", + "rellink", + "link", + "copy", + "copyNoFollow", + "move" + ], "hidden": true }, "email": { @@ -763,4 +790,4 @@ "$ref": "#/definitions/generic_options" } ] -} +} \ No newline at end of file From 134c8de8142eb88fea20b3a4e605678cd3ba4e20 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 10:20:04 +0200 Subject: [PATCH 41/45] update schema --- main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/main.nf b/main.nf index d3ec888913..7858f4c5d3 100644 --- a/main.nf +++ b/main.nf @@ -32,7 +32,6 @@ params.ac_loci_gc = WorkflowMain.getGenomeAttribute(params, 'ac_loci_ params.bwa = WorkflowMain.getGenomeAttribute(params, 'bwa') params.bwamem2 = WorkflowMain.getGenomeAttribute(params, 'bwamem2') params.chr_dir = WorkflowMain.getGenomeAttribute(params, 'chr_dir') -params.chr_length = WorkflowMain.getGenomeAttribute(params, 'chr_length') params.dbsnp = WorkflowMain.getGenomeAttribute(params, 'dbsnp') params.dbsnp_tbi = WorkflowMain.getGenomeAttribute(params, 'dbsnp_tbi') params.dict = WorkflowMain.getGenomeAttribute(params, 'dict') From 42dc81cbb9cfbc370d828465e8a951941dfbf416 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 10:21:14 +0200 Subject: [PATCH 42/45] Fix intend --- subworkflows/local/prepare_genome.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index f066e5cbab..81b1719e61 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -56,7 +56,7 @@ workflow PREPARE_GENOME { } // Gather versions of all tools used - ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) + ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) ch_versions = ch_versions.mix(BWAMEM1_INDEX.out.versions) ch_versions = ch_versions.mix(BWAMEM2_INDEX.out.versions) ch_versions = ch_versions.mix(GATK4_CREATESEQUENCEDICTIONARY.out.versions) From 88767f57adb7f6f0a57b3456ace3873242048030 Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 10:47:50 +0200 Subject: [PATCH 43/45] remove empty workflow --- subworkflows/local/pair_copy_number_calling.nf | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 subworkflows/local/pair_copy_number_calling.nf diff --git a/subworkflows/local/pair_copy_number_calling.nf b/subworkflows/local/pair_copy_number_calling.nf deleted file mode 100644 index e69de29bb2..0000000000 From 1ac969fde9b487213d7c9a592806851d2b4d606d Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 11:11:07 +0200 Subject: [PATCH 44/45] prettier --- nextflow_schema.json | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index c22bfa6c30..b04288a537 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,11 +10,7 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": [ - "step", - "input", - "outdir" - ], + "required": ["step", "input", "outdir"], "properties": { "step": { "type": "string", @@ -202,11 +198,7 @@ "type": "string", "default": "bwa-mem", "fa_icon": "fas fa-puzzle-piece", - "enum": [ - "bwa-mem", - "bwa-mem2", - "dragmap" - ], + "enum": ["bwa-mem", "bwa-mem2", "dragmap"], "description": "Specify aligner to be used to map reads to reference genome.", "help_text": "> **WARNING** Current indices for `bwa` in AWS iGenomes are not compatible with `bwa-mem2` and `dragmap`.\n> Use `--bwa=false` to have `Sarek` build them automatically.\n\n> **WARNING** BWA-mem2 is in active development\n> Sarek might not be able to require the right amount of resources for it at the moment\n> We recommend to use pre-built indexes", "hidden": true @@ -672,14 +664,7 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": [ - "symlink", - "rellink", - "link", - "copy", - "copyNoFollow", - "move" - ], + "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], "hidden": true }, "email": { @@ -790,4 +775,4 @@ "$ref": "#/definitions/generic_options" } ] -} \ No newline at end of file +} From 9d79d707c0a886a8b60fc0ea1500852e82ec1e2b Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 14 Apr 2022 11:20:39 +0200 Subject: [PATCH 45/45] update modules --- modules.json | 31 ++++++------- .../nf-core/modules/gatk4/applyvqsr/main.nf | 23 +++++----- .../nf-core/modules/gatk4/applyvqsr/meta.yml | 8 ++-- .../gatk4/calculatecontamination/main.nf | 11 +++-- .../gatk4/calculatecontamination/meta.yml | 6 +-- .../gatk4/estimatelibrarycomplexity/main.nf | 24 +++++----- .../gatk4/estimatelibrarycomplexity/meta.yml | 3 +- .../modules/gatk4/filtermutectcalls/main.nf | 39 +++++++--------- .../modules/gatk4/filtermutectcalls/meta.yml | 13 +++--- .../gatk4/gatherpileupsummaries/main.nf | 17 +++---- .../gatk4/gatherpileupsummaries/meta.yml | 9 ++-- .../modules/gatk4/genomicsdbimport/main.nf | 37 ++++++++-------- .../modules/gatk4/genotypegvcfs/main.nf | 29 ++++++------ .../modules/gatk4/genotypegvcfs/meta.yml | 20 ++++++--- .../modules/gatk4/haplotypecaller/main.nf | 35 +++++++-------- .../gatk4/learnreadorientationmodel/main.nf | 12 ++--- .../modules/gatk4/mergemutectstats/main.nf | 8 ++-- modules/nf-core/modules/gatk4/mutect2/main.nf | 44 +++++-------------- .../nf-core/modules/gatk4/mutect2/meta.yml | 16 ------- .../modules/gatk4/variantrecalibrator/main.nf | 23 +++++----- 20 files changed, 187 insertions(+), 221 deletions(-) diff --git a/modules.json b/modules.json index 275a69c0f3..352c90fc11 100644 --- a/modules.json +++ b/modules.json @@ -85,7 +85,7 @@ "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/applyvqsr": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/baserecalibrator": { "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" @@ -94,40 +94,40 @@ "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/calculatecontamination": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/createsequencedictionary": { "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/estimatelibrarycomplexity": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/filtermutectcalls": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/gatherbqsrreports": { "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/gatherpileupsummaries": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/genomicsdbimport": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/genotypegvcfs": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/getpileupsummaries": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/haplotypecaller": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/intervallisttobed": { "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/learnreadorientationmodel": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/markduplicates": { "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" @@ -135,17 +135,14 @@ "gatk4/markduplicatesspark": { "git_sha": "e04970b7d249365cafa5a52912f9a28840481c05" }, - "gatk4/markduplicatesspark": { - "git_sha": "e04970b7d249365cafa5a52912f9a28840481c05" - }, "gatk4/mergemutectstats": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/mutect2": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "gatk4/variantrecalibrator": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "409af2f27cbe45109acc7fee70718d2bf20aa449" }, "manta/germline": { "git_sha": "ffedf09b6e84b479c9c901274f74bb33f3777243" @@ -187,7 +184,7 @@ "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/mpileup": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" }, "samtools/stats": { "git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773" diff --git a/modules/nf-core/modules/gatk4/applyvqsr/main.nf b/modules/nf-core/modules/gatk4/applyvqsr/main.nf index 3049aa795e..8b2358093a 100644 --- a/modules/nf-core/modules/gatk4/applyvqsr/main.nf +++ b/modules/nf-core/modules/gatk4/applyvqsr/main.nf @@ -8,15 +8,15 @@ process GATK4_APPLYVQSR { 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" input: - tuple val(meta), path(vcf), path(tbi), path(recal), path(recalidx), path(tranches) - path fasta - path fai - path dict + tuple val(meta), path(vcf), path(vcf_tbi), path(recal), path(recal_index), path(tranches) + path fasta + path fai + path dict output: - tuple val(meta), path("*.vcf.gz") , emit: vcf - tuple val(meta), path("*.tbi") , emit: tbi - path "versions.yml" , emit: versions + tuple val(meta), path("*.vcf.gz"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -24,7 +24,7 @@ process GATK4_APPLYVQSR { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - refCommand = fasta ? "-R ${fasta} " : '' + def reference_command = fasta ? "--reference $fasta" : '' def avail_mem = 3 if (!task.memory) { @@ -34,11 +34,12 @@ process GATK4_APPLYVQSR { } """ gatk --java-options "-Xmx${avail_mem}g" ApplyVQSR \\ - ${refCommand} \\ - -V ${vcf} \\ - -O ${prefix}.vcf.gz \\ + --variant ${vcf} \\ + --output ${prefix}.vcf.gz \\ + $reference_command \\ --tranches-file $tranches \\ --recal-file $recal \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/applyvqsr/meta.yml b/modules/nf-core/modules/gatk4/applyvqsr/meta.yml index 4a99db457e..a05813d1d3 100644 --- a/modules/nf-core/modules/gatk4/applyvqsr/meta.yml +++ b/modules/nf-core/modules/gatk4/applyvqsr/meta.yml @@ -29,20 +29,20 @@ input: type: file description: VCF file to be recalibrated, this should be the same file as used for the first stage VariantRecalibrator. pattern: "*.vcf" - - tbi: + - vcf_tbi: type: file - description: Tbi index for the input vcf file. + description: tabix index for the input vcf file. pattern: "*.vcf.tbi" - recal: type: file description: Recalibration file produced when the input vcf was run through VariantRecalibrator in stage 1. pattern: "*.recal" - - recalidx: + - recal_index: type: file description: Index file for the recalibration file. pattern: ".recal.idx" - tranches: - type: boolean + type: file description: Tranches file produced when the input vcf was run through VariantRecalibrator in stage 1. pattern: ".tranches" - fasta: diff --git a/modules/nf-core/modules/gatk4/calculatecontamination/main.nf b/modules/nf-core/modules/gatk4/calculatecontamination/main.nf index 298739aba3..197fe6c2e8 100644 --- a/modules/nf-core/modules/gatk4/calculatecontamination/main.nf +++ b/modules/nf-core/modules/gatk4/calculatecontamination/main.nf @@ -9,7 +9,6 @@ process GATK4_CALCULATECONTAMINATION { input: tuple val(meta), path(pileup), path(matched) - val segmentout output: tuple val(meta), path('*.contamination.table'), emit: contamination @@ -22,8 +21,8 @@ process GATK4_CALCULATECONTAMINATION { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def matched_command = matched ? " -matched ${matched} " : '' - def segment_command = segmentout ? " -segments ${prefix}.segmentation.table" : '' + def matched_command = matched ? "--matched-normal $matched" : '' + def avail_mem = 3 if (!task.memory) { log.info '[GATK CalculateContamination] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -32,10 +31,10 @@ process GATK4_CALCULATECONTAMINATION { } """ gatk --java-options "-Xmx${avail_mem}g" CalculateContamination \\ - -I $pileup \\ + --input $pileup \\ + --output ${prefix}.contamination.table \\ $matched_command \\ - -O ${prefix}.contamination.table \\ - $segment_command \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/calculatecontamination/meta.yml b/modules/nf-core/modules/gatk4/calculatecontamination/meta.yml index e5e870dc87..7767bd0807 100644 --- a/modules/nf-core/modules/gatk4/calculatecontamination/meta.yml +++ b/modules/nf-core/modules/gatk4/calculatecontamination/meta.yml @@ -32,9 +32,6 @@ input: type: file description: File containing the pileups summary table of a normal sample that matches with the tumor sample specified in pileup argument. This is an optional input. pattern: "*.pileups.table" - - segmentout: - type: boolean - description: specifies whether to output the segmentation table. output: - contamination: @@ -43,7 +40,7 @@ output: pattern: "*.contamination.table" - segmentation: type: file - description: optional output table containing segmentation of tumor minor allele fractions. + description: output table containing segmentation of tumor minor allele fractions (optional) pattern: "*.segmentation.table" - versions: type: file @@ -52,3 +49,4 @@ output: authors: - "@GCJMackenzie" + - "@maxulysse" diff --git a/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/main.nf b/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/main.nf index ba68bf7084..caa34630a0 100644 --- a/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/main.nf +++ b/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/main.nf @@ -8,14 +8,14 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" input: - tuple val(meta), path(cram) - path(fasta) - path(fai) - path(dict) + tuple val(meta), path(input) + path fasta + path fai + path dict output: tuple val(meta), path('*.metrics'), emit: metrics - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,7 +23,7 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def crams = cram.collect(){ x -> "-I ".concat(x.toString()) }.join(" ") + def input_list = input.collect(){"--INPUT $it"}.join(" ") def avail_mem = 3 if (!task.memory) { @@ -32,12 +32,12 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { avail_mem = task.memory.giga } """ - gatk --java-options "-Xmx${avail_mem}g" EstimateLibraryComplexity \ - ${crams} \ - -O ${prefix}.metrics \ - --REFERENCE_SEQUENCE ${fasta} \ - --VALIDATION_STRINGENCY SILENT \ - --TMP_DIR . $args + gatk --java-options "-Xmx${avail_mem}g" EstimateLibraryComplexity \\ + $input_list \\ + --OUTPUT ${prefix}.metrics \\ + --REFERENCE_SEQUENCE ${fasta} \\ + --TMP_DIR . \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/meta.yml b/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/meta.yml index 9f2dee608d..72a679e990 100644 --- a/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/meta.yml +++ b/modules/nf-core/modules/gatk4/estimatelibrarycomplexity/meta.yml @@ -20,7 +20,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - cram: + - input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" @@ -54,3 +54,4 @@ output: authors: - "@FriederikeHanssen" + - "@maxulysse" diff --git a/modules/nf-core/modules/gatk4/filtermutectcalls/main.nf b/modules/nf-core/modules/gatk4/filtermutectcalls/main.nf index 77175c7d95..c1c82e0b5f 100644 --- a/modules/nf-core/modules/gatk4/filtermutectcalls/main.nf +++ b/modules/nf-core/modules/gatk4/filtermutectcalls/main.nf @@ -8,10 +8,10 @@ process GATK4_FILTERMUTECTCALLS { 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" input: - tuple val(meta), path(vcf), path(tbi), path(stats), path(orientationbias), path(segmentation), path(contaminationfile), val(contaminationest) - path fasta - path fai - path dict + tuple val(meta), path(vcf), path(vcf_tbi), path(stats), path(orientationbias), path(segmentation), path(table), val(estimate) + path fasta + path fai + path dict output: tuple val(meta), path("*.vcf.gz") , emit: vcf @@ -26,20 +26,11 @@ process GATK4_FILTERMUTECTCALLS { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def orientationbias_options = '' - if (orientationbias) { - orientationbias_options = '--orientation-bias-artifact-priors ' + orientationbias.join(' --orientation-bias-artifact-priors ') - } - - def segmentation_options = '' - if (segmentation) { - segmentation_options = '--tumor-segmentation ' + segmentation.join(' --tumor-segmentation ') - } + def orientationbias_command = orientationbias ? orientationbias.collect{"--orientation-bias-artifact-priors $it"}.join(' ') : '' + def segmentation_command = segmentation ? segmentation.collect{"--tumor-segmentation $it"}.join(' ') : '' + def estimate_command = estimate ? " --contamination-estimate ${estimate} " : '' + def table_command = table ? " --contamination-table ${table} " : '' - def contamination_options = contaminationest ? " --contamination-estimate ${contaminationest} " : '' - if (contaminationfile) { - contamination_options = '--contamination-table ' + contaminationfile.join(' --contamination-table ') - } def avail_mem = 3 if (!task.memory) { log.info '[GATK FilterMutectCalls] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -48,12 +39,14 @@ process GATK4_FILTERMUTECTCALLS { } """ gatk --java-options "-Xmx${avail_mem}g" FilterMutectCalls \\ - -R $fasta \\ - -V $vcf \\ - $orientationbias_options \\ - $segmentation_options \\ - $contamination_options \\ - -O ${prefix}.vcf.gz \\ + --variant $vcf \\ + --output ${prefix}.vcf.gz \\ + --reference $fasta \\ + $orientationbias_command \\ + $segmentation_command \\ + $estimate_command \\ + $table_command \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/filtermutectcalls/meta.yml b/modules/nf-core/modules/gatk4/filtermutectcalls/meta.yml index 5182c89f66..d1972d7015 100644 --- a/modules/nf-core/modules/gatk4/filtermutectcalls/meta.yml +++ b/modules/nf-core/modules/gatk4/filtermutectcalls/meta.yml @@ -26,9 +26,9 @@ input: type: file description: compressed vcf file of mutect2calls pattern: "*.vcf.gz" - - tbi: + - vcf_tbi: type: file - description: Index of vcf file + description: Tabix index of vcf file pattern: "*vcf.gz.tbi" - stats: type: file @@ -42,13 +42,13 @@ input: type: list description: tables containing segmentation information for input vcf. Optional input. pattern: "*.segmentation.table" - - contaminationfile: + - table: type: list - description: table(s) containing contamination contamination data for input vcf. Optional input, takes priority over contaminationest. + description: table(s) containing contamination data for input vcf. Optional input, takes priority over estimate. pattern: "*.contamination.table" - - contaminationest: + - estimate: type: val - description: estimation of contamination value as a double. Optional input, will only be used if contaminationfile is not specified. + description: estimation of contamination value as a double. Optional input, will only be used if table is not specified. - fasta: type: file description: The reference fasta file @@ -82,3 +82,4 @@ output: authors: - "@GCJMackenzie" + - "@maxulysse" diff --git a/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf b/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf index 52e57127fd..f5e9cf22a0 100644 --- a/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf +++ b/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf @@ -10,11 +10,11 @@ process GATK4_GATHERPILEUPSUMMARIES { input: tuple val(meta), path(pileup) - path dict + path dict output: tuple val(meta), path("*.pileupsummaries.table"), emit: table - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -22,7 +22,7 @@ process GATK4_GATHERPILEUPSUMMARIES { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def input = pileup.collect{ "-I ${it} " }.join(' ') + def input_list = pileup.collect{ "--I $it" }.join(' ') def avail_mem = 3 if (!task.memory) { @@ -31,11 +31,12 @@ process GATK4_GATHERPILEUPSUMMARIES { avail_mem = task.memory.giga } """ - gatk --java-options "-Xmx${avail_mem}g" \ - GatherPileupSummaries \ - --sequence-dictionary ${dict} \ - ${input} \ - -O ${prefix}.pileupsummaries.table + gatk --java-options "-Xmx${avail_mem}g" GatherPileupSummaries \\ + $input_list \\ + --O ${prefix}.pileupsummaries.table \\ + --sequence-dictionary $dict \\ + --tmp-dir . \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml b/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml index 2dc92d554e..823ea36592 100644 --- a/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml +++ b/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml @@ -28,14 +28,15 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - table: + type: file + description: pileup summaries table file + pattern: "*.pileupsummaries.table" - versions: type: file description: File containing software versions pattern: "versions.yml" - - table: - type: file - description: Pileup file - pattern: "*.pileups.table" authors: - "@FriederikeHanssen" + - "@maxulysse" diff --git a/modules/nf-core/modules/gatk4/genomicsdbimport/main.nf b/modules/nf-core/modules/gatk4/genomicsdbimport/main.nf index d2d89ccccc..d2b78899ae 100644 --- a/modules/nf-core/modules/gatk4/genomicsdbimport/main.nf +++ b/modules/nf-core/modules/gatk4/genomicsdbimport/main.nf @@ -8,13 +8,13 @@ process GATK4_GENOMICSDBIMPORT { 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" input: - tuple val(meta), path(vcf), path(tbi), path(intervalfile), val(intervalval), path(wspace) - val run_intlist - val run_updatewspace - val input_map + tuple val(meta), path(vcf), path(tbi), path(interval_file), val(interval_value), path(wspace) + val run_intlist + val run_updatewspace + val input_map output: - tuple val(meta), path("${prefix}") , optional:true, emit: genomicsdb + tuple val(meta), path("$prefix") , optional:true, emit: genomicsdb tuple val(meta), path("$updated_db") , optional:true, emit: updatedb tuple val(meta), path("*.interval_list"), optional:true, emit: intervallist path "versions.yml" , emit: versions @@ -27,22 +27,22 @@ process GATK4_GENOMICSDBIMPORT { prefix = task.ext.prefix ?: "${meta.id}" // settings for running default create gendb mode - inputs_command = input_map ? "--sample-name-map ${vcf[0]}" : "${'-V ' + vcf.join(' -V ')}" - dir_command = "--genomicsdb-workspace-path ${prefix}" - intervals_command = intervalfile ? " -L ${intervalfile} " : " -L ${intervalval} " + input_command = input_map ? "--sample-name-map ${vcf[0]}" : vcf.collect(){"--variant $it"}.join(' ') + + genomicsdb_command = "--genomicsdb-workspace-path ${prefix}" + interval_command = interval_file ? "--intervals ${interval_file}" : "--intervals ${interval_value}" // settings changed for running get intervals list mode if run_intlist is true if (run_intlist) { - inputs_command = '' - dir_command = "--genomicsdb-update-workspace-path ${wspace}" - intervals_command = "--output-interval-list-to-file ${prefix}.interval_list" + genomicsdb_command = "--genomicsdb-update-workspace-path ${wspace}" + interval_command = "--output-interval-list-to-file ${prefix}.interval_list" } - // settings changed for running update gendb mode. inputs_command same as default, update_db forces module to emit the updated gendb + // settings changed for running update gendb mode. input_command same as default, update_db forces module to emit the updated gendb if (run_updatewspace) { - dir_command = "--genomicsdb-update-workspace-path ${wspace}" - intervals_command = '' - updated_db = wspace.toString() + genomicsdb_command = "--genomicsdb-update-workspace-path ${wspace}" + interval_command = '' + updated_db = "${wspace}" } def avail_mem = 3 @@ -53,9 +53,10 @@ process GATK4_GENOMICSDBIMPORT { } """ gatk --java-options "-Xmx${avail_mem}g" GenomicsDBImport \\ - $inputs_command \\ - $dir_command \\ - $intervals_command \\ + $input_command \\ + $genomicsdb_command \\ + $interval_command \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/genotypegvcfs/main.nf b/modules/nf-core/modules/gatk4/genotypegvcfs/main.nf index 4a42ad0a27..0df88d662e 100644 --- a/modules/nf-core/modules/gatk4/genotypegvcfs/main.nf +++ b/modules/nf-core/modules/gatk4/genotypegvcfs/main.nf @@ -10,10 +10,10 @@ process GATK4_GENOTYPEGVCFS { input: tuple val(meta), path(gvcf), path(gvcf_index), path(intervals), path(intervals_index) path fasta - path fasta_index - path fasta_dict + path fai + path dict path dbsnp - path dbsnp_index + path dbsnp_tbi output: tuple val(meta), path("*.vcf.gz"), emit: vcf @@ -26,9 +26,10 @@ process GATK4_GENOTYPEGVCFS { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def dbsnp_options = dbsnp ? "-D ${dbsnp}" : "" - def interval_options = intervals ? "-L ${intervals}" : "" - def gvcf_options = gvcf.name.endsWith(".vcf") || gvcf.name.endsWith(".vcf.gz") ? "$gvcf" : "gendb://$gvcf" + def gvcf_command = gvcf.name.endsWith(".vcf") || gvcf.name.endsWith(".vcf.gz") ? "$gvcf" : "gendb://$gvcf" + def dbsnp_command = dbsnp ? "--dbsnp $dbsnp" : "" + def interval_command = intervals ? "--intervals $intervals" : "" + def avail_mem = 3 if (!task.memory) { log.info '[GATK GenotypeGVCFs] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -36,14 +37,14 @@ process GATK4_GENOTYPEGVCFS { avail_mem = task.memory.giga } """ - gatk --java-options "-Xmx${avail_mem}g" \\ - GenotypeGVCFs \\ - $args \\ - $interval_options \\ - $dbsnp_options \\ - -R $fasta \\ - -V $gvcf_options \\ - -O ${prefix}.vcf.gz + gatk --java-options "-Xmx${avail_mem}g" GenotypeGVCFs \\ + --variant $gvcf_command \\ + --output ${prefix}.vcf.gz \\ + --reference $fasta \\ + $interval_command \\ + $dbsnp_command \\ + --tmp-dir . \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/gatk4/genotypegvcfs/meta.yml b/modules/nf-core/modules/gatk4/genotypegvcfs/meta.yml index f465f8353a..7bec10ed17 100644 --- a/modules/nf-core/modules/gatk4/genotypegvcfs/meta.yml +++ b/modules/nf-core/modules/gatk4/genotypegvcfs/meta.yml @@ -21,10 +21,15 @@ input: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - gvcf: - type: tuple of files + type: file + description: | + gVCF(.gz) file or to a GenomicsDB + pattern: "*.{vcf,vcf.gz}" + - gvcf_index: + type: file description: | - Tuple of gVCF(.gz) file (first) and its index (second) or the path to a GenomicsDB (and empty) - pattern: ["*.{vcf,vcf.gz}", "*.{idx,tbi}"] + index of gvcf file, or empty when providing GenomicsDB + pattern: "*.{idx,tbi}" - intervals: type: file description: Interval file with the genomic regions included in the library (optional) @@ -35,11 +40,11 @@ input: type: file description: Reference fasta file pattern: "*.fasta" - - fasta_index: + - fai: type: file description: Reference fasta index file pattern: "*.fai" - - fasta_dict: + - dict: type: file description: Reference fasta sequence dict file pattern: "*.dict" @@ -47,8 +52,8 @@ input: type: file description: dbSNP VCF file pattern: "*.vcf.gz" - - dbsnp_index: - type: tuple of files + - dbsnp_tbi: + type: file description: dbSNP VCF index file pattern: "*.tbi" @@ -73,3 +78,4 @@ output: authors: - "@santiagorevale" + - "@maxulysse" diff --git a/modules/nf-core/modules/gatk4/haplotypecaller/main.nf b/modules/nf-core/modules/gatk4/haplotypecaller/main.nf index 33871fcffe..57f69ecd3b 100644 --- a/modules/nf-core/modules/gatk4/haplotypecaller/main.nf +++ b/modules/nf-core/modules/gatk4/haplotypecaller/main.nf @@ -9,11 +9,11 @@ process GATK4_HAPLOTYPECALLER { input: tuple val(meta), path(input), path(input_index), path(intervals) - path fasta - path fai - path dict - path dbsnp - path dbsnp_tbi + path fasta + path fai + path dict + path dbsnp + path dbsnp_tbi output: tuple val(meta), path("*.vcf.gz"), emit: vcf @@ -26,25 +26,24 @@ process GATK4_HAPLOTYPECALLER { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def interval_option = intervals ? "-L ${intervals}" : "" - def dbsnp_option = dbsnp ? "-D ${dbsnp}" : "" - def avail_mem = 3 + def dbsnp_command = dbsnp ? "--dbsnp $dbsnp" : "" + def interval_command = intervals ? "--intervals $intervals" : "" + + def avail_mem = 3 if (!task.memory) { log.info '[GATK HaplotypeCaller] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' } else { avail_mem = task.memory.giga } """ - gatk \\ - --java-options "-Xmx${avail_mem}g" \\ - HaplotypeCaller \\ - -R $fasta \\ - -I $input \\ - ${dbsnp_option} \\ - ${interval_option} \\ - -O ${prefix}.vcf.gz \\ - $args \\ - --tmp-dir . + gatk --java-options "-Xmx${avail_mem}g" HaplotypeCaller \\ + --input $input \\ + --output ${prefix}.vcf.gz \\ + --reference $fasta \\ + $dbsnp_command \\ + $interval_command \\ + --tmp-dir . \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/gatk4/learnreadorientationmodel/main.nf b/modules/nf-core/modules/gatk4/learnreadorientationmodel/main.nf index 4771a158e6..717cf21122 100644 --- a/modules/nf-core/modules/gatk4/learnreadorientationmodel/main.nf +++ b/modules/nf-core/modules/gatk4/learnreadorientationmodel/main.nf @@ -20,8 +20,8 @@ process GATK4_LEARNREADORIENTATIONMODEL { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def inputs_list = [] - f1r2.each() { a -> inputs_list.add(" -I " + a) } + def input_list = f1r2.collect{"--input $it"}.join(' ') + def avail_mem = 3 if (!task.memory) { log.info '[GATK LearnReadOrientationModel] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -29,10 +29,10 @@ process GATK4_LEARNREADORIENTATIONMODEL { avail_mem = task.memory.giga } """ - gatk --java-options "-Xmx${avail_mem}g" \\ - LearnReadOrientationModel \\ - ${inputs_list.join(' ')} \\ - -O ${prefix}.tar.gz \\ + gatk --java-options "-Xmx${avail_mem}g" LearnReadOrientationModel \\ + $input_list \\ + --output ${prefix}.tar.gz \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/mergemutectstats/main.nf b/modules/nf-core/modules/gatk4/mergemutectstats/main.nf index bb9f91fbc2..409e06f6a3 100644 --- a/modules/nf-core/modules/gatk4/mergemutectstats/main.nf +++ b/modules/nf-core/modules/gatk4/mergemutectstats/main.nf @@ -9,6 +9,7 @@ process GATK4_MERGEMUTECTSTATS { input: tuple val(meta), path(stats) + output: tuple val(meta), path("*.vcf.gz.stats"), emit: stats path "versions.yml" , emit: versions @@ -19,7 +20,7 @@ process GATK4_MERGEMUTECTSTATS { script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" - def input = stats.collect{ " -stats ${it} "}.join() + def input_list = stats.collect{ "--stats ${it}"}.join(' ') def avail_mem = 3 if (!task.memory) { @@ -29,8 +30,9 @@ process GATK4_MERGEMUTECTSTATS { } """ gatk --java-options "-Xmx${avail_mem}g" MergeMutectStats \\ - ${input} \\ - -output ${meta.id}.vcf.gz.stats \\ + $input_list \\ + --output ${prefix}.vcf.gz.stats \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/mutect2/main.nf b/modules/nf-core/modules/gatk4/mutect2/main.nf index 568d33932f..4a1f576880 100644 --- a/modules/nf-core/modules/gatk4/mutect2/main.nf +++ b/modules/nf-core/modules/gatk4/mutect2/main.nf @@ -8,10 +8,7 @@ process GATK4_MUTECT2 { 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" input: - tuple val(meta) , path(input) , path(input_index) , path(intervals), val(which_norm) - val run_single - val run_pon - val run_mito + tuple val(meta), path(input), path(input_index), path(intervals) path fasta path fai path dict @@ -33,28 +30,10 @@ process GATK4_MUTECT2 { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def panels_command = '' - def normals_command = '' - - def inputs_command = '-I ' + input.join( ' -I ') - def interval = intervals ? "-L ${intervals}" : "" - - if(run_pon) { - panels_command = '' - normals_command = '' - - } else if(run_single) { - panels_command = " --germline-resource $germline_resource --panel-of-normals $panel_of_normals" - normals_command = '' - - } else if(run_mito){ - panels_command = "-L ${intervals} --mitochondria-mode" - normals_command = '' - - } else { - panels_command = " --germline-resource $germline_resource --panel-of-normals $panel_of_normals --f1r2-tar-gz ${prefix}.f1r2.tar.gz" - normals_command = '-normal ' + which_norm.join( ' -normal ') - } + def inputs = input.collect{ "--input $it"}.join(" ") + def interval_command = intervals ? "--intervals $intervals" : "" + def pon_command = panel_of_normals ? "--panel-of-normals $panel_of_normals" : "" + def gr_command = germline_resource ? "--germline-resource $germline_resource" : "" def avail_mem = 3 if (!task.memory) { @@ -64,12 +43,13 @@ process GATK4_MUTECT2 { } """ gatk --java-options "-Xmx${avail_mem}g" Mutect2 \\ - -R ${fasta} \\ - ${inputs_command} \\ - ${normals_command} \\ - ${panels_command} \\ - ${interval} \\ - -O ${prefix}.vcf.gz \\ + $inputs \\ + --output ${prefix}.vcf.gz \\ + --reference $fasta \\ + $pon_command \\ + $gr_command \\ + $interval_command \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/modules/gatk4/mutect2/meta.yml b/modules/nf-core/modules/gatk4/mutect2/meta.yml index 69a4acfe9a..aa0a02aa4e 100644 --- a/modules/nf-core/modules/gatk4/mutect2/meta.yml +++ b/modules/nf-core/modules/gatk4/mutect2/meta.yml @@ -34,22 +34,6 @@ input: type: File/string description: Specify region the tools is run on. pattern: ".{bed,interval_list}/chrM" - - which_norm: - type: list - description: optional list of sample headers contained in the normal sample bam files (these are required for tumor_normal_pair mode) - pattern: "testN" - - run_single: - type: boolean - description: Specify whether or not to run in tumor_single mode instead of tumor_normal_pair mode (will be ignored if run_pon is also true) - pattern: "true/false" - - run_pon: - type: boolean - description: Specify whether or not to run in panel_of_normal mode instead of tumor_normal_pair mode - pattern: "true/false" - - run_mito: - type: boolean - description: Specify whether or not to run in mitochondria-mode instead of tumor_normal_pair mode - pattern: "true/false" - fasta: type: file description: The reference fasta file diff --git a/modules/nf-core/modules/gatk4/variantrecalibrator/main.nf b/modules/nf-core/modules/gatk4/variantrecalibrator/main.nf index 31c9efbdfb..cdcc1221f7 100644 --- a/modules/nf-core/modules/gatk4/variantrecalibrator/main.nf +++ b/modules/nf-core/modules/gatk4/variantrecalibrator/main.nf @@ -8,11 +8,11 @@ process GATK4_VARIANTRECALIBRATOR { 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" input: - tuple val(meta), path(vcf) , path(tbi) - path fasta - path fai - path dict - tuple path(resvcfs), path(restbis), val(reslabels) + tuple val(meta), path(vcf), path(tbi) + tuple path(vcfs), path(tbis), val(labels) + path fasta + path fai + path dict output: tuple val(meta), path("*.recal") , emit: recal @@ -27,8 +27,8 @@ process GATK4_VARIANTRECALIBRATOR { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - refCommand = fasta ? "-R ${fasta} " : '' - resourceCommand = '--resource:' + reslabels.join( ' --resource:') + def reference_command = fasta ? "--reference $fasta " : '' + def resource_command = labels.collect{"--resource:$it"}.join(' ') def avail_mem = 3 if (!task.memory) { @@ -38,11 +38,12 @@ process GATK4_VARIANTRECALIBRATOR { } """ gatk --java-options "-Xmx${avail_mem}g" VariantRecalibrator \\ - ${refCommand} \\ - -V ${vcf} \\ - -O ${prefix}.recal \\ + --variant $vcf \\ + --output ${prefix}.recal \\ --tranches-file ${prefix}.tranches \\ - ${resourceCommand} \\ + $reference_command \\ + $resource_command \\ + --tmp-dir . \\ $args cat <<-END_VERSIONS > versions.yml