Skip to content

Commit

Permalink
add bakta_io and bakta_plot to test genomes NF script
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwengers committed Nov 14, 2024
1 parent 46aa029 commit e7be756
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion test/test-genomes.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
}

0 comments on commit e7be756

Please sign in to comment.