From 525a52d4e28ea01746296fef38601232bc3977b9 Mon Sep 17 00:00:00 2001 From: Richard de Borja Date: Mon, 17 Oct 2022 09:30:32 -0400 Subject: [PATCH] added dsl2 fixes including syntax updates --- main.nf | 2 +- modules/artic.nf | 20 ++++++++++---------- modules/illumina.nf | 30 +++++++++++++++--------------- modules/out.nf | 6 +++--- modules/qc.nf | 2 +- modules/upload.nf | 2 +- workflows/articNcovNanopore.nf | 2 +- workflows/illuminaNcov.nf | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/main.nf b/main.nf index 12d77382..d0378852 100644 --- a/main.nf +++ b/main.nf @@ -1,7 +1,7 @@ #!/usr/bin/env nextflow // enable dsl2 -nextflow.preview.dsl = 2 +nextflow.enable.dsl=2 // include modules include {printHelp} from './modules/help.nf' diff --git a/modules/artic.nf b/modules/artic.nf index 2736c578..9793dfb6 100644 --- a/modules/artic.nf +++ b/modules/artic.nf @@ -54,10 +54,10 @@ process articMinIONMedaka { output: file("${sampleName}*") - tuple sampleName, file("${sampleName}.primertrimmed.rg.sorted.bam"), emit: ptrim - tuple sampleName, file("${sampleName}.sorted.bam"), emit: mapped - tuple sampleName, file("${sampleName}.consensus.fasta"), emit: consensus_fasta - tuple sampleName, file("${sampleName}.pass.vcf.gz"), emit: vcf + tuple val(sampleName), file("${sampleName}.primertrimmed.rg.sorted.bam"), emit: ptrim + tuple val(sampleName), file("${sampleName}.sorted.bam"), emit: mapped + tuple val(sampleName), file("${sampleName}.consensus.fasta"), emit: consensus_fasta + tuple val(sampleName), file("${sampleName}.pass.vcf.gz"), emit: vcf script: // Make an identifier from the fastq filename @@ -102,10 +102,10 @@ process articMinIONNanopolish { output: file("${sampleName}*") - tuple sampleName, file("${sampleName}.primertrimmed.rg.sorted.bam"), emit: ptrim - tuple sampleName, file("${sampleName}.sorted.bam"), emit: mapped - tuple sampleName, file("${sampleName}.consensus.fasta"), emit: consensus_fasta - tuple sampleName, file("${sampleName}.pass.vcf.gz"), emit: vcf + tuple val(sampleName), file("${sampleName}.primertrimmed.rg.sorted.bam"), emit: ptrim + tuple val(sampleName), file("${sampleName}.sorted.bam"), emit: mapped + tuple val(sampleName), file("${sampleName}.consensus.fasta"), emit: consensus_fasta + tuple val(sampleName), file("${sampleName}.pass.vcf.gz"), emit: vcf script: // Make an identifier from the fastq filename @@ -144,10 +144,10 @@ process articRemoveUnmappedReads { cpus 1 input: - tuple(sampleName, path(bamfile)) + tuple(val(sampleName), path(bamfile)) output: - tuple( sampleName, file("${sampleName}.mapped.sorted.bam")) + tuple( val(sampleName), file("${sampleName}.mapped.sorted.bam")) script: """ diff --git a/modules/illumina.nf b/modules/illumina.nf index 47727fc0..b5bcc6c8 100644 --- a/modules/illumina.nf +++ b/modules/illumina.nf @@ -1,8 +1,8 @@ process readTrimming { /** * Trims paired fastq using trim_galore (https://github.com/FelixKrueger/TrimGalore) - * @input tuple(sampleName, path(forward), path(reverse)) - * @output trimgalore_out tuple(sampleName, path("*_val_1.fq.gz"), path("*_val_2.fq.gz")) + * @input tuple(val(sampleName), path(forward), path(reverse)) + * @output trimgalore_out tuple(val(sampleName), path("*_val_1.fq.gz"), path("*_val_2.fq.gz")) */ tag { sampleName } @@ -12,10 +12,10 @@ process readTrimming { cpus 2 input: - tuple(sampleName, path(forward), path(reverse)) + tuple(val(sampleName), path(forward), path(reverse)) output: - tuple(sampleName, path("*_val_1.fq.gz"), path("*_val_2.fq.gz")) optional true + tuple(val(sampleName), path("*_val_1.fq.gz"), path("*_val_2.fq.gz")) optional true script: """ @@ -62,10 +62,10 @@ process readMapping { publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.sorted.bam", mode: 'copy' input: - tuple sampleName, path(forward), path(reverse), path(ref), path("*") + tuple val(sampleName), path(forward), path(reverse), path(ref), path("*") output: - tuple(sampleName, path("${sampleName}.sorted.bam")) + tuple(val(sampleName), path("${sampleName}.sorted.bam")) script: """ @@ -82,11 +82,11 @@ process trimPrimerSequences { publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.mapped.primertrimmed.sorted.bam", mode: 'copy' input: - tuple sampleName, path(bam), path(bedfile) + tuple val(sampleName), path(bam), path(bedfile) output: - tuple sampleName, path("${sampleName}.mapped.bam"), emit: mapped - tuple sampleName, path("${sampleName}.mapped.primertrimmed.sorted.bam" ), emit: ptrim + tuple val(sampleName), path("${sampleName}.mapped.bam"), emit: mapped + tuple val(sampleName), path("${sampleName}.mapped.primertrimmed.sorted.bam" ), emit: ptrim script: if (params.allowNoprimer){ @@ -128,10 +128,10 @@ process callVariants { publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.variants.tsv", mode: 'copy' input: - tuple(sampleName, path(bam), path(ref)) + tuple(val(sampleName), path(bam), path(ref)) output: - tuple sampleName, path("${sampleName}.variants.tsv"), emit: variants + tuple val(sampleName), path("${sampleName}.variants.tsv"), emit: variants script: """ @@ -147,10 +147,10 @@ process makeConsensus { publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.primertrimmed.consensus.fa", mode: 'copy' input: - tuple(sampleName, path(bam)) + tuple(val(sampleName), path(bam)) output: - tuple(sampleName, path("${sampleName}.primertrimmed.consensus.fa")) + tuple(val(sampleName), path("${sampleName}.primertrimmed.consensus.fa")) script: """ @@ -169,10 +169,10 @@ process cramToFastq { */ input: - tuple sampleName, file(cram) + tuple val(sampleName), file(cram) output: - tuple sampleName, path("${sampleName}_1.fastq.gz"), path("${sampleName}_2.fastq.gz") + tuple val(sampleName), path("${sampleName}_1.fastq.gz"), path("${sampleName}_2.fastq.gz") script: """ diff --git a/modules/out.nf b/modules/out.nf index 29426f33..bd97281c 100644 --- a/modules/out.nf +++ b/modules/out.nf @@ -11,11 +11,11 @@ process bamToCram { publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${bam.baseName}.cram.crai", mode: 'copy' input: - tuple(sampleName, path(bam), path(ref)) + tuple(val(sampleName), path(bam), path(ref)) output: - tuple sampleName, path("${bam.baseName}.cram"), emit: cramed - tuple sampleName, path("${bam.baseName}.cram.crai"), emit: cramedidx + tuple val(sampleName), path("${bam.baseName}.cram"), emit: cramed + tuple val(sampleName), path("${bam.baseName}.cram.crai"), emit: cramedidx script: """ diff --git a/modules/qc.nf b/modules/qc.nf index 923d9809..e741200e 100644 --- a/modules/qc.nf +++ b/modules/qc.nf @@ -4,7 +4,7 @@ process makeQCCSV { publishDir "${params.outdir}/qc_plots", pattern: "${sampleName}.depth.png", mode: 'copy' input: - tuple sampleName, path(bam), path(fasta), path(ref) + tuple val(sampleName), path(bam), path(fasta), path(ref) output: path "${params.prefix}.${sampleName}.qc.csv", emit: csv diff --git a/modules/upload.nf b/modules/upload.nf index ae6a9c84..3aff534c 100644 --- a/modules/upload.nf +++ b/modules/upload.nf @@ -4,7 +4,7 @@ process collateSamples { publishDir "${params.outdir}/qc_pass_climb_upload/${params.prefix}", pattern: "${sampleName}", mode: 'copy' input: - tuple(sampleName, path(bam), path(fasta)) + tuple(val(sampleName), path(bam), path(fasta)) output: path("${sampleName}") diff --git a/workflows/articNcovNanopore.nf b/workflows/articNcovNanopore.nf index 6dbaf84e..c2e799a5 100644 --- a/workflows/articNcovNanopore.nf +++ b/workflows/articNcovNanopore.nf @@ -1,7 +1,7 @@ // ARTIC ncov workflow // enable dsl2 -nextflow.preview.dsl = 2 +nextflow.enable.dsl=2 // import modules include {articDownloadScheme} from '../modules/artic.nf' diff --git a/workflows/illuminaNcov.nf b/workflows/illuminaNcov.nf index dbc8fb5d..2c9f5601 100644 --- a/workflows/illuminaNcov.nf +++ b/workflows/illuminaNcov.nf @@ -1,7 +1,7 @@ #!/usr/bin/env nextflow // enable dsl2 -nextflow.preview.dsl = 2 +nextflow.enable.dsl=2 // import modules include {articDownloadScheme } from '../modules/artic.nf'