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