annotate 0.5.0/modules/scaffold_genomes/main.nf @ 1:365849f031fd

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