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