diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/0.5.0/modules/scaffold_genomes/main.nf	Mon Jun 05 18:48:51 2023 -0400
@@ -0,0 +1,64 @@
+process SCAFFOLD_GENOMES {
+    tag "fasta_join.pl"
+    label "process_nano"
+
+    module (params.enable_module ? "${params.swmodulepath}${params.fs}perl${params.fs}5.30.0" : null)
+    conda (params.enable_conda ? "conda-forge::perl bioconda::perl-bioperl=1.7.8" : null)
+    container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
+        'https://depot.galaxyproject.org/singularity/perl-bioperl:1.7.8--hdfd78af_1' :
+        'quay.io/biocontainers/perl-bioperl:1.7.8--hdfd78af_1' }"
+
+    input:
+        path acc_chunk_file
+
+    output:
+        val "${params.output}${params.fs}scaffold_genomes", emit: genomes_dir
+        path '*_scaffolded_genomic.fna.gz'                , emit: scaffolded
+        path 'versions.yml'                               , emit: versions
+
+    when:
+        task.ext.when == null || task.ext.when
+
+    script:
+        def args = task.ext.args ?: ''
+        """
+        datasets download genome accession \\
+            --dehydrated \\
+            --inputfile $acc_chunk_file
+
+        unzip ncbi_dataset.zip
+
+        datasets rehydrate \\
+            --gzip \\
+            --directory "."
+
+        fasta_join.pl -in ncbi_dataset
+
+        cat <<-END_VERSIONS > versions.yml
+        "${task.process}":
+            datasets: \$( datasets --version | sed 's/datasets version: //g' )
+            perl: \$( perl -e 'print \$^V' | sed 's/v//g' )
+            bioperl: \$(perl -MBio::Root::Version -e 'print \$Bio::Root::Version::VERSION')
+        END_VERSIONS
+
+        zcmd=""
+        zver=""
+
+        if type pigz > /dev/null 2>&1; then
+            zcmd="pigz"
+            zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed -e '1!d' | sed "s/\$zcmd //" )
+        elif type gzip > /dev/null 2>&1; then
+            zcmd="gzip"
+        
+            if [ "${workflow.containerEngine}" != "null" ]; then
+                zver=\$( echo \$( \$zcmd --help 2>&1 ) | sed -e '1!d; s/ (.*\$//' )
+            else
+                zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed "s/^.*(\$zcmd) //; s/\$zcmd //; s/ Copyright.*\$//" )
+            fi
+        fi
+
+        cat <<-END_VERSIONS >> versions.yml
+            \$zcmd: \$zver
+        END_VERSIONS
+        """
+}
\ No newline at end of file