annotate 0.1.0/modules/scaffold_genomes/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 SCAFFOLD_GENOMES {
kkonganti@0 2 tag "fasta_join.pl"
kkonganti@0 3 label "process_micro"
kkonganti@0 4
kkonganti@0 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}perl${params.fs}5.30.0" : null)
kkonganti@0 6 conda (params.enable_conda ? "conda-forge::perl bioconda::perl-bioperl=1.7.8" : null)
kkonganti@0 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@0 8 'https://depot.galaxyproject.org/singularity/perl-bioperl:1.7.8--hdfd78af_1' :
kkonganti@0 9 'quay.io/biocontainers/perl-bioperl:1.7.8--hdfd78af_1' }"
kkonganti@0 10
kkonganti@0 11 input:
kkonganti@0 12 path acc_chunk_file
kkonganti@0 13
kkonganti@0 14 output:
kkonganti@0 15 val "${params.output}${params.fs}scaffold_genomes", emit: genomes_dir
kkonganti@0 16 path '*_scaffolded_genomic.fna.gz' , emit: scaffolded
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 """
kkonganti@0 25 datasets download genome accession \\
kkonganti@0 26 --dehydrated \\
kkonganti@0 27 --inputfile $acc_chunk_file
kkonganti@0 28
kkonganti@0 29 unzip ncbi_dataset.zip
kkonganti@0 30
kkonganti@0 31 datasets rehydrate \\
kkonganti@0 32 --gzip \\
kkonganti@0 33 --max-workers $task.cpus \\
kkonganti@0 34 --directory "."
kkonganti@0 35
kkonganti@0 36 fasta_join.pl -in ncbi_dataset
kkonganti@0 37
kkonganti@0 38 cat <<-END_VERSIONS > versions.yml
kkonganti@0 39 "${task.process}":
kkonganti@0 40 datasets: \$( datasets --version | sed 's/datasets version: //g' )
kkonganti@0 41 perl: \$( perl -e 'print \$^V' | sed 's/v//g' )
kkonganti@0 42 bioperl: \$(perl -MBio::Root::Version -e 'print \$Bio::Root::Version::VERSION')
kkonganti@0 43 END_VERSIONS
kkonganti@0 44
kkonganti@0 45 zcmd=""
kkonganti@0 46 zver=""
kkonganti@0 47
kkonganti@0 48 if type pigz > /dev/null 2>&1; then
kkonganti@0 49 zcmd="pigz"
kkonganti@0 50 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed -e '1!d' | sed "s/\$zcmd //" )
kkonganti@0 51 elif type gzip > /dev/null 2>&1; then
kkonganti@0 52 zcmd="gzip"
kkonganti@0 53
kkonganti@0 54 if [ "${workflow.containerEngine}" != "null" ]; then
kkonganti@0 55 zver=\$( echo \$( \$zcmd --help 2>&1 ) | sed -e '1!d; s/ (.*\$//' )
kkonganti@0 56 else
kkonganti@0 57 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed "s/^.*(\$zcmd) //; s/\$zcmd //; s/ Copyright.*\$//" )
kkonganti@0 58 fi
kkonganti@0 59 fi
kkonganti@0 60
kkonganti@0 61 cat <<-END_VERSIONS >> versions.yml
kkonganti@0 62 \$zcmd: \$zver
kkonganti@0 63 END_VERSIONS
kkonganti@0 64 """
kkonganti@0 65 }