annotate 0.7.0/modules/sourmash/gather/main.nf @ 19:4b304d77bbfb

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