diff --git a/modules/local/build_intervals.nf b/modules/local/build_intervals.nf index d235885335..ae35588344 100644 --- a/modules/local/build_intervals.nf +++ b/modules/local/build_intervals.nf @@ -1,19 +1,17 @@ process BUILD_INTERVALS { - tag "${fastaFai}" + tag "${fai}" publishDir params.outdir, mode: params.publish_dir_mode, saveAs: {params.save_reference ? "reference_genome/${it}" : null } input: - path file(fastaFai) + path fai output: - path file("${fastaFai.baseName}.bed") - - //when: !(params.intervals) && !('annotate' in step) && !('controlfreec' in step) + path "${fai.baseName}.bed" script: """ - awk -v FS='\t' -v OFS='\t' '{ print \$1, \"0\", \$2 }' ${fastaFai} > ${fastaFai.baseName}.bed + awk -v FS='\t' -v OFS='\t' '{ print \$1, \"0\", \$2 }' ${fai} > ${fai.baseName}.bed """ } \ No newline at end of file diff --git a/modules/local/create_intervals_bed.nf b/modules/local/create_intervals_bed.nf index a5469fecb1..b073dd5b17 100644 --- a/modules/local/create_intervals_bed.nf +++ b/modules/local/create_intervals_bed.nf @@ -1,4 +1,4 @@ -include { hasExtension } from './functions' +include { has_extension } from './functions' process CREATE_INTERVALS_BED { tag "${intervals}" @@ -7,13 +7,12 @@ process CREATE_INTERVALS_BED { path intervals output: - path ('*.bed')//mode flatten - + path ('*.bed') script: // If the interval file is BED format, the fifth column is interpreted to // contain runtime estimates, which is then used to combine short-running jobs - if (hasExtension(intervals, "bed")) + if (has_extension(intervals, "bed")) """ awk -vFS="\t" '{ t = \$5 # runtime estimate @@ -33,7 +32,7 @@ process CREATE_INTERVALS_BED { print \$0 > name }' ${intervals} """ - else if (hasExtension(intervals, "interval_list")) + else if (has_extension(intervals, "interval_list")) """ grep -v '^@' ${intervals} | awk -vFS="\t" '{ name = sprintf("%s_%d-%d", \$1, \$2, \$3); diff --git a/modules/local/gatk_dict.nf b/modules/local/gatk_dict.nf index 70750d4990..9c811940c0 100644 --- a/modules/local/gatk_dict.nf +++ b/modules/local/gatk_dict.nf @@ -8,7 +8,7 @@ process GATK_CREATE_SEQUENCE_DICTIONARY { path fasta output: - path ("${fasta.baseName}.dict") + path "${fasta.baseName}.dict" script: """ diff --git a/modules/local/get_software_versions.nf b/modules/local/get_software_versions.nf index 1b70ecddbc..8c52334839 100644 --- a/modules/local/get_software_versions.nf +++ b/modules/local/get_software_versions.nf @@ -9,7 +9,7 @@ process GET_SOFTWARE_VERSIONS { } output: - path 'software_versions_mqc.yaml', emit: yml + path "software_versions_mqc.yaml", emit: yml path "software_versions.csv", emit: csv script: diff --git a/modules/local/output_documentation.nf b/modules/local/output_documentation.nf index b6d24b0f58..bd3f9cdd4d 100644 --- a/modules/local/output_documentation.nf +++ b/modules/local/output_documentation.nf @@ -5,14 +5,14 @@ process OUTPUT_DOCUMENTATION { publishDir "${params.outdir}/pipeline_info", mode: params.publish_dir_mode input: - path output_docs - path images + path output_docs + path images output: - path "results_description.html" + path "results_description.html" script: """ - markdown_to_html.py $output_docs -o results_description.html + markdown_to_html.py ${output_docs} -o results_description.html """ } diff --git a/modules/local/trim_galore.nf b/modules/local/trim_galore.nf index fa3e69e8c1..d0bf00ff88 100644 --- a/modules/local/trim_galore.nf +++ b/modules/local/trim_galore.nf @@ -5,19 +5,18 @@ process TRIM_GALORE { publishDir "${params.outdir}/Reports/${idSample}/TrimGalore/${idSample}_${idRun}", mode: params.publish_dir_mode, saveAs: {filename -> - if (filename.indexOf("_fastqc") > 0) "FastQC/$filename" - else if (filename.indexOf("trimming_report.txt") > 0) "logs/$filename" + if (filename.indexOf("_fastqc") > 0) "FastQC/${filename}" + else if (filename.indexOf("trimming_report.txt") > 0) "logs/${filename}" else if (params.save_trimmed) filename else null } input: - tuple val(idPatient), val(idSample), val(idRun), file("${idSample}_${idRun}_R1.fastq.gz"), file("${idSample}_${idRun}_R2.fastq.gz") + tuple val(idPatient), val(idSample), val(idRun), path("${idSample}_${idRun}_R1.fastq.gz"), path("${idSample}_${idRun}_R2.fastq.gz") output: - path "*.{html,zip,txt}", emit: report - tuple idPatient, idSample, idRun, file("${idSample}_${idRun}_R1_val_1.fq.gz"), file("${idSample}_${idRun}_R2_val_2.fq.gz") , emit: trimmed_reads - + path "*.{html,zip,txt}", emit: report + tuple idPatient, idSample, idRun, path("${idSample}_${idRun}_R1_val_1.fq.gz"), path("${idSample}_${idRun}_R2_val_2.fq.gz"), emit: trimmed_reads script: // Calculate number of --cores for TrimGalore based on value of task.cpus diff --git a/modules/nf-core/bwamem2_index.nf b/modules/nf-core/bwamem2_index.nf index 0206509753..661b655b7a 100644 --- a/modules/nf-core/bwamem2_index.nf +++ b/modules/nf-core/bwamem2_index.nf @@ -8,7 +8,7 @@ process BWAMEM2_INDEX { path fasta output: - path("${fasta}.*") + path "${fasta}.*" script: """ diff --git a/modules/nf-core/fastqc.nf b/modules/nf-core/fastqc.nf index b7e58261e1..c5408d179e 100644 --- a/modules/nf-core/fastqc.nf +++ b/modules/nf-core/fastqc.nf @@ -1,5 +1,5 @@ process FASTQC { - label 'FastQC' + label 'FASTQC' label 'cpus_2' tag "${idPatient}-${idRun}" @@ -7,12 +7,11 @@ process FASTQC { publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idSample}_${idRun}", mode: params.publish_dir_mode input: - tuple val(idPatient), val(idSample), val(idRun), file("${idSample}_${idRun}_R1.fastq.gz"), file("${idSample}_${idRun}_R2.fastq.gz") - + tuple val(idPatient), val(idSample), val(idRun), path("${idSample}_${idRun}_R1.fastq.gz"), path("${idSample}_${idRun}_R2.fastq.gz") + output: path "*.{html,zip}" - script: """ fastqc -t 2 -q ${idSample}_${idRun}_R1.fastq.gz ${idSample}_${idRun}_R2.fastq.gz diff --git a/modules/nf-core/htslib_tabix.nf b/modules/nf-core/htslib_tabix.nf index 8786ce63f1..fef5ab0cc9 100644 --- a/modules/nf-core/htslib_tabix.nf +++ b/modules/nf-core/htslib_tabix.nf @@ -4,10 +4,10 @@ process HTSLIB_TABIX { container 'quay.io/biocontainers/tabix:0.2.6--ha92aebf_0' input: - path(vcf) + path vcf output: - path("${vcf}.tbi") + path "${vcf}.tbi" script: """ diff --git a/modules/nf-core/multiqc.nf b/modules/nf-core/multiqc.nf index 5daf608196..a97e8daa17 100644 --- a/modules/nf-core/multiqc.nf +++ b/modules/nf-core/multiqc.nf @@ -9,25 +9,24 @@ process MULTIQC { publishDir "${params.outdir}/multiqc", mode: params.publish_dir_mode input: - path multiqc_config - path mqc_custom_config - // TODO nf-core: Add in log files from your new processes for MultiQC to find! - path fastqc - path trim_galore - path software_versions - val workflow_summary + path fastqc + path multiqc_config + path multiqc_custom_config + path software_versions + path trim_galore + val workflow_summary output: - path "*multiqc_report.html" - path "*_data" - path "multiqc_plots" + path "*multiqc_report.html" + path "*_data" + path "multiqc_plots" script: - rtitle = custom_runName ? "--title \"$custom_runName\"" : '' - rfilename = custom_runName ? "--filename " + custom_runName.replaceAll('\\W','_').replaceAll('_+','_') + "_multiqc_report" : '' - custom_config_file = params.multiqc_config ? "--config $mqc_custom_config" : '' + title = custom_runName ? "--title \"${custom_runName}\"" : '' + filename = custom_runName ? "--filename " + custom_runName.replaceAll('\\W','_').replaceAll('_+','_') + "_multiqc_report" : '' + custom_config_file = params.multiqc_config ? "--config ${multiqc_custom_config}" : '' """ - echo '$workflow_summary' > workflow_summary_mqc.yaml - multiqc -f $rtitle $rfilename $custom_config_file . + echo '${workflow_summary}' > workflow_summary_mqc.yaml + multiqc -f ${title} ${filename} ${custom_config_file} . """ } diff --git a/modules/nf-core/samtools_faidx.nf b/modules/nf-core/samtools_faidx.nf index fcb2e5cb61..b3eb6fa86b 100644 --- a/modules/nf-core/samtools_faidx.nf +++ b/modules/nf-core/samtools_faidx.nf @@ -8,7 +8,7 @@ process SAMTOOLS_FAIDX { path fasta output: - path ("${fasta}.fai") + path "${fasta}.fai" //when: !(params.fasta_fai) && params.fasta && !('annotate' in step) diff --git a/modules/subworkflows/build_indices.nf b/modules/subworkflows/build_indices.nf index 6af688b36a..ae3e4967d2 100644 --- a/modules/subworkflows/build_indices.nf +++ b/modules/subworkflows/build_indices.nf @@ -6,16 +6,16 @@ // And then initialize channels based on params or indexes that were just built - -include { HTSLIB_TABIX as HTSLIB_TABIX_DBSNP } from '../nf-core/htslib_tabix' -include { HTSLIB_TABIX as HTSLIB_TABIX_GERMLINE_RESOURCE } from '../nf-core/htslib_tabix' -include { HTSLIB_TABIX as HTSLIB_TABIX_KNOWN_INDELS } from '../nf-core/htslib_tabix' -include { HTSLIB_TABIX as HTSLIB_TABIX_PON } from '../nf-core/htslib_tabix' +include { BUILD_INTERVALS } from '../local/build_intervals.nf' include { BWAMEM2_INDEX as BWAMEM2_INDEX } from '../nf-core/bwamem2_index.nf' -include { SAMTOOLS_FAIDX as SAMTOOLS_FAIDX } from '../nf-core/samtools_faidx.nf' include { GATK_CREATE_SEQUENCE_DICTIONARY as GATK_CREATE_SEQUENCE_DICTIONARY } from '../local/gatk_dict.nf' -include { BUILD_INTERVALS } from '../local/build_intervals.nf' - +include { + HTSLIB_TABIX as HTSLIB_TABIX_DBSNP; + HTSLIB_TABIX as HTSLIB_TABIX_GERMLINE_RESOURCE; + HTSLIB_TABIX as HTSLIB_TABIX_KNOWN_INDELS; + HTSLIB_TABIX as HTSLIB_TABIX_PON; +} from '../nf-core/htslib_tabix' +include { SAMTOOLS_FAIDX as SAMTOOLS_FAIDX } from '../nf-core/samtools_faidx.nf' workflow BUILD_INDICES{ take: @@ -49,19 +49,17 @@ workflow BUILD_INDICES{ if (!(params.pon_index) && params.pon && ('tnscope' in tools || 'mutect2' in tools)) HTSLIB_TABIX_PON(ch_pon) - if (!(params.intervals) && !('annotate' in step) && !('controlfreec' in step)){ - ch_fai = params.fasta_fai ? Channel.value(file(params.fasta_fai)) : SAMTOOLS_FAIDX.out - ch_fai.dump(tag: 'ch_fai') - BUILD_INTERVALS(ch_fai) + if (!(params.intervals) && !('annotate' in step) && !('controlfreec' in step)) { + BUILD_INTERVALS(SAMTOOLS_FAIDX.out) } emit: bwa_built = BWAMEM2_INDEX.out + dbsnp_tbi = HTSLIB_TABIX_DBSNP.out dictBuilt = GATK_CREATE_SEQUENCE_DICTIONARY.out fai_built = SAMTOOLS_FAIDX.out - dbsnp_tbi = HTSLIB_TABIX_DBSNP.out germline_resource_tbi = HTSLIB_TABIX_GERMLINE_RESOURCE.out + intervalBuilt = BUILD_INTERVALS.out known_indels_tbi = HTSLIB_TABIX_KNOWN_INDELS.out pon_tbi = HTSLIB_TABIX_PON.out - intervalBuilt = BUILD_INTERVALS.out }