From e7be756fae827263dfdb2b9453fa42a352d38737 Mon Sep 17 00:00:00 2001 From: Oliver Schwengers Date: Thu, 14 Nov 2024 16:08:07 +0100 Subject: [PATCH] add bakta_io and bakta_plot to test genomes NF script --- test/test-genomes.nf | 50 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/test/test-genomes.nf b/test/test-genomes.nf index 5403fb3a..283b0938 100644 --- a/test/test-genomes.nf +++ b/test/test-genomes.nf @@ -59,12 +59,60 @@ process bakta { tuple path('assembly.fna'), val(accession), val(genus), val(species), val(strain), val(complete) from chBakta output: + tuple val(accession), path("${accession}.json.gz") into chBaktaIO, chBaktaPlot path("${accession}.*") into chFinalBakta - publishDir pattern: "${accession}.*", path: "${pathOutput}/${accession}/", mode: 'copy' + publishDir pattern: "${accession}.*", path: "${pathOutput}/${accession}/annotation/", mode: 'copy' script: completeOption = complete ? '--complete' : '' """ ${baseDir}/../bin/bakta --db ${pathDb} --verbose --prefix ${accession} --genus ${genus} --species "${species}" --strain "${strain}" --keep-contig-headers --threads ${task.cpus} --force ${completeOption} assembly.fna + gzip -k ${accession}.json + """ +} + +process bakta_io { + + tag "${accession}" + + errorStrategy 'retry' + maxRetries 3 + cpus 1 + memory 1.GB + conda "${baseDir}/../environment.yml" + + input: + tuple val(accession), path('genome.json.gz') from chBaktaIO + + output: + path("${accession}.*") into chFinalBaktaIO + publishDir pattern: "${accession}.*", path: "${pathOutput}/${accession}/io", mode: 'copy' + + script: + """ + ${baseDir}/../bin/bakta_io --verbose --prefix ${accession} --force genome.json.gz + """ +} + +process bakta_plot { + + tag "${accession}" + + errorStrategy 'retry' + maxRetries 3 + cpus 1 + memory 1.GB + conda "${baseDir}/../environment.yml" + + input: + tuple val(accession), path('genome.json.gz') from chBaktaPlot + + output: + path("${accession}.*") into chFinalBaktaPlot + publishDir pattern: "${accession}.*", path: "${pathOutput}/${accession}/plot", mode: 'copy' + + script: + """ + ${baseDir}/../bin/bakta_plot --verbose --sequences all --type cog --prefix ${accession} --force genome.json.gz """ }