annotate 0.6.1/modules/sourmash/search/main.nf @ 12:c5faadb3386f

"planemo upload"
author kkonganti
date Tue, 05 Sep 2023 11:57:15 -0400
parents 749faef1caa9
children
rev   line source
kkonganti@11 1 process SOURMASH_SEARCH {
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_matches_sig
kkonganti@11 14
kkonganti@11 15 output:
kkonganti@11 16 tuple val(meta), path("*.csv.gz") , emit: result , optional: true
kkonganti@11 17 tuple val(meta), path("*_scaffolded_genomic.fna.gz"), emit: genomes_fasta, optional: true
kkonganti@11 18 tuple val(meta), path("*_matches.sig.zip") , emit: matches , optional: true
kkonganti@11 19 path "*FAILED.txt" , emit: failed , optional: true
kkonganti@11 20 path "versions.yml" , emit: versions
kkonganti@11 21
kkonganti@11 22 when:
kkonganti@11 23 task.ext.when == null || task.ext.when
kkonganti@11 24
kkonganti@11 25 script:
kkonganti@11 26 def args = task.ext.args ?: ''
kkonganti@11 27 def args2 = task.ext.args2 ?: ''
kkonganti@11 28 def prefix = task.ext.prefix ?: "${meta.id}"
kkonganti@11 29 def matches = save_matches_sig ? "--save-matches ${prefix}_matches.sig.zip" : ''
kkonganti@11 30 def gd = params.tuspy_gd ? "-gd ${params.tuspy_gd}" : ''
kkonganti@11 31
kkonganti@11 32 """
kkonganti@11 33 sourmash search \\
kkonganti@11 34 $args \\
kkonganti@11 35 --output ${prefix}.csv.gz \\
kkonganti@11 36 ${matches} \\
kkonganti@11 37 ${signature} \\
kkonganti@11 38 ${database}
kkonganti@11 39
kkonganti@11 40 sourmash_filter_hits.py \\
kkonganti@11 41 $args2 \\
kkonganti@11 42 -csv ${prefix}.csv.gz
kkonganti@11 43
kkonganti@11 44 gen_otf_genome.py \\
kkonganti@11 45 $gd \\
kkonganti@11 46 -op ${prefix} \\
kkonganti@11 47 -txt ${prefix}_template_hits.txt
kkonganti@11 48
kkonganti@11 49 cat <<-END_VERSIONS > versions.yml
kkonganti@11 50 "${task.process}":
kkonganti@11 51 sourmash: \$(echo \$(sourmash --version 2>&1) | sed 's/^sourmash //' )
kkonganti@11 52 python: \$( python --version | sed 's/Python //g' )
kkonganti@11 53 END_VERSIONS
kkonganti@11 54 """
kkonganti@11 55 }