annotate 0.1.0/modules/sourmash/gather/main.nf @ 0:c8597e9e1a97

"planemo upload"
author kkonganti
date Mon, 27 Nov 2023 12:37:44 -0500
parents
children
rev   line source
kkonganti@0 1 process SOURMASH_GATHER {
kkonganti@0 2 tag "$meta.id"
kkonganti@0 3 label 'process_micro'
kkonganti@0 4
kkonganti@0 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}sourmash${params.fs}4.6.1" : null)
kkonganti@0 6 conda (params.enable_conda ? "conda-forge::python bioconda::sourmash=4.6.1" : null)
kkonganti@0 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@0 8 'https://depot.galaxyproject.org/singularity/sourmash:4.6.1--hdfd78af_0':
kkonganti@0 9 'quay.io/biocontainers/sourmash:4.6.1--hdfd78af_0' }"
kkonganti@0 10
kkonganti@0 11 input:
kkonganti@0 12 tuple val(meta), path(signature), path(database)
kkonganti@0 13 val save_unassigned
kkonganti@0 14 val save_matches_sig
kkonganti@0 15 val save_prefetch
kkonganti@0 16 val save_prefetch_csv
kkonganti@0 17
kkonganti@0 18 output:
kkonganti@0 19 tuple val(meta), path("*.csv.gz") , emit: result , optional: true
kkonganti@0 20 tuple val(meta), path("*_scaffolded_genomic.fna.gz"), emit: genomes_fasta, optional: true
kkonganti@0 21 tuple val(meta), path("*_unassigned.sig.zip") , emit: unassigned , optional: true
kkonganti@0 22 tuple val(meta), path("*_matches.sig.zip") , emit: matches , optional: true
kkonganti@0 23 tuple val(meta), path("*_prefetch.sig.zip") , emit: prefetch , optional: true
kkonganti@0 24 tuple val(meta), path("*_prefetch.csv.gz") , emit: prefetchcsv , optional: true
kkonganti@0 25 path "*FAILED.txt" , emit: failed , optional: true
kkonganti@0 26 path "versions.yml" , emit: versions
kkonganti@0 27
kkonganti@0 28 when:
kkonganti@0 29 task.ext.when == null || task.ext.when
kkonganti@0 30
kkonganti@0 31 script:
kkonganti@0 32 def args = task.ext.args ?: ''
kkonganti@0 33 def args2 = task.ext.args2 ?: ''
kkonganti@0 34 def prefix = task.ext.prefix ?: "${meta.id}"
kkonganti@0 35 def unassigned = save_unassigned ? "--output-unassigned ${prefix}_unassigned.sig.zip" : ''
kkonganti@0 36 def matches = save_matches_sig ? "--save-matches ${prefix}_matches.sig.zip" : ''
kkonganti@0 37 def prefetch = save_prefetch ? "--save-prefetch ${prefix}_prefetch.sig.zip" : ''
kkonganti@0 38 def prefetchcsv = save_prefetch_csv ? "--save-prefetch-csv ${prefix}_prefetch.csv.gz" : ''
kkonganti@0 39
kkonganti@0 40 """
kkonganti@0 41 sourmash gather \\
kkonganti@0 42 $args \\
kkonganti@0 43 --output ${prefix}.csv.gz \\
kkonganti@0 44 ${unassigned} \\
kkonganti@0 45 ${matches} \\
kkonganti@0 46 ${prefetch} \\
kkonganti@0 47 ${prefetchcsv} \\
kkonganti@0 48 ${signature} \\
kkonganti@0 49 ${database}
kkonganti@0 50
kkonganti@0 51 sourmash_filter_hits.py \\
kkonganti@0 52 $args2 \\
kkonganti@0 53 -csv ${prefix}.csv.gz
kkonganti@0 54
kkonganti@0 55 cat <<-END_VERSIONS > versions.yml
kkonganti@0 56 "${task.process}":
kkonganti@0 57 sourmash: \$(echo \$(sourmash --version 2>&1) | sed 's/^sourmash //' )
kkonganti@0 58 python: \$( python --version | sed 's/Python //g' )
kkonganti@0 59 END_VERSIONS
kkonganti@0 60 """
kkonganti@0 61 }