-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgenerate_config.nf
More file actions
53 lines (46 loc) · 1.8 KB
/
generate_config.nf
File metadata and controls
53 lines (46 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
process GENERATE_CONFIG {
tag "$meta.id"
label 'process_single'
conda "conda-forge::requests=2.28.1 conda-forge::pyyaml=6.0"
container "docker.io/genomehubs/blobtoolkit:4.4.5"
input:
tuple val(meta), val(fasta)
val taxon_query
val busco_lin
tuple val(metabn), path(blastn)
path lineage_tax_ids
// The following are passed as "val" because we need to know the original paths. Staging would prevent that
val reads
val db_paths
output:
tuple val(meta), path("*.yaml") , emit: yaml
tuple val(meta), path("*.csv") , emit: csv
tuple val(meta), path("*.synonyms.tsv") , emit: synonyms_tsv, optional: true
tuple val(meta), path("*.categories.tsv"), emit: categories_tsv, optional: true
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def busco_param = busco_lin ? "--busco '${busco_lin}'" : ""
def accession_params = params.accession ? "--accession ${params.accession}" : ""
def input_reads = reads.collect{"--read_id ${it[0].id} --read_type ${it[0].datatype} --read_layout ${it[0].layout} --read_path ${it[1]}"}.join(' ')
def input_databases = db_paths.collect{"--${it[0].type} ${it[1]}"}.join(' ')
"""
generate_config.py \\
--fasta $fasta \\
--taxon_query "$taxon_query" \\
--lineage_tax_ids $lineage_tax_ids \\
$busco_param \\
$accession_params \\
--nt $blastn \\
$input_reads \\
$input_databases \\
--output_prefix ${prefix}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
generate_config.py: \$(generate_config.py --version | cut -d' ' -f2)
END_VERSIONS
"""
}