diff --git a/software/bowtie2/main.nf b/software/bowtie2/main.nf index 467a5761..31c3e149 100644 --- a/software/bowtie2/main.nf +++ b/software/bowtie2/main.nf @@ -8,6 +8,9 @@ process BOWTIE2 { // label 'bigMem' // label 'multiCore' + publishDir "$outdir/bowtie2", + mode: "copy", overwrite: true + input: tuple val(name), path(reads) val (outdir) @@ -18,9 +21,6 @@ process BOWTIE2 { path "*bam", emit: bam path "*stats.txt", emit: stats - publishDir "$outdir/bowtie2", - mode: "copy", overwrite: true - script: if (verbose){ println ("[MODULE] BOWTIE2 ARGS: " + bowtie2_args) diff --git a/software/bwa/index/main.nf b/software/bwa/index/main.nf index 051ed70e..1f67a886 100644 --- a/software/bwa/index/main.nf +++ b/software/bwa/index/main.nf @@ -1,13 +1,13 @@ process bwa_index { - tag {fasta} + tag "$fasta" container 'quay.io/biocontainers/bwa:0.7.17--hed695b0_7' input: - path(fasta) + path fasta output: - path("${fasta}.*") + path "${fasta}.*" script: """ diff --git a/software/bwa/mem/main.nf b/software/bwa/mem/main.nf index 457d86be..780b7293 100644 --- a/software/bwa/mem/main.nf +++ b/software/bwa/mem/main.nf @@ -2,7 +2,7 @@ params.bwa_options = "-M -B 2" params.sequencer = "ILLUMINA" process bwa_mem { - tag {id} + tag "$id" publishDir "${params.outdir}/bwa_mem", mode: 'copy' diff --git a/software/cutadapt/main.nf b/software/cutadapt/main.nf index 52dc2a3a..d0a1141a 100644 --- a/software/cutadapt/main.nf +++ b/software/cutadapt/main.nf @@ -4,10 +4,10 @@ process cutadapt { container 'quay.io/biocontainers/cutadapt:1.16--py27_1' input: - tuple val(sample_id), file(reads) + tuple val(sample_id), path(reads) output: - tuple sample_id, file("trimmed_*.fastq") + tuple sample_id, path("trimmed_*.fastq") script: forward_fq = "trimmed_1.fastq" diff --git a/software/fastq_screen/main.nf b/software/fastq_screen/main.nf index 2eccf31f..d14005be 100644 --- a/software/fastq_screen/main.nf +++ b/software/fastq_screen/main.nf @@ -2,26 +2,26 @@ nextflow.preview.dsl=2 process FASTQ_SCREEN { + publishDir "$outputdir", + mode: "link", overwrite: true + // depending on the number of genomes and the type of genome (e.g. plants!), memory needs to be ample! // label 'bigMem' // label 'multiCore' input: tuple val(name), path(reads) - val (outputdir) + val outputdir // fastq_screen_args are best passed in to the workflow in the following manner: // --fastq_screen_args="--subset 200000 --force" - val (fastq_screen_args) - val (verbose) + val fastq_screen_args + val verbose output: path "*png", emit: png path "*html", emit: html path "*txt", emit: report - publishDir "$outputdir", - mode: "link", overwrite: true - script: println(name) println(reads) diff --git a/software/gatk/dict/main.nf b/software/gatk/dict/main.nf index 9de2e2f8..c6b74c02 100644 --- a/software/gatk/dict/main.nf +++ b/software/gatk/dict/main.nf @@ -4,14 +4,14 @@ process gatk_dict { container 'quay.io/biocontainers/gatk4-spark:4.1.4.1--1' input: - path(fasta) + path fasta output: - path("${fasta.baseName}.dict") + path "${fasta.baseName}.dict" script: """ - gatk --java-options "-Xmx${task.memory.toGiga()}g" \ + gatk --java-options "-Xmx${task.memory.giga}g" \ CreateSequenceDictionary \ --REFERENCE ${fasta} \ --OUTPUT ${fasta.baseName}.dict diff --git a/software/hisat2/main.nf b/software/hisat2/main.nf index 85baa120..fa83e108 100644 --- a/software/hisat2/main.nf +++ b/software/hisat2/main.nf @@ -7,19 +7,19 @@ process HISAT2 { // label 'bigMem' // label 'multiCore' + publishDir "$outdir/hisat2", + mode: "copy", overwrite: true + input: tuple val(name), path(reads) - val (outdir) - val (hisat2_args) - val (verbose) + val outdir + val hisat2_args + val verbose output: path "*bam", emit: bam path "*stats.txt", emit: stats - publishDir "$outdir/hisat2", - mode: "copy", overwrite: true - script: if (verbose){ diff --git a/software/htslib/tabix/main.nf b/software/htslib/tabix/main.nf index e228bb02..ebd08a16 100644 --- a/software/htslib/tabix/main.nf +++ b/software/htslib/tabix/main.nf @@ -1,13 +1,13 @@ process htslib_tabix { - tag {vcf} + tag "$vcf" 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/software/multiqc/main.nf b/software/multiqc/main.nf index ab932a2f..2de75010 100644 --- a/software/multiqc/main.nf +++ b/software/multiqc/main.nf @@ -4,20 +4,20 @@ process MULTIQC { // tag "FastQC - $sample_id" + publishDir "${outdir}/multiqc", + mode: "copy", overwrite: true + input: - path (file) - val (outdir) - val (multiqc_args) + path file + val outdir + val multiqc_args // multiqc_args are best passed into the workflow in the following manner: // --multiqc_args="--exlude STAR --title custom_report_title" - val (verbose) + val verbose output: path "*html", emit: html - publishDir "${outdir}/multiqc", - mode: "copy", overwrite: true - script: if (verbose){ diff --git a/software/samtools/faidx/main.nf b/software/samtools/faidx/main.nf index 458a5ab8..1e0458b8 100644 --- a/software/samtools/faidx/main.nf +++ b/software/samtools/faidx/main.nf @@ -1,13 +1,13 @@ process samtools_faidx { - tag {fasta} + tag "$fasta" container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12' input: - path(fasta) + path fasta output: - path("${fasta}.fai") + path "${fasta}.fai" script: """ diff --git a/software/samtools/index/main.nf b/software/samtools/index/main.nf index 7b065fa9..bf3c5095 100644 --- a/software/samtools/index/main.nf +++ b/software/samtools/index/main.nf @@ -4,7 +4,7 @@ process samtools_index { container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12' input: - path(bam) + path bam output: path "*.bai" diff --git a/software/samtools/sort/main.nf b/software/samtools/sort/main.nf index 34aa1200..2819331f 100644 --- a/software/samtools/sort/main.nf +++ b/software/samtools/sort/main.nf @@ -4,7 +4,7 @@ process samtools_index { container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12' input: - path(bam) + path bam output: path "*.bam.bai" diff --git a/software/shovill/main.nf b/software/shovill/main.nf index 5c6a3ee5..b47975c1 100644 --- a/software/shovill/main.nf +++ b/software/shovill/main.nf @@ -1,16 +1,16 @@ process shovill { - tag { shovill } + tag "$shovill" publishDir "${params.outdir}", pattern: '*.fasta', mode: 'copy' container "quay.io/biocontainers/shovill:1.0.9--0" input: - tuple(sample_id, path(forward), path(reverse)) + tuple val(sample_id), path(forward), path(reverse) output: - path("${sample_id}.fasta") + path "${sample_id}.fasta" script: """ diff --git a/software/tcoffee/main.nf b/software/tcoffee/main.nf index 5d863a7d..8b456e23 100644 --- a/software/tcoffee/main.nf +++ b/software/tcoffee/main.nf @@ -1,13 +1,13 @@ process tcoffee { - tag {fasta} + tag "$fasta" publishDir "${params.outdir}/tcoffee" container 'quay.io/biocontainers/t_coffee:11.0.8--py27pl5.22.0_5' input: - path(fasta) + path "$fasta" output: - path("${fasta}.aln") + path "${fasta}.aln" script: """ diff --git a/software/trim_galore/main.nf b/software/trim_galore/main.nf index eedbe896..5e87a1b4 100644 --- a/software/trim_galore/main.nf +++ b/software/trim_galore/main.nf @@ -18,24 +18,26 @@ process TRIM_GALORE { // container 'quay.io/biocontainers/trim-galore:0.6.5--0' // maybe later // tag "$sample_id" + + // Trimming reports are not generated for e.g. --hardtrim5, --clock etc + // saveAs: {filename -> + // else if (filename.indexOf("trimming_report.txt") > 0) "logs/$filename" + // else filename + // } + + publishDir "${outdir}/trim_galore", + mode: "copy", overwrite: true + input: - tuple val (name), path (reads) - val (outdir) - val (trim_galore_args) - val (verbose) + tuple val(name), path(reads) + val outdir + val trim_galore_args + val verbose output: tuple val(name), path ("*fq.gz"), emit: reads path "*trimming_report.txt", optional: true, emit: report - // Trimming reports are not generated for e.g. --hardtrim5, --clock etc - // saveAs: {filename -> - // else if (filename.indexOf("trimming_report.txt") > 0) "logs/$filename" - // else filename - // } - - publishDir "${outdir}/trim_galore", - mode: "copy", overwrite: true script: if (verbose){