diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4252b0d63..713dd711e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -274,10 +274,6 @@ jobs: - tags: "tabix/tabix" - tags: "tiddit/sv" - tags: "untar" - - tags: "pipeline_sarek" - include: - - tags: "pipeline_sarek" - profile: "test,docker" steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 diff --git a/conf/modules/aligner.config b/conf/modules/aligner.config index 5f44e199b..cd8dfa773 100644 --- a/conf/modules/aligner.config +++ b/conf/modules/aligner.config @@ -46,8 +46,8 @@ process { if (params.save_output_as_bam && ( params.save_mapped || - (params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) && - !(params.tools && params.tools.split(',').contains('sentieon_dedup')) + (params.skip_tools && params.skip_tools.contains('markduplicates')) && + !(params.tools && params.tools.contains('sentieon_dedup')) ) && (meta.size * meta.num_lanes == 1) ) { "mapped/${meta.id}/${it}" } else { null } @@ -60,7 +60,7 @@ process { // However if it's skipped, reads need to be coordinate-sorted // Only name sort if Spark for Markduplicates + duplicate marking is not skipped // Currently SENTIEON_BWAMEM only supports coordinate sorting the reads. - ext.args2 = { params.use_gatk_spark && params.use_gatk_spark.contains('markduplicates') && (!params.skip_tools || (params.skip_tools && !params.skip_tools.split(',').contains('markduplicates'))) ? '-n' : '' } + ext.args2 = { params.use_gatk_spark && params.use_gatk_spark.contains('markduplicates') && (!params.skip_tools || (params.skip_tools && !params.skip_tools.contains('markduplicates'))) ? '-n' : '' } } withName: 'BWAMEM.*_MEM|SENTIEON_BWAMEM' { @@ -75,7 +75,7 @@ process { path: { "${params.outdir}/preprocessing/" }, pattern: "*{bam,bai}", // Only save if (save_output_as_bam AND (no_markduplicates OR save_mapped )) - saveAs: { (params.save_output_as_bam && (params.save_mapped || params.skip_tools && params.skip_tools.split(',').contains('markduplicates'))) ? "mapped/${meta.id}/${it}" : null } + saveAs: { (params.save_output_as_bam && (params.save_mapped || params.skip_tools && params.skip_tools.contains('markduplicates'))) ? "mapped/${meta.id}/${it}" : null } ] } diff --git a/conf/modules/annotate.config b/conf/modules/annotate.config index b02c1b3ef..626a25ee9 100644 --- a/conf/modules/annotate.config +++ b/conf/modules/annotate.config @@ -16,7 +16,7 @@ process { // SNPEFF - if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) { + if (params.tools && (params.tools.contains('snpeff') || params.tools.contains('merge'))) { withName: 'SNPEFF_SNPEFF' { ext.args = { '-nodownload -canon -v' } ext.prefix = { vcf.baseName - '.vcf' + '_snpEff' } @@ -25,14 +25,14 @@ process { mode: params.publish_dir_mode, path: { "${params.outdir}/reports/snpeff/${meta.variantcaller}/${meta.id}/" }, pattern: "*{csv,html,genes.txt}", - saveAs: { params.tools.split(',').contains('snpeff') ? it : null } + saveAs: { params.tools.contains('snpeff') ? it : null } ] ] } } // VEP - if (params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) { + if (params.tools && (params.tools.contains('vep') || params.tools.contains('merge'))) { withName: 'ENSEMBLVEP_VEP' { ext.args = { [ "--stats_file ${vcf.baseName - '.vcf' + '_VEP.ann'}.summary.html", @@ -62,7 +62,7 @@ process { } // BCFTOOLS ANNOTATE - if (params.tools && params.tools.split(',').contains('bcfann')) { + if (params.tools && params.tools.contains('bcfann')) { withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_BCFTOOLS:BCFTOOLS_ANNOTATE' { ext.args = { '--output-type z' } ext.prefix = { input.baseName - '.vcf' + '_BCF.ann' } @@ -75,7 +75,7 @@ process { } // SNPEFF THEN VEP - if (params.tools && params.tools.split(',').contains('merge')) { + if (params.tools && params.tools.contains('merge')) { withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_MERGE:ENSEMBLVEP_VEP' { ext.args = { [ "--stats_file ${vcf.baseName - '.ann.vcf' + '_VEP.ann'}.summary.html", @@ -93,7 +93,7 @@ process { } // ALL ANNOTATION TOOLS - if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge') || params.tools.split(',').contains('bcfann'))) { + if (params.tools && (params.tools.contains('snpeff') || params.tools.contains('vep') || params.tools.contains('merge') || params.tools.contains('bcfann'))) { withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:.*:(TABIX_BGZIPTABIX|TABIX_TABIX)' { ext.prefix = { input.name - '.vcf' } publishDir = [ @@ -104,13 +104,13 @@ process { } } - if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) { + if (params.tools && (params.tools.contains('snpeff') || params.tools.contains('merge'))) { withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_SNPEFF:TABIX_BGZIPTABIX' { publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/annotation/${meta.variantcaller}/${meta.id}/" }, pattern: "*{gz,gz.tbi}", - saveAs: { params.tools.split(',').contains('snpeff') ? it : null } + saveAs: { params.tools.contains('snpeff') ? it : null } ] } } diff --git a/conf/modules/ascat.config b/conf/modules/ascat.config index 4df982427..fedf014e6 100644 --- a/conf/modules/ascat.config +++ b/conf/modules/ascat.config @@ -27,7 +27,7 @@ process { "min_map_qual": params.ascat_min_map_qual ] } - ext.when = { params.tools && params.tools.split(',').contains('ascat') } + ext.when = { params.tools && params.tools.contains('ascat') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/ascat/${meta.id}/" }, diff --git a/conf/modules/cnvkit.config b/conf/modules/cnvkit.config index 2bf455faa..4a2be31bf 100644 --- a/conf/modules/cnvkit.config +++ b/conf/modules/cnvkit.config @@ -17,7 +17,7 @@ process { withName: 'CNVKIT_BATCH' { ext.args = { params.wes ? "--method hybrid --diagram --scatter" : "--method wgs --diagram --scatter" } - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + ext.when = { params.tools && params.tools.contains('cnvkit') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/cnvkit/${meta.id}/" }, @@ -26,7 +26,7 @@ process { } withName: '.*:BAM_VARIANT_CALLING_CNVKIT:CNVKIT_CALL' { - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + ext.when = { params.tools && params.tools.contains('cnvkit') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/cnvkit/${meta.id}/" }, @@ -47,7 +47,7 @@ process { withName: 'CNVKIT_EXPORT' { ext.args = "vcf" ext.prefix = { "${meta.id}.cnvcall" } - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + ext.when = { params.tools && params.tools.contains('cnvkit') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/cnvkit/${meta.id}/" }, @@ -57,7 +57,7 @@ process { withName: 'CNVKIT_GENEMETRICS' { ext.prefix = { "${cnr.baseName}.genemetrics" } - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + ext.when = { params.tools && params.tools.contains('cnvkit') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/cnvkit/${meta.id}/" }, diff --git a/conf/modules/controlfreec.config b/conf/modules/controlfreec.config index b6fa043d0..b4624c860 100644 --- a/conf/modules/controlfreec.config +++ b/conf/modules/controlfreec.config @@ -24,7 +24,7 @@ process { } withName: 'FREEC_.*' { - ext.when = { params.tools && params.tools.split(',').contains('controlfreec') } + ext.when = { params.tools && params.tools.contains('controlfreec') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" }, diff --git a/conf/modules/deepvariant.config b/conf/modules/deepvariant.config index 021990f7f..c730c48ae 100644 --- a/conf/modules/deepvariant.config +++ b/conf/modules/deepvariant.config @@ -18,7 +18,7 @@ process { withName: 'DEEPVARIANT' { ext.args = { params.wes ? "--model_type WES" : "--model_type WGS" } ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('deepvariant') } + ext.when = { params.tools && params.tools.contains('deepvariant') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/" }, diff --git a/conf/modules/download_cache.config b/conf/modules/download_cache.config index 5b36ab4cc..189a1bcf7 100644 --- a/conf/modules/download_cache.config +++ b/conf/modules/download_cache.config @@ -17,7 +17,7 @@ process { // SNPEFF withName: 'SNPEFF_DOWNLOAD' { - ext.when = { params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge')) } + ext.when = { params.tools && (params.tools.contains('snpeff') || params.tools.contains('merge')) } publishDir = [ mode: params.publish_dir_mode, path: { params.outdir_cache ? "${params.outdir_cache}/": "${params.outdir}/cache/" } @@ -26,7 +26,7 @@ process { // VEP withName: 'ENSEMBLVEP_DOWNLOAD' { - ext.when = { params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge')) } + ext.when = { params.tools && (params.tools.contains('vep') || params.tools.contains('merge')) } ext.args = { '--AUTO c --CONVERT --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE' } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/freebayes.config b/conf/modules/freebayes.config index 2c224aeff..4d718f8c6 100644 --- a/conf/modules/freebayes.config +++ b/conf/modules/freebayes.config @@ -28,7 +28,7 @@ process { ext.args = { '--min-alternate-fraction 0.1 --min-mapping-quality 1' } //To make sure no naming conflicts ensure with module BCFTOOLS_SORT & the naming being correct in the output folder ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}.${target_bed.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('freebayes') } + ext.when = { params.tools && params.tools.contains('freebayes') } publishDir = [ enabled: false ] @@ -53,7 +53,7 @@ process { } // PAIR_VARIANT_CALLING - if (params.tools && params.tools.split(',').contains('freebayes')) { + if (params.tools && params.tools.contains('freebayes')) { withName: '.*:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_FREEBAYES:FREEBAYES' { ext.args = { "--pooled-continuous \ --pooled-discrete \ diff --git a/conf/modules/haplotypecaller.config b/conf/modules/haplotypecaller.config index d5b8a3db4..8ec2c0613 100644 --- a/conf/modules/haplotypecaller.config +++ b/conf/modules/haplotypecaller.config @@ -18,7 +18,7 @@ process { withName: 'GATK4_HAPLOTYPECALLER' { ext.args = { params.joint_germline ? "-ERC GVCF" : "" } ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" ) : ( params.joint_germline ? "${meta.id}.haplotypecaller.${intervals.baseName}.g" :"${meta.id}.haplotypecaller.${intervals.baseName}" ) } - ext.when = { params.tools && params.tools.split(',').contains('haplotypecaller') } + ext.when = { params.tools && params.tools.contains('haplotypecaller') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/"}, @@ -53,7 +53,7 @@ process { ] } - if (params.tools && params.tools.split(',').contains('haplotypecaller')) { + if (params.tools && params.tools.contains('haplotypecaller')) { withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_HAPLOTYPECALLER:BAM_MERGE_INDEX_SAMTOOLS:(MERGE_BAM|INDEX_MERGE_BAM)' { ext.prefix = { "${meta.id}.realigned" } publishDir = [ diff --git a/conf/modules/lofreq.config b/conf/modules/lofreq.config index 253b252b3..53d86fd7e 100644 --- a/conf/modules/lofreq.config +++ b/conf/modules/lofreq.config @@ -14,12 +14,12 @@ //LOFREQ process { - if (params.tools && params.tools.split(',').contains('lofreq')) { + if (params.tools && params.tools.contains('lofreq')) { withName: "LOFREQ_CALLPARALLEL" { ext.args = { "--call-indels" } ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.lofreq" : "${meta.id}.lofreq.${intervals.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('lofreq') } + ext.when = { params.tools && params.tools.contains('lofreq') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/" }, diff --git a/conf/modules/manta.config b/conf/modules/manta.config index 71a1c4329..2816a27bc 100644 --- a/conf/modules/manta.config +++ b/conf/modules/manta.config @@ -14,7 +14,7 @@ // MANTA process { - if (params.tools && params.tools.split(',').contains('manta')) { + if (params.tools && params.tools.contains('manta')) { withName: 'MANTA_GERMLINE|MANTA_TUMORONLY|MANTA_SOMATIC' { ext.args = { params.wes ? "--exome" : '' } ext.prefix = { "${meta.id}.manta" } diff --git a/conf/modules/markduplicates.config b/conf/modules/markduplicates.config index 55f29ede5..b130672d6 100644 --- a/conf/modules/markduplicates.config +++ b/conf/modules/markduplicates.config @@ -35,7 +35,7 @@ process { withName: 'NFCORE_SAREK:SAREK:(BAM_MARKDUPLICATES|BAM_MARKDUPLICATES_SPARK):CRAM_QC_MOSDEPTH_SAMTOOLS:SAMTOOLS_STATS' { ext.prefix = { "${meta.id}.md.cram" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('samtools')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/samtools/${meta.id}" }, @@ -48,8 +48,8 @@ process { // Run only when mapping should be saved as CRAM or when no MD is done ext.when = (params.save_mapped && !params.save_output_as_bam) || ( - (params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) && - !(params.tools && params.tools.split(',').contains('sentieon_dedup')) + (params.skip_tools && params.skip_tools.contains('markduplicates')) && + !(params.tools && params.tools.contains('sentieon_dedup')) ) publishDir = [ // Never publish if BAM only should be published @@ -62,7 +62,7 @@ process { withName: 'GATK4_ESTIMATELIBRARYCOMPLEXITY' { ext.prefix = { "${meta.id}.md.cram" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('markduplicates_report')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('markduplicates_report')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/markduplicates/${meta.id}" }, @@ -73,7 +73,7 @@ process { withName: 'GATK4_MARKDUPLICATES' { ext.args = '-REMOVE_DUPLICATES false -VALIDATION_STRINGENCY LENIENT' ext.prefix = { "${meta.id}.md.cram" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('markduplicates')) } publishDir = [ [ mode: params.publish_dir_mode, @@ -85,7 +85,7 @@ process { mode: params.publish_dir_mode, path: { "${params.outdir}/reports/" }, pattern: "*metrics", - saveAs: { !(params.skip_tools && params.skip_tools.split(',').contains('markduplicates_report')) ? "markduplicates/${meta.id}/${it}" : null} + saveAs: { !(params.skip_tools && params.skip_tools.contains('markduplicates_report')) ? "markduplicates/${meta.id}/${it}" : null} ] ] } @@ -113,7 +113,7 @@ process { withName: 'NFCORE_SAREK:SAREK:CRAM_TO_BAM' { ext.when = { params.save_output_as_bam } - if (params.tools && params.tools.split(',').contains('sentieon_dedup')) { + if (params.tools && params.tools.contains('sentieon_dedup')) { ext.prefix = { "${meta.id}.dedup" } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/modules.config b/conf/modules/modules.config index d87f97174..c87f308ca 100644 --- a/conf/modules/modules.config +++ b/conf/modules/modules.config @@ -21,7 +21,7 @@ process { // QC withName: 'FASTQC' { ext.args = { '--quiet' } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('fastqc')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('fastqc')) } publishDir = [ [ path: { "${params.outdir}/reports/fastqc/${meta.id}" }, @@ -42,7 +42,7 @@ process { withName: 'NFCORE_SAREK:SAREK:CRAM_QC_NO_MD:SAMTOOLS_STATS' { ext.prefix = { "${meta.id}.sorted.cram" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('samtools')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/samtools/${meta.id}" }, @@ -60,15 +60,15 @@ process { withName: 'MOSDEPTH' { ext.args = { !params.wes ? "-n --fast-mode --by 500" : ""} ext.prefix = { - if (params.tools && params.tools.split(',').contains('sentieon_dedup')) { + if (params.tools && params.tools.contains('sentieon_dedup')) { "${meta.id}.dedup" - } else if (params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) { + } else if (params.skip_tools && params.skip_tools.contains('markduplicates')) { "${meta.id}.sorted" } else { "${meta.id}.md" } } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('mosdepth')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('mosdepth')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/mosdepth/${meta.id}" }, @@ -76,14 +76,14 @@ process { ] } - if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) { + if (!(params.skip_tools && params.skip_tools.contains('baserecalibrator'))) { withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:MOSDEPTH' { ext.prefix = { "${meta.id}.recal" } } withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:SAMTOOLS_STATS' { ext.prefix = { "${meta.id}.recal.cram" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('samtools')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/samtools/${meta.id}" }, @@ -95,7 +95,7 @@ process { // VCF withName: 'BCFTOOLS_STATS' { ext.prefix = { vcf.baseName - ".vcf" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('bcftools')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('bcftools')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/bcftools/${meta.variantcaller}/${meta.id}/" }, @@ -105,7 +105,7 @@ process { withName: 'VCFTOOLS_.*' { ext.prefix = { variant_file.baseName - ".vcf" } - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('vcftools')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('vcftools')) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/vcftools/${meta.variantcaller}/${meta.id}/" }, diff --git a/conf/modules/mpileup.config b/conf/modules/mpileup.config index dbdfa27fe..0e6b09238 100644 --- a/conf/modules/mpileup.config +++ b/conf/modules/mpileup.config @@ -25,7 +25,7 @@ process { ext.args2 = { '--multiallelic-caller' } ext.args3 = { "-i 'count(GT==\"RR\")==0'" } // only report non homozygous reference variants ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.bcftools" : "${meta.id}_${intervals.baseName}.bcftools" } - ext.when = { params.tools && params.tools.split(',').contains('mpileup') } + ext.when = { params.tools && params.tools.contains('mpileup') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/bcftools/${meta.id}/" }, @@ -44,7 +44,7 @@ process { } withName: 'SAMTOOLS_MPILEUP' { - ext.when = { params.tools && params.tools.split(',').contains('controlfreec') } + ext.when = { params.tools && params.tools.contains('controlfreec') } publishDir = [ enabled: false ] @@ -52,7 +52,7 @@ process { } // PAIR_VARIANT_CALLING - if (params.tools && params.tools.split(',').contains('controlfreec')) { + if (params.tools && params.tools.contains('controlfreec')) { withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_MPILEUP:SAMTOOLS_MPILEUP' { ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.normal" : "${meta.id}_${intervals.simpleName}.normal" } } diff --git a/conf/modules/mutect2.config b/conf/modules/mutect2.config index 5892437dd..da709ff45 100644 --- a/conf/modules/mutect2.config +++ b/conf/modules/mutect2.config @@ -14,12 +14,12 @@ // MUTECT2 process { - if (params.tools && params.tools.split(',').contains('mutect2')) { + if (params.tools && params.tools.contains('mutect2')) { withName: 'GATK4_MUTECT2' { ext.args = { params.ignore_soft_clipped_bases ? "--dont-use-soft-clipped-bases true --f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" : "--f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" } ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('mutect2') } + ext.when = { params.tools && params.tools.contains('mutect2') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/" }, diff --git a/conf/modules/ngscheckmate.config b/conf/modules/ngscheckmate.config index 4d35c9446..a60b22eea 100644 --- a/conf/modules/ngscheckmate.config +++ b/conf/modules/ngscheckmate.config @@ -4,7 +4,7 @@ process { ext.args2 = { '--no-version --ploidy 1 -c' } ext.args3 = { '--no-version' } ext.prefix = { "${meta.id}.ngscheckmate" } - ext.when = { params.tools && params.tools.split(',').contains('ngscheckmate') } + ext.when = { params.tools && params.tools.contains('ngscheckmate') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/ngscheckmate/vcfs" }, diff --git a/conf/modules/prepare_genome.config b/conf/modules/prepare_genome.config index 1f57237be..c69ea3b5d 100644 --- a/conf/modules/prepare_genome.config +++ b/conf/modules/prepare_genome.config @@ -36,7 +36,7 @@ process { } withName: 'CNVKIT_ANTITARGET' { - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + ext.when = { params.tools && params.tools.contains('cnvkit') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference" }, @@ -47,7 +47,7 @@ process { withName: 'CNVKIT_REFERENCE' { ext.prefix = { 'cnvkit' } - ext.when = { params.tools && params.tools.split(',').contains('cnvkit') && !params.cnvkit_reference } + ext.when = { params.tools && params.tools.contains('cnvkit') && !params.cnvkit_reference } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference" }, @@ -77,7 +77,7 @@ process { } withName: 'MSISENSORPRO_SCAN' { - ext.when = { params.tools && params.tools.split(',').contains('msisensorpro') } + ext.when = { params.tools && params.tools.contains('msisensorpro') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/msi" }, @@ -97,7 +97,7 @@ process { } withName: 'TABIX_BCFTOOLS_ANNOTATIONS' { - ext.when = { !params.bcftools_annotations_tbi && params.bcftools_annotations && params.tools && params.tools.split(',').contains('bcfann') } + ext.when = { !params.bcftools_annotations_tbi && params.bcftools_annotations && params.tools && params.tools.contains('bcfann') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/bcfann" }, @@ -107,7 +107,7 @@ process { } withName: 'TABIX_DBSNP' { - ext.when = { !params.dbsnp_tbi && params.dbsnp && ((params.step == "mapping" || params.step == "markduplicates" || params.step == "prepare_recalibration") || params.tools && (params.tools.split(',').contains('controlfreec') || params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope') || params.tools.split(',').contains('mutect2'))) } + ext.when = { !params.dbsnp_tbi && params.dbsnp && ((params.step == "mapping" || params.step == "markduplicates" || params.step == "prepare_recalibration") || params.tools && (params.tools.contains('controlfreec') || params.tools.contains('haplotypecaller') || params.tools.contains('sentieon_haplotyper') || params.tools.contains('sentieon_dnascope') || params.tools.contains('mutect2'))) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/dbsnp" }, @@ -117,7 +117,7 @@ process { } withName: 'TABIX_GERMLINE_RESOURCE' { - ext.when = { !params.germline_resource_tbi && params.germline_resource && params.tools && params.tools.split(',').contains('mutect2') } + ext.when = { !params.germline_resource_tbi && params.germline_resource && params.tools && params.tools.contains('mutect2') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/germline_resource" }, @@ -127,7 +127,7 @@ process { } withName: 'TABIX_KNOWN_INDELS' { - ext.when = { !params.known_indels_tbi && params.known_indels && (params.step == 'mapping' || params.step == "markduplicates" || params.step == 'prepare_recalibration' || (params.tools && (params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope'))) ) } + ext.when = { !params.known_indels_tbi && params.known_indels && (params.step == 'mapping' || params.step == "markduplicates" || params.step == 'prepare_recalibration' || (params.tools && (params.tools.contains('haplotypecaller') || params.tools.contains('sentieon_haplotyper') || params.tools.contains('sentieon_dnascope'))) ) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/known_indels" }, @@ -137,7 +137,7 @@ process { } withName: 'TABIX_KNOWN_SNPS' { - ext.when = { !params.known_snps_tbi && params.known_snps && (params.step == 'mapping' || params.step == "markduplicates" || params.step == 'prepare_recalibration' || (params.tools && (params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') )) ) } + ext.when = { !params.known_snps_tbi && params.known_snps && (params.step == 'mapping' || params.step == "markduplicates" || params.step == 'prepare_recalibration' || (params.tools && (params.tools.contains('haplotypecaller') || params.tools.contains('sentieon_haplotyper') )) ) } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/known_snps" }, @@ -147,7 +147,7 @@ process { } withName: 'TABIX_PON' { - ext.when = { !params.pon_tbi && params.pon && params.tools && params.tools.split(',').contains('mutect2') } + ext.when = { !params.pon_tbi && params.pon && params.tools && params.tools.contains('mutect2') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/pon" }, @@ -157,7 +157,7 @@ process { } withName: 'UNZIP_ALLELES|UNZIP_LOCI|UNZIP_GC|UNZIP_RT' { - ext.when = { params.tools && params.tools.split(',').contains('ascat')} + ext.when = { params.tools && params.tools.contains('ascat')} publishDir = [ enabled: false ] @@ -165,7 +165,7 @@ process { withName: 'UNTAR_CHR_DIR' { ext.prefix = 'chr_dir' - ext.when = { params.tools && params.tools.split(',').contains('controlfreec')} + ext.when = { params.tools && params.tools.contains('controlfreec')} publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/reference/" }, diff --git a/conf/modules/recalibrate.config b/conf/modules/recalibrate.config index 19bbb17d3..fa57c40b1 100644 --- a/conf/modules/recalibrate.config +++ b/conf/modules/recalibrate.config @@ -28,7 +28,7 @@ process { ] } - if ((params.step == 'mapping' || params.step == 'markduplicates'|| params.step == 'prepare_recalibration'|| params.step == 'recalibrate') && (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator')))) { + if ((params.step == 'mapping' || params.step == 'markduplicates'|| params.step == 'prepare_recalibration'|| params.step == 'recalibrate') && (!(params.skip_tools && params.skip_tools.contains('baserecalibrator')))) { withName: 'NFCORE_SAREK:SAREK:(BAM_APPLYBQSR|BAM_APPLYBQSR_SPARK):CRAM_MERGE_INDEX_SAMTOOLS:MERGE_CRAM' { ext.prefix = { "${meta.id}.recal" } ext.when = { meta.num_intervals > 1 } diff --git a/conf/modules/sentieon_dedup.config b/conf/modules/sentieon_dedup.config index df52c3bb9..9dbfd3104 100644 --- a/conf/modules/sentieon_dedup.config +++ b/conf/modules/sentieon_dedup.config @@ -17,7 +17,7 @@ process { withName: 'SENTIEON_DEDUP' { ext.prefix = { "${meta.id}.dedup" } - ext.when = { params.tools && params.tools.split(',').contains('sentieon_dedup') } + ext.when = { params.tools && params.tools.contains('sentieon_dedup') } publishDir = [ [ mode: params.publish_dir_mode, @@ -29,14 +29,14 @@ process { mode: params.publish_dir_mode, path: { "${params.outdir}/reports/" }, pattern: "*{metrics,metrics.multiqc.tsv}", - saveAs: { !(params.skip_tools && params.skip_tools.split(',').contains('sentieon_dedup_report')) ? "sentieon_dedup/${meta.id}/${it}" : null} + saveAs: { !(params.skip_tools && params.skip_tools.contains('sentieon_dedup_report')) ? "sentieon_dedup/${meta.id}/${it}" : null} ] ] } if (params.tools && params.tools.contains('sentieon_dedup')) { withName: 'NFCORE_SAREK:SAREK:BAM_SENTIEON_DEDUP:CRAM_QC_MOSDEPTH_SAMTOOLS:SAMTOOLS_STATS' { - ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) } + ext.when = { !(params.skip_tools && params.skip_tools.contains('samtools')) } ext.prefix = { "${meta.id}.dedup.cram" } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/sentieon_dnascope.config b/conf/modules/sentieon_dnascope.config index 50cf373ea..6100cab50 100644 --- a/conf/modules/sentieon_dnascope.config +++ b/conf/modules/sentieon_dnascope.config @@ -17,7 +17,7 @@ process { withName: 'SENTIEON_DNASCOPE' { ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.dnascope" : "${meta.id}.dnascope.${intervals.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('sentieon_dnascope') } + ext.when = { params.tools && params.tools.contains('sentieon_dnascope') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/"}, diff --git a/conf/modules/sentieon_haplotyper.config b/conf/modules/sentieon_haplotyper.config index c2b958222..66bf02b7e 100644 --- a/conf/modules/sentieon_haplotyper.config +++ b/conf/modules/sentieon_haplotyper.config @@ -17,7 +17,7 @@ process { withName: 'SENTIEON_HAPLOTYPER' { ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.haplotyper" : "${meta.id}.haplotyper.${intervals.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('sentieon_haplotyper') } + ext.when = { params.tools && params.tools.contains('sentieon_haplotyper') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/"}, diff --git a/conf/modules/strelka.config b/conf/modules/strelka.config index badffb5df..1e305275b 100644 --- a/conf/modules/strelka.config +++ b/conf/modules/strelka.config @@ -18,7 +18,7 @@ process { withName: 'STRELKA_.*' { ext.args = { params.wes ? '--exome' : '' } ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.strelka" : "${meta.id}.strelka.${target_bed.baseName}" } - ext.when = { params.tools && params.tools.split(',').contains('strelka') } + ext.when = { params.tools && params.tools.contains('strelka') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/" }, diff --git a/conf/modules/tiddit.config b/conf/modules/tiddit.config index 335ecf095..da04d5deb 100644 --- a/conf/modules/tiddit.config +++ b/conf/modules/tiddit.config @@ -18,7 +18,7 @@ process { withName: 'TIDDIT_SV' { ext.args = { bwa_index ? '' : '--skip_assembly' } ext.prefix = { "${meta.id}.tiddit" } - ext.when = { params.tools && params.tools.split(',').contains('tiddit') } + ext.when = { params.tools && params.tools.contains('tiddit') } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/tiddit/${meta.id}/" }, @@ -36,7 +36,7 @@ process { } // PAIR_VARIANT_CALLING - if (params.tools && params.tools.split(',').contains('tiddit')) { + if (params.tools && params.tools.contains('tiddit')) { withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_TIDDIT:TIDDIT_NORMAL:TABIX_BGZIP_TIDDIT_SV' { ext.prefix = {"${meta.id}.tiddit.normal"} } diff --git a/workflows/sarek/main.nf b/workflows/sarek/main.nf index 1ed71783f..986895ee6 100644 --- a/workflows/sarek/main.nf +++ b/workflows/sarek/main.nf @@ -204,7 +204,7 @@ workflow SAREK { // Additional options to be set up // QC - if (!(params.skip_tools && params.skip_tools.split(',').contains('fastqc'))) { + if (!(params.skip_tools && params.skip_tools.contains('fastqc'))) { FASTQC(input_fastq) reports = reports.mix(FASTQC.out.zip.collect{ meta, logs -> logs }) @@ -337,8 +337,8 @@ workflow SAREK { if ( params.save_mapped || ( - (params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) && - !(params.tools && params.tools.split(',').contains('sentieon_dedup')) + (params.skip_tools && params.skip_tools.contains('markduplicates')) && + !(params.tools && params.tools.contains('sentieon_dedup')) ) ) { // bams are merged (when multiple lanes from the same sample), indexed and then converted to cram @@ -380,8 +380,8 @@ workflow SAREK { if ( params.skip_tools && - params.skip_tools.split(',').contains('markduplicates') && - !(params.tools && params.tools.split(',').contains('sentieon_dedup')) + params.skip_tools.contains('markduplicates') && + !(params.tools && params.tools.contains('sentieon_dedup')) ) { if (params.step == 'mapping') { cram_skip_markduplicates = BAM_TO_CRAM_MAPPING.out.cram.join(BAM_TO_CRAM_MAPPING.out.crai, failOnDuplicate: true, failOnMismatch: true) @@ -419,7 +419,7 @@ workflow SAREK { // Gather used softwares versions versions = versions.mix(BAM_MARKDUPLICATES_SPARK.out.versions) - } else if (params.tools && params.tools.split(',').contains('sentieon_dedup')) { + } else if (params.tools && params.tools.contains('sentieon_dedup')) { crai_for_markduplicates = params.step == 'mapping' ? bai_mapped : input_sample.map{ meta, input, index -> [ meta, index ] } BAM_SENTIEON_DEDUP( cram_for_markduplicates, @@ -466,7 +466,7 @@ workflow SAREK { // CSV should be written for the file actually out, either CRAM or BAM // Create CSV to restart from this step - csv_subfolder = (params.tools && params.tools.split(',').contains('sentieon_dedup')) ? 'sentieon_dedup' : 'markduplicates' + csv_subfolder = (params.tools && params.tools.contains('sentieon_dedup')) ? 'sentieon_dedup' : 'markduplicates' if (params.save_output_as_bam) CHANNEL_MARKDUPLICATES_CREATE_CSV(CRAM_TO_BAM.out.bam.join(CRAM_TO_BAM.out.bai, failOnDuplicate: true, failOnMismatch: true), csv_subfolder, params.outdir, params.save_output_as_bam) else CHANNEL_MARKDUPLICATES_CREATE_CSV(ch_md_cram_for_restart, csv_subfolder, params.outdir, params.save_output_as_bam) @@ -508,7 +508,7 @@ workflow SAREK { } // STEP 3: Create recalibration tables - if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) { + if (!(params.skip_tools && params.skip_tools.contains('baserecalibrator'))) { ch_table_bqsr_no_spark = Channel.empty() ch_table_bqsr_spark = Channel.empty() @@ -589,7 +589,7 @@ workflow SAREK { .map{ meta, cram, crai, table -> [ meta + [data_type: "cram"], cram, crai, table ]} } - if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) { + if (!(params.skip_tools && params.skip_tools.contains('baserecalibrator'))) { cram_variant_calling_no_spark = Channel.empty() cram_variant_calling_spark = Channel.empty() @@ -675,7 +675,7 @@ workflow SAREK { CRAM_SAMPLEQC(cram_variant_calling, ngscheckmate_bed, fasta, - params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'), + params.skip_tools && params.skip_tools.contains('baserecalibrator'), intervals_for_preprocessing) if (params.tools) { @@ -766,7 +766,7 @@ workflow SAREK { known_sites_snps_tbi, known_snps_vqsr, params.joint_germline, - params.skip_tools && params.skip_tools.split(',').contains('haplotypecaller_filter'), // true if filtering should be skipped + params.skip_tools && params.skip_tools.contains('haplotypecaller_filter'), // true if filtering should be skipped params.sentieon_haplotyper_emit_mode, params.sentieon_dnascope_emit_mode, params.sentieon_dnascope_pcr_indel_model, @@ -866,7 +866,7 @@ workflow SAREK { // ANNOTATE if (params.step == 'annotate') vcf_to_annotate = input_sample - if (params.tools.split(',').contains('merge') || params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('vep')|| params.tools.split(',').contains('bcfann')) { + if (params.tools.contains('merge') || params.tools.contains('snpeff') || params.tools.contains('vep')|| params.tools.contains('bcfann')) { vep_fasta = (params.vep_include_fasta) ? fasta : [[id: 'null'], []] @@ -895,7 +895,7 @@ workflow SAREK { // Collate and save software versions // version_yaml = Channel.empty() - if (!(params.skip_tools && params.skip_tools.split(',').contains('versions'))) { + if (!(params.skip_tools && params.skip_tools.contains('versions'))) { version_yaml = softwareVersionsToYAML(versions) .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_sarek_software_mqc_versions.yml', sort: true, newLine: true) } @@ -903,7 +903,7 @@ workflow SAREK { // // MODULE: MultiQC // - if (!(params.skip_tools && params.skip_tools.split(',').contains('multiqc'))) { + if (!(params.skip_tools && params.skip_tools.contains('multiqc'))) { ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty()