|
| 1 | +process ANTISMASH_ANTISMASH { |
| 2 | + tag "${meta.id}" |
| 3 | + label 'process_medium' |
| 4 | + |
| 5 | + conda "${moduleDir}/environment.yml" |
| 6 | + container "nf-core/antismash:8.0.1--pyhdfd78af_0" |
| 7 | + |
| 8 | + input: |
| 9 | + tuple val(meta), path(sequence_input) |
| 10 | + path databases |
| 11 | + path gff |
| 12 | + |
| 13 | + output: |
| 14 | + tuple val(meta), path("${prefix}/{css,images,js}") , emit: html_accessory_files |
| 15 | + tuple val(meta), path("${prefix}/*.gbk") , emit: gbk_input |
| 16 | + tuple val(meta), path("${prefix}/*.json") , emit: json_results |
| 17 | + tuple val(meta), path("${prefix}/*.log") , emit: log |
| 18 | + tuple val(meta), path("${prefix}/*.zip") , emit: zip |
| 19 | + tuple val(meta), path("${prefix}/index.html") , emit: html |
| 20 | + tuple val(meta), path("${prefix}/regions.js") , emit: json_sideloading |
| 21 | + tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , emit: clusterblast_file , optional: true |
| 22 | + tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html"), emit: knownclusterblast_html , optional: true |
| 23 | + tuple val(meta), path("${prefix}/knownclusterblast/") , emit: knownclusterblast_dir , optional: true |
| 24 | + tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt") , emit: knownclusterblast_txt , optional: true |
| 25 | + tuple val(meta), path("${prefix}/svg/clusterblast*.svg") , emit: svg_files_clusterblast , optional: true |
| 26 | + tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg") , emit: svg_files_knownclusterblast, optional: true |
| 27 | + tuple val(meta), path("${prefix}/*region*.gbk") , emit: gbk_results , optional: true |
| 28 | + tuple val(meta), path("${prefix}/clusterblastoutput.txt") , emit: clusterblastoutput , optional: true |
| 29 | + tuple val(meta), path("${prefix}/knownclusterblastoutput.txt") , emit: knownclusterblastoutput , optional: true |
| 30 | + path "versions.yml" , emit: versions |
| 31 | + |
| 32 | + when: |
| 33 | + task.ext.when == null || task.ext.when |
| 34 | + |
| 35 | + script: |
| 36 | + def args = task.ext.args ?: '' |
| 37 | + prefix = task.ext.prefix ?: "${meta.id}" |
| 38 | + gff_flag = gff ? "--genefinding-gff3 ${gff}" : "" |
| 39 | + |
| 40 | + """ |
| 41 | + ## We specifically do not include on-the-fly annotations (--genefinding-tool none) as |
| 42 | + ## this should be run as a separate module for versioning purposes |
| 43 | +
|
| 44 | + antismash \\ |
| 45 | + ${args} \\ |
| 46 | + ${gff_flag} \\ |
| 47 | + -c ${task.cpus} \\ |
| 48 | + --output-dir ${prefix} \\ |
| 49 | + --output-basename ${prefix} \\ |
| 50 | + --genefinding-tool none \\ |
| 51 | + --logfile ${prefix}/${prefix}.log \\ |
| 52 | + --databases ${databases} \\ |
| 53 | + ${sequence_input} |
| 54 | +
|
| 55 | + cat <<-END_VERSIONS > versions.yml |
| 56 | + "${task.process}": |
| 57 | + antismash: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g') |
| 58 | + END_VERSIONS |
| 59 | + """ |
| 60 | + |
| 61 | + stub: |
| 62 | + prefix = task.ext.prefix ?: "${meta.id}" |
| 63 | + """ |
| 64 | + mkdir -p ${prefix}/css |
| 65 | + mkdir ${prefix}/images |
| 66 | + mkdir ${prefix}/js |
| 67 | + touch ${prefix}/NZ_CP069563.1.region001.gbk |
| 68 | + touch ${prefix}/NZ_CP069563.1.region002.gbk |
| 69 | + touch ${prefix}/css/bacteria.css |
| 70 | + touch ${prefix}/genome.gbk |
| 71 | + touch ${prefix}/genome.json |
| 72 | + touch ${prefix}/genome.zip |
| 73 | + touch ${prefix}/images/about.svg |
| 74 | + touch ${prefix}/index.html |
| 75 | + touch ${prefix}/js/antismash.js |
| 76 | + touch ${prefix}/js/jquery.js |
| 77 | + touch ${prefix}/regions.js |
| 78 | + touch ${prefix}/test.log |
| 79 | +
|
| 80 | + cat <<-END_VERSIONS > versions.yml |
| 81 | + "${task.process}": |
| 82 | + antismash: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g') |
| 83 | + END_VERSIONS |
| 84 | + """ |
| 85 | +} |
0 commit comments