diff --git a/modules/nf-core/sratools/prefetch/environment.yml b/modules/nf-core/sratools/prefetch/environment.yml deleted file mode 100644 index cfc7d9a..0000000 --- a/modules/nf-core/sratools/prefetch/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: sratools_prefetch -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - bioconda::sra-tools=3.0.8 diff --git a/modules/nf-core/sratools/prefetch/main.nf b/modules/nf-core/sratools/prefetch/main.nf deleted file mode 100644 index 3c30739..0000000 --- a/modules/nf-core/sratools/prefetch/main.nf +++ /dev/null @@ -1,35 +0,0 @@ -process SRATOOLS_PREFETCH { - tag "$id" - label 'process_low' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sra-tools:3.0.8--h9f5acd7_0' : - 'biocontainers/sra-tools:3.0.8--h9f5acd7_0' }" - - input: - tuple val(meta), val(id) - path ncbi_settings - path certificate - - output: - tuple val(meta), path(id), emit: sra - path 'versions.yml' , emit: versions - - when: - task.ext.when == null || task.ext.when - - shell: - args = task.ext.args ?: '' - args2 = task.ext.args2 ?: '5 1 100' // - if (certificate) { - if (certificate.toString().endsWith('.jwt')) { - args += " --perm ${certificate}" - } - else if (certificate.toString().endsWith('.ngc')) { - args += " --ngc ${certificate}" - } - } - - template 'retry_with_backoff.sh' -} diff --git a/modules/nf-core/sratools/prefetch/meta.yml b/modules/nf-core/sratools/prefetch/meta.yml deleted file mode 100644 index ff54229..0000000 --- a/modules/nf-core/sratools/prefetch/meta.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: sratools_prefetch -description: Download sequencing data from the NCBI Sequence Read Archive (SRA). -keywords: - - sequencing - - fastq - - prefetch -tools: - - sratools: - description: SRA Toolkit and SDK from NCBI - homepage: https://github.com/ncbi/sra-tools - documentation: https://github.com/ncbi/sra-tools/wiki - tool_dev_url: https://github.com/ncbi/sra-tools - licence: ["Public Domain"] -input: - - meta: - type: map - description: > - Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - - id: - type: string - description: > - A string denoting an SRA id. - - - ncbi_settings: - type: file - description: > - An NCBI user settings file. - - pattern: "*.mkfg" - - certificate: - type: file - description: > - Path to a JWT cart file used to access protected dbGAP data on SRA using the sra-toolkit - - pattern: "*.cart" -output: - - meta: - type: map - description: > - Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - - sra: - type: directory - description: > - Directory containing the ETL data for the given SRA id. - - pattern: "*/*.sra" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@Midnighter" -maintainers: - - "@Midnighter" diff --git a/modules/nf-core/sratools/prefetch/templates/retry_with_backoff.sh b/modules/nf-core/sratools/prefetch/templates/retry_with_backoff.sh deleted file mode 100755 index a72a4bf..0000000 --- a/modules/nf-core/sratools/prefetch/templates/retry_with_backoff.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -set -u - -retry_with_backoff() { - local max_attempts=${1} - local delay=${2} - local max_time=${3} - local attempt=1 - local output= - local status= - - # Remove the first three arguments to this function in order to access - # the 'real' command with `${@}`. - shift 3 - - while [ ${attempt} -le ${max_attempts} ]; do - output=$("${@}") - status=${?} - - if [ ${status} -eq 0 ]; then - break - fi - - if [ ${attempt} -lt ${max_attempts} ]; then - echo "Failed attempt ${attempt} of ${max_attempts}. Retrying in ${delay} s." >&2 - sleep ${delay} - elif [ ${attempt} -eq ${max_attempts} ]; then - echo "Failed after ${attempt} attempts." >&2 - return ${status} - fi - - attempt=$(( ${attempt} + 1 )) - delay=$(( ${delay} * 2 )) - if [ ${delay} -ge ${max_time} ]; then - delay=${max_time} - fi - done - - echo "${output}" -} - -export NCBI_SETTINGS="$PWD/!{ncbi_settings}" - -retry_with_backoff !{args2} \ - prefetch \ - !{args} \ - !{id} - -[ -f !{id}.sralite ] && vdb-validate !{id}.sralite || vdb-validate !{id} - -cat <<-END_VERSIONS > versions.yml -"!{task.process}": - sratools: $(prefetch --version 2>&1 | grep -Eo '[0-9.]+') -END_VERSIONS diff --git a/modules/nf-core/sratools/prefetch/tests/main.nf.test b/modules/nf-core/sratools/prefetch/tests/main.nf.test deleted file mode 100644 index ed710ba..0000000 --- a/modules/nf-core/sratools/prefetch/tests/main.nf.test +++ /dev/null @@ -1,55 +0,0 @@ -nextflow_process { - name "Test Process SRATOOLS_PREFETCH" - script "../main.nf" - process "SRATOOLS_PREFETCH" - tag "modules" - tag "modules_nfcore" - tag "sratools" - tag "sratools/prefetch" - - test("sratools/prefetch") { - - when { - params { - outdir = "output" - } - process { - """ - input[0] = Channel.of([ [ id:'test', single_end:false ], 'DRR000774' ]) - input[1] = file(params.modules_testdata_base_path + 'generic/config/ncbi_user_settings.mkfg', checkIfExists: true) - input[2] = [] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("sratools/prefetch with sralite") { - - when { - params { - outdir = "output" - } - process { - """ - input[0] = Channel.of([ [ id:'test', single_end:false ], 'SRR1170046' ]) - input[1] = file(params.modules_testdata_base_path + 'generic/config/ncbi_user_settings.mkfg', checkIfExists: true) - input[2] = [] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } -} diff --git a/modules/nf-core/sratools/prefetch/tests/main.nf.test.snap b/modules/nf-core/sratools/prefetch/tests/main.nf.test.snap deleted file mode 100644 index ab1d208..0000000 --- a/modules/nf-core/sratools/prefetch/tests/main.nf.test.snap +++ /dev/null @@ -1,72 +0,0 @@ -{ - "sratools/prefetch with sralite": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "SRR1170046.sralite:md5,7acfce556ca0951aff49d780899c105b" - ] - ] - ], - "1": [ - "versions.yml:md5,c967dea4135cb75490e1e801c4639efc" - ], - "sra": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "SRR1170046.sralite:md5,7acfce556ca0951aff49d780899c105b" - ] - ] - ], - "versions": [ - "versions.yml:md5,c967dea4135cb75490e1e801c4639efc" - ] - } - ], - "timestamp": "2023-10-13T12:11:24.563510389" - }, - "sratools/prefetch": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "DRR000774.sra:md5,7647dba20c89c0e3d7ad13842f060eb0" - ] - ] - ], - "1": [ - "versions.yml:md5,c967dea4135cb75490e1e801c4639efc" - ], - "sra": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "DRR000774.sra:md5,7647dba20c89c0e3d7ad13842f060eb0" - ] - ] - ], - "versions": [ - "versions.yml:md5,c967dea4135cb75490e1e801c4639efc" - ] - } - ], - "timestamp": "2023-10-13T12:11:02.75256571" - } -} \ No newline at end of file diff --git a/modules/nf-core/sratools/prefetch/tests/tags.yml b/modules/nf-core/sratools/prefetch/tests/tags.yml deleted file mode 100644 index 52110bf..0000000 --- a/modules/nf-core/sratools/prefetch/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -sratools/prefetch: - - modules/nf-core/sratools/prefetch/**