comparison 0.6.1/modules/scaffold_genomes/main.nf @ 11:749faef1caa9

"planemo upload"
author kkonganti
date Tue, 05 Sep 2023 11:51:40 -0400
parents
children
comparison
equal deleted inserted replaced
10:1b9de878b04a 11:749faef1caa9
1 process SCAFFOLD_GENOMES {
2 tag "fasta_join.pl"
3 label "process_micro"
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 --max-workers $task.cpus \\
34 --directory "."
35
36 fasta_join.pl -in ncbi_dataset
37
38 cat <<-END_VERSIONS > versions.yml
39 "${task.process}":
40 datasets: \$( datasets --version | sed 's/datasets version: //g' )
41 perl: \$( perl -e 'print \$^V' | sed 's/v//g' )
42 bioperl: \$(perl -MBio::Root::Version -e 'print \$Bio::Root::Version::VERSION')
43 END_VERSIONS
44
45 zcmd=""
46 zver=""
47
48 if type pigz > /dev/null 2>&1; then
49 zcmd="pigz"
50 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed -e '1!d' | sed "s/\$zcmd //" )
51 elif type gzip > /dev/null 2>&1; then
52 zcmd="gzip"
53
54 if [ "${workflow.containerEngine}" != "null" ]; then
55 zver=\$( echo \$( \$zcmd --help 2>&1 ) | sed -e '1!d; s/ (.*\$//' )
56 else
57 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed "s/^.*(\$zcmd) //; s/\$zcmd //; s/ Copyright.*\$//" )
58 fi
59 fi
60
61 cat <<-END_VERSIONS >> versions.yml
62 \$zcmd: \$zver
63 END_VERSIONS
64 """
65 }