diff --git a/modules/bakta.nf b/modules/bakta.nf index 5063bf5..984f3cd 100644 --- a/modules/bakta.nf +++ b/modules/bakta.nf @@ -5,22 +5,22 @@ process bakta { publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}*.{gbk,gff,json,log}", mode: 'copy' input: - tuple val(sample_id), path(assembly) + tuple val(sample_id), path(assembly), val(assembler) output: - tuple val(sample_id), path("${sample_id}_bakta.gbk"), emit: gbk - tuple val(sample_id), path("${sample_id}_bakta.gff"), emit: gff - tuple val(sample_id), path("${sample_id}_bakta.json"), emit: json - tuple val(sample_id), path("${sample_id}_bakta.log"), emit: log - tuple val(sample_id), path("${sample_id}_bakta_provenance.yml"), emit: provenance + tuple val(sample_id), path("${sample_id}_${assembler}_bakta.gbk"), emit: gbk + tuple val(sample_id), path("${sample_id}_${assembler}_bakta.gff"), emit: gff + tuple val(sample_id), path("${sample_id}_${assembler}_bakta.json"), emit: json + tuple val(sample_id), path("${sample_id}_${assembler}_bakta.log"), emit: log + tuple val(sample_id), path("${sample_id}_${assembler}_bakta_provenance.yml"), emit: provenance script: """ - printf -- "- tool_name: bakta\\n tool_version: \$(bakta --version | cut -d ' ' -f 2)\\n" > ${sample_id}_bakta_provenance.yml + printf -- "- tool_name: bakta\\n tool_version: \$(bakta --version | cut -d ' ' -f 2)\\n" > ${sample_id}_${assembler}_bakta_provenance.yml bakta --db ${params.bakta_db} --threads ${task.cpus} --compliant --keep-contig-headers --locus-tag ${sample_id} --prefix "${sample_id}" ${assembly} - cp ${sample_id}.gff3 ${sample_id}_bakta.gff - cp ${sample_id}.gbff ${sample_id}_bakta.gbk - cp ${sample_id}.json ${sample_id}_bakta.json - cp ${sample_id}.log ${sample_id}_bakta.log + cp ${sample_id}.gff3 ${sample_id}_${assembler}_bakta.gff + cp ${sample_id}.gbff ${sample_id}_${assembler}_bakta.gbk + cp ${sample_id}.json ${sample_id}_${assembler}_bakta.json + cp ${sample_id}.log ${sample_id}_${assembler}_bakta.log """ } diff --git a/modules/prokka.nf b/modules/prokka.nf index 2bb15d9..6152429 100644 --- a/modules/prokka.nf +++ b/modules/prokka.nf @@ -2,21 +2,21 @@ process prokka { tag { sample_id } - publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_prokka.{gbk,gff}", mode: 'copy' + publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_${assembler}_prokka.{gbk,gff}", mode: 'copy' input: - tuple val(sample_id), path(assembly) + tuple val(sample_id), path(assembly), val(assembler) output: - tuple val(sample_id), path("${sample_id}_prokka.gbk"), emit: gbk - tuple val(sample_id), path("${sample_id}_prokka.gff"), emit: gff - tuple val(sample_id), path("${sample_id}_prokka_provenance.yml"), emit: provenance + tuple val(sample_id), path("${sample_id}_${assembler}_prokka.gbk"), emit: gbk + tuple val(sample_id), path("${sample_id}_${assembler}_prokka.gff"), emit: gff + tuple val(sample_id), path("${sample_id}_${assembler}_prokka_provenance.yml"), emit: provenance script: """ - printf -- "- tool_name: prokka\\n tool_version: \$(prokka --version 2>&1 | cut -d ' ' -f 2)\\n" > ${sample_id}_prokka_provenance.yml + printf -- "- tool_name: prokka\\n tool_version: \$(prokka --version 2>&1 | cut -d ' ' -f 2)\\n" > ${sample_id}_${assembler}_prokka_provenance.yml prokka --cpus ${task.cpus} --compliant --locustag ${sample_id} --centre "BCCDC-PHL" --prefix "${sample_id}" ${assembly} - cp ${sample_id}/${sample_id}.gbk ${sample_id}_prokka.gbk - cp ${sample_id}/${sample_id}.gff ${sample_id}_prokka.gff + cp ${sample_id}/${sample_id}.gbk ${sample_id}_${assembler}_prokka.gbk + cp ${sample_id}/${sample_id}.gff ${sample_id}_${assembler}_prokka.gff """ } diff --git a/modules/quast.nf b/modules/quast.nf index 68a5ebf..a4d4081 100644 --- a/modules/quast.nf +++ b/modules/quast.nf @@ -2,22 +2,20 @@ process quast { tag { sample_id } - publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_quast.tsv", mode: 'copy' - - cpus 2 + publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_${assembler}_quast.tsv", mode: 'copy' input: - tuple val(sample_id), path(assembly) + tuple val(sample_id), path(assembly), val(assembler) output: - tuple val(sample_id), path("${sample_id}_quast.tsv"), emit: tsv - tuple val(sample_id), path("${sample_id}_quast_provenance.yml"), emit: provenance + tuple val(sample_id), path("${sample_id}_${assembler}_quast.tsv"), val(assembler), emit: tsv + tuple val(sample_id), path("${sample_id}_${assembler}_quast_provenance.yml"), emit: provenance script: """ - printf -- "- tool_name: quast\\n tool_version: \$(quast --version | cut -d ' ' -f 2)\\n" > ${sample_id}_quast_provenance.yml + printf -- "- tool_name: quast\\n tool_version: \$(quast --version | cut -d ' ' -f 2)\\n" > ${sample_id}_${assembler}_quast_provenance.yml quast --threads ${task.cpus} ${assembly} --space-efficient --fast --output-dir ${sample_id} - mv ${sample_id}/transposed_report.tsv ${sample_id}_quast.tsv + mv ${sample_id}/transposed_report.tsv ${sample_id}_${assembler}_quast.tsv """ } @@ -27,16 +25,16 @@ process parse_quast_report { executor 'local' - publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_quast.json", mode: 'copy' + publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_${assembler}_quast.json", mode: 'copy' input: - tuple val(sample_id), path(quast_report) + tuple val(sample_id), path(quast_report), val(assembler) output: - tuple val(sample_id), path("${sample_id}_quast.json") + tuple val(sample_id), path("${sample_id}_${assembler}_quast.json") script: """ - parse_quast_report.py ${quast_report} > ${sample_id}_quast.json + parse_quast_report.py ${quast_report} > ${sample_id}_${assembler}_quast.json """ } diff --git a/modules/shovill.nf b/modules/shovill.nf index 26fcdec..83e8afa 100644 --- a/modules/shovill.nf +++ b/modules/shovill.nf @@ -9,7 +9,7 @@ process shovill { tuple val(sample_id), path(reads_1), path(reads_2) output: - tuple val(sample_id), path("${sample_id}_shovill.fa"), emit: assembly + tuple val(sample_id), path("${sample_id}_shovill.fa"), val("shovill"), emit: assembly tuple val(sample_id), path("${sample_id}_shovill.log"), emit: log tuple val(sample_id), path("${sample_id}_shovill_provenance.yml"), emit: provenance diff --git a/modules/unicycler.nf b/modules/unicycler.nf index fb0f506..73ff173 100644 --- a/modules/unicycler.nf +++ b/modules/unicycler.nf @@ -8,7 +8,7 @@ process unicycler { tuple val(sample_id), path(reads_1), path(reads_2) output: - tuple val(sample_id), path("${sample_id}_unicycler.fa"), emit: assembly + tuple val(sample_id), path("${sample_id}_unicycler.fa"), val("unicycler"), emit: assembly tuple val(sample_id), path("${sample_id}_unicycler.gfa"), emit: assembly_graph tuple val(sample_id), path("${sample_id}_unicycler.log"), emit: log tuple val(sample_id), path("${sample_id}_unicycler_provenance.yml"), emit: provenance diff --git a/nextflow.config b/nextflow.config index ea30110..bf9095f 100644 --- a/nextflow.config +++ b/nextflow.config @@ -35,6 +35,9 @@ profiles { process.shell = ['/bin/bash', '-euo', 'pipefail'] process { + withName: quast { + cpus = 2 + } withName: fastp { cpus = 4 } @@ -57,7 +60,7 @@ process { manifest { author = 'Dan Fornika' name = 'BCCDC-PHL/routine-assembly' - version = '0.2.0' + version = '0.2.1' description = 'BCCDC-PHL Routine Assembly' mainScript = 'main.nf' nextflowVersion = '>=20.01.0'