annotate 0.7.0/modules/scaffold_genomes/main.nf @ 20:133571bf891f

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