comparison 0.5.0/modules/sourmash/sketch/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_SKETCH {
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(sequence), path(database)
13
14 output:
15 tuple val(meta), path("*.query.sig"), path("*.db.sig"), emit: signatures
16 path "versions.yml" , emit: versions
17
18 when:
19 task.ext.when == null || task.ext.when
20
21 script:
22 // required defaults for the tool to run, but can be overridden
23 def args = task.ext.args ?: ''
24 def args_query
25 def prefix = task.ext.prefix ?: "${meta.id}"
26 """
27 sourmash sketch \\
28 ${args.toString().replace('--singleton', '')} \\
29 --output "${prefix}.query.pre" \\
30 $sequence
31
32 sourmash signature rename \\
33 --${args.toString().replaceAll(/\s+\-p.*/, '')} \\
34 -o "${prefix}.query.sig" \\
35 "${prefix}.query.pre" \\
36 ${prefix}
37
38 sourmash sketch \\
39 $args \\
40 --output "${prefix}.db.sig" \\
41 $database
42
43 cat <<-END_VERSIONS > versions.yml
44 "${task.process}":
45 sourmash: \$(echo \$(sourmash --version 2>&1) | sed 's/^sourmash //' )
46 END_VERSIONS
47 """
48 }