annotate 0.2.0/modules/sourmash/gather/main.nf @ 18:a72c172df773 tip

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