comparison 0.1.0/modules/download_ref_genome/main.nf @ 0:c8597e9e1a97

"planemo upload"
author kkonganti
date Mon, 27 Nov 2023 12:37:44 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c8597e9e1a97
1 process DOWNLOAD_REF_GENOME {
2 tag "${meta.id}"
3 label "process_pico"
4
5 module (params.enable_module ? "${params.swmodulepath}${params.fs}python${params.fs}3.8.1" : null)
6 conda (params.enable_conda ? "conda-forge::python=3.10.4" : null)
7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
8 'https://depot.galaxyproject.org/singularity/python:3.10.4' :
9 'quay.io/biocontainers/python:3.10.4' }"
10
11 input:
12 val meta
13
14 output:
15 path "*.fna" , emit: fasta
16 path "*.gff" , emit: gff
17 path 'versions.yml', emit: versions
18
19 when:
20 task.ext.when == null || task.ext.when
21
22 script:
23 def args = task.ext.args ?: ''
24 prefix = task.ext.prefix ?: "${meta.id}"
25 """
26 datasets download genome accession --assembly-version latest --include genome,gff3 ${meta.id}
27
28 unzip ncbi_dataset.zip
29
30 stage_ncbi_dataset_genomes.py -in ncbi_dataset -suffix '_genomic.fna' -out "."
31
32 stage_ncbi_dataset_genomes.py -in ncbi_dataset -suffix '.gff' -out "."
33
34 cat <<-END_VERSIONS > versions.yml
35 "${task.process}":
36 datasets: \$( datasets --version | sed 's/datasets version: //g' )
37 python: \$( python --version | sed 's/Python //g' )
38 END_VERSIONS
39
40 zcmd=""
41 zver=""
42
43 if type pigz > /dev/null 2>&1; then
44 zcmd="pigz"
45 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed -e '1!d' | sed "s/\$zcmd //" )
46 elif type gzip > /dev/null 2>&1; then
47 zcmd="gzip"
48
49 if [ "${workflow.containerEngine}" != "null" ]; then
50 zver=\$( echo \$( \$zcmd --help 2>&1 ) | sed -e '1!d; s/ (.*\$//' )
51 else
52 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed "s/^.*(\$zcmd) //; s/\$zcmd //; s/ Copyright.*\$//" )
53 fi
54 fi
55
56 cat <<-END_VERSIONS >> versions.yml
57 \$zcmd: \$zver
58 END_VERSIONS
59 """
60
61 }