Mercurial > repos > galaxytrakr > hfp_cronology_awsbatch
diff 0.2.0/modules/download_ref_genome/main.nf @ 0:9e8b1c747a6a draft default tip
planemo upload
| author | galaxytrakr |
|---|---|
| date | Fri, 29 May 2026 13:32:17 +0000 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/0.2.0/modules/download_ref_genome/main.nf Fri May 29 13:32:17 2026 +0000 @@ -0,0 +1,63 @@ +process DOWNLOAD_REF_GENOME { + tag "${meta.id}" + label "process_pico" + + module (params.enable_module ? "${params.swmodulepath}${params.fs}python${params.fs}3.8.1" : null) + conda (params.enable_conda ? "conda-forge::python=3.10.4 conda-forge::unzip conda-forge::gzip" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ncbi-datasets-pylib:15.31.1--pyhdfd78af_0' : + 'quay.io/biocontainers/python:3.10.4' }" + + input: + val meta + + output: + path "*.fna" , emit: fasta + path "*.gff" , emit: gff + path 'versions.yml', emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + [ -e /usr/local/ssl/cacert.pem ] && export SSL_CERT_FILE=/usr/local/ssl/cacert.pem + + datasets download genome accession --assembly-version latest --include genome,gff3 ${meta.id} + + unzip ncbi_dataset.zip + + stage_ncbi_dataset_genomes.py -in ncbi_dataset -suffix '_genomic.fna' -out "." + + stage_ncbi_dataset_genomes.py -in ncbi_dataset -suffix '.gff' -out "." + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + datasets: \$( datasets --version | sed 's/datasets version: //g' ) + python: \$( python --version | sed 's/Python //g' ) + END_VERSIONS + + zcmd="" + zver="" + + if type pigz > /dev/null 2>&1; then + zcmd="pigz" + zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed -e '1!d' | sed "s/\$zcmd //" ) + elif type gzip > /dev/null 2>&1; then + zcmd="gzip" + + if [ "${workflow.containerEngine}" != "null" ]; then + zver=\$( echo \$( \$zcmd --help 2>&1 ) | sed -e '1!d; s/ (.*\$//' ) + else + zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed "s/^.*(\$zcmd) //; s/\$zcmd //; s/ Copyright.*\$//" ) + fi + fi + + cat <<-END_VERSIONS >> versions.yml + \$zcmd: \$zver + END_VERSIONS + """ + +} \ No newline at end of file
