kkonganti@1
|
1 process SOURMASH_GATHER {
|
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_unassigned
|
kkonganti@1
|
14 val save_matches_sig
|
kkonganti@1
|
15 val save_prefetch
|
kkonganti@1
|
16 val save_prefetch_csv
|
kkonganti@1
|
17
|
kkonganti@1
|
18 output:
|
kkonganti@1
|
19 tuple val(meta), path("*.csv.gz") , emit: result , optional: true
|
kkonganti@1
|
20 tuple val(meta), path("*_scaffolded_genomic.fna.gz"), emit: genomes_fasta, optional: true
|
kkonganti@1
|
21 tuple val(meta), path("*_unassigned.sig.zip") , emit: unassigned , optional: true
|
kkonganti@1
|
22 tuple val(meta), path("*_matches.sig.zip") , emit: matches , optional: true
|
kkonganti@1
|
23 tuple val(meta), path("*_prefetch.sig.zip") , emit: prefetch , optional: true
|
kkonganti@1
|
24 tuple val(meta), path("*_prefetch.csv.gz") , emit: prefetchcsv , optional: true
|
kkonganti@1
|
25 path "*FAILED.txt" , emit: failed , optional: true
|
kkonganti@1
|
26 path "versions.yml" , emit: versions
|
kkonganti@1
|
27
|
kkonganti@1
|
28 when:
|
kkonganti@1
|
29 task.ext.when == null || task.ext.when
|
kkonganti@1
|
30
|
kkonganti@1
|
31 script:
|
kkonganti@1
|
32 def args = task.ext.args ?: ''
|
kkonganti@1
|
33 def args2 = task.ext.args2 ?: ''
|
kkonganti@1
|
34 def prefix = task.ext.prefix ?: "${meta.id}"
|
kkonganti@1
|
35 def unassigned = save_unassigned ? "--output-unassigned ${prefix}_unassigned.sig.zip" : ''
|
kkonganti@1
|
36 def matches = save_matches_sig ? "--save-matches ${prefix}_matches.sig.zip" : ''
|
kkonganti@1
|
37 def prefetch = save_prefetch ? "--save-prefetch ${prefix}_prefetch.sig.zip" : ''
|
kkonganti@1
|
38 def prefetchcsv = save_prefetch_csv ? "--save-prefetch-csv ${prefix}_prefetch.csv.gz" : ''
|
kkonganti@1
|
39 def gd = params.tuspy_gd ? "-gd ${params.tuspy_gd}" : ''
|
kkonganti@1
|
40
|
kkonganti@1
|
41 """
|
kkonganti@1
|
42 sourmash gather \\
|
kkonganti@1
|
43 $args \\
|
kkonganti@1
|
44 --output ${prefix}.csv.gz \\
|
kkonganti@1
|
45 ${unassigned} \\
|
kkonganti@1
|
46 ${matches} \\
|
kkonganti@1
|
47 ${prefetch} \\
|
kkonganti@1
|
48 ${prefetchcsv} \\
|
kkonganti@1
|
49 ${signature} \\
|
kkonganti@1
|
50 ${database}
|
kkonganti@1
|
51
|
kkonganti@1
|
52 sourmash_filter_hits.py \\
|
kkonganti@1
|
53 $args2 \\
|
kkonganti@1
|
54 -csv ${prefix}.csv.gz
|
kkonganti@1
|
55
|
kkonganti@1
|
56 gen_otf_genome.py \\
|
kkonganti@1
|
57 $gd \\
|
kkonganti@1
|
58 -op ${prefix} \\
|
kkonganti@1
|
59 -txt ${prefix}_template_hits.txt
|
kkonganti@1
|
60
|
kkonganti@1
|
61 cat <<-END_VERSIONS > versions.yml
|
kkonganti@1
|
62 "${task.process}":
|
kkonganti@1
|
63 sourmash: \$(echo \$(sourmash --version 2>&1) | sed 's/^sourmash //' )
|
kkonganti@1
|
64 python: \$( python --version | sed 's/Python //g' )
|
kkonganti@1
|
65 END_VERSIONS
|
kkonganti@1
|
66 """
|
kkonganti@1
|
67 } |