comparison 0.5.0/modules/sourmash/search/main.nf @ 1:365849f031fd

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