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