diff --git a/CHANGELOG.md b/CHANGELOG.md index 66753fad..4c614eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes +- [#89](https://github.com/nf-core/fetchngs/pull/89) - Improve detection and usage of the NCBI user settings by using the standardized sra-tools modules from nf-core. + - [[nf-core/rnaseq#764](https://github.com/nf-core/rnaseq/issues/764)] - Test fails when using GCP due to missing tools in the basic biocontainer - Updated pipeline template to [nf-core/tools 2.3.2](https://github.com/nf-core/tools/releases/tag/2.3.2) diff --git a/bin/retry_with_backoff.sh b/bin/retry_with_backoff.sh deleted file mode 100755 index 4bdbf1e0..00000000 --- a/bin/retry_with_backoff.sh +++ /dev/null @@ -1,100 +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= - - 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}" -} - -RETRY=5 -DELAY=1 -MAX_TIME=60 - -usage() { - echo "Usage:" >&2 - echo "$(basename ${0}) [-h] [-r NUM] [-d NUM] [-m NUM] COMMAND" >&2 - echo "Call the given command with retries and exponential backoff." >&2 - echo "" >&2 - echo " -r NUM Set the number of retry attempts (default ${RETRY})." >&2 - echo " -d NUM Set the base number of seconds to delay (default ${DELAY})." >&2 - echo " -m NUM Set the maximum delay in seconds (default ${MAX_TIME})." >&2 - echo "" >&2 -} - -check_numeric() { - local arg=${1} - if [[ ! ${arg} =~ ^[0-9]+$ ]]; then - echo "Illegal argument: ${arg}" >&2 - echo "Expected a number." >&2 - echo "" >&2 - usage - exit 2 - fi -} - -while getopts ":hr:d:m:" arg; do - case ${arg} in - h) - usage - exit 0 - ;; - r) - check_numeric ${OPTARG} - RETRY=${OPTARG} - ;; - d) - check_numeric ${OPTARG} - DELAY=${OPTARG} - ;; - m) - check_numeric ${OPTARG} - MAX_TIME=${OPTARG} - ;; - ?) - echo "Invalid option: -${OPTARG}" >&2 - echo "" >&2 - usage - exit 2 - ;; - :) - echo "Missing argument for: -${OPTARG}" >&2 - echo "" >&2 - usage - exit 2 - ;; - esac -done - -retry_with_backoff ${RETRY} ${DELAY} ${MAX_TIME} ${@:OPTIND} diff --git a/modules.json b/modules.json index f39d24ab..fefca2b7 100644 --- a/modules.json +++ b/modules.json @@ -5,6 +5,15 @@ "nf-core/modules": { "custom/dumpsoftwareversions": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + }, + "custom/sratoolsncbisettings": { + "git_sha": "b2dbaa99309a2057efc32ef9d029ed91140068df" + }, + "sratools/fasterqdump": { + "git_sha": "0cdf7767a79faf424645beeff83ecfa5528b6a7c" + }, + "sratools/prefetch": { + "git_sha": "1b228835e9525990db99243cb4f0d07aa6e01bc3" } } } diff --git a/modules/local/sratools_prefetch.nf b/modules/local/sratools_prefetch.nf deleted file mode 100644 index 76679a93..00000000 --- a/modules/local/sratools_prefetch.nf +++ /dev/null @@ -1,41 +0,0 @@ - -process SRATOOLS_PREFETCH { - tag "$id" - label 'process_low' - label 'error_retry' - - conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5262h314213e_0' : - 'quay.io/biocontainers/sra-tools:2.11.0--pl5262h314213e_0' }" - - input: - tuple val(meta), val(id) - - output: - tuple val(meta), path("$id"), emit: sra - path "versions.yml" , emit: versions - - script: - def args = task.ext.args ?: '' - def config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" - """ - eval "\$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" - if [[ ! -f "\${NCBI_SETTINGS}" ]]; then - mkdir -p "\$(dirname "\${NCBI_SETTINGS}")" - printf '${config}' > "\${NCBI_SETTINGS}" - fi - - retry_with_backoff.sh prefetch \\ - $args \\ - --progress \\ - $id - - 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/modules/custom/sratoolsncbisettings/main.nf b/modules/nf-core/modules/custom/sratoolsncbisettings/main.nf new file mode 100644 index 00000000..21bf3005 --- /dev/null +++ b/modules/nf-core/modules/custom/sratoolsncbisettings/main.nf @@ -0,0 +1,20 @@ +process CUSTOM_SRATOOLSNCBISETTINGS { + tag 'ncbi-settings' + label 'process_low' + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5321ha49a11a_3' : + 'quay.io/biocontainers/sra-tools:2.11.0--pl5321ha49a11a_3' }" + + output: + path('*.mkfg') , emit: ncbi_settings + path 'versions.yml', emit: versions + + when: + task.ext.when == null || task.ext.when + + shell: + config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" + template 'detect_ncbi_settings.sh' +} diff --git a/modules/nf-core/modules/custom/sratoolsncbisettings/meta.yml b/modules/nf-core/modules/custom/sratoolsncbisettings/meta.yml new file mode 100644 index 00000000..01e98856 --- /dev/null +++ b/modules/nf-core/modules/custom/sratoolsncbisettings/meta.yml @@ -0,0 +1,28 @@ +name: "sratoolsncbisettings" +description: Test for the presence of suitable NCBI settings or create them on the fly. +keywords: + - NCBI + - settings + - sra-tools + - prefetch + - fasterq-dump +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']" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - ncbi_settings: + type: file + description: An NCBI user settings file. + pattern: "*.mkfg" + +authors: + - "@Midnighter" diff --git a/modules/nf-core/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh b/modules/nf-core/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh new file mode 100644 index 00000000..cfe3a324 --- /dev/null +++ b/modules/nf-core/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +set -u + + +# Get the expected NCBI settings path and define the environment variable +# `NCBI_SETTINGS`. +eval "$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" + +# If the user settings do not exist yet, create a file suitable for `prefetch` +# and `fasterq-dump`. If an existing settings file does not contain the required +# values, error out with a helpful message. +if [[ ! -f "${NCBI_SETTINGS}" ]]; then + printf '!{config}' > 'user-settings.mkfg' +else + prefetch --help &> /dev/null + if [[ $? = 78 ]]; then + echo "You have an existing vdb-config at '${NCBI_SETTINGS}' but it is"\ + "missing the required entries for /LIBS/GUID and"\ + "/libs/cloud/report_instance_identity."\ + "Feel free to add the following to your settings file:" >&2 + echo "$(printf '!{config}')" >&2 + exit 1 + fi + fasterq-dump --help &> /dev/null + if [[ $? = 78 ]]; then + echo "You have an existing vdb-config at '${NCBI_SETTINGS}' but it is"\ + "missing the required entries for /LIBS/GUID and"\ + "/libs/cloud/report_instance_identity."\ + "Feel free to add the following to your settings file:" >&2 + echo "$(printf '!{config}')" >&2 + exit 1 + fi + if [[ "${NCBI_SETTINGS}" != *.mkfg ]]; then + echo "The detected settings '${NCBI_SETTINGS}' do not have the required"\ + "file extension '.mkfg'." >&2 + exit 1 + fi + cp "${NCBI_SETTINGS}" ./ +fi + +cat <<-END_VERSIONS > versions.yml +"!{task.process}": + sratools: $(vdb-config --version 2>&1 | grep -Eo '[0-9.]+') +END_VERSIONS diff --git a/modules/local/sratools_fasterqdump.nf b/modules/nf-core/modules/sratools/fasterqdump/main.nf similarity index 51% rename from modules/local/sratools_fasterqdump.nf rename to modules/nf-core/modules/sratools/fasterqdump/main.nf index 7a75e551..18f46e51 100644 --- a/modules/local/sratools_fasterqdump.nf +++ b/modules/nf-core/modules/sratools/fasterqdump/main.nf @@ -1,4 +1,3 @@ - process SRATOOLS_FASTERQDUMP { tag "$meta.id" label 'process_medium' @@ -10,27 +9,24 @@ process SRATOOLS_FASTERQDUMP { input: tuple val(meta), path(sra) + path ncbi_settings output: - tuple val(meta), path(fastq_output), emit: reads - tuple val(meta), path(md5_output) , emit: md5 - path "versions.yml" , emit: versions + tuple val(meta), path(output), emit: reads + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' - def config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" // Paired-end data extracted by fasterq-dump (--split-3 the default) always creates // *_1.fastq *_2.fastq files but sometimes also an additional *.fastq file // for unpaired reads which we ignore here. - fastq_output = meta.single_end ? '*.fastq.gz' : '*_{1,2}.fastq.gz' - md5_output = meta.single_end ? '*.fastq.gz.md5' : '*_{1,2}.fastq.gz.md5' + output = meta.single_end ? '*.fastq.gz' : '*_{1,2}.fastq.gz' """ - eval "\$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" - if [[ ! -f "\${NCBI_SETTINGS}" ]]; then - mkdir -p "\$(dirname "\${NCBI_SETTINGS}")" - printf '${config}' > "\${NCBI_SETTINGS}" - fi + export NCBI_SETTINGS="\$PWD/${ncbi_settings}" fasterq-dump \\ $args \\ @@ -43,22 +39,6 @@ process SRATOOLS_FASTERQDUMP { --processes $task.cpus \\ *.fastq - ## Rename FastQ files by meta.id - if [ -f ${sra.name}.fastq.gz ]; then - mv ${sra.name}.fastq.gz ${meta.id}.fastq.gz - md5sum ${meta.id}.fastq.gz > ${meta.id}.fastq.gz.md5 - fi - - if [ -f ${sra.name}_1.fastq.gz ]; then - mv ${sra.name}_1.fastq.gz ${meta.id}_1.fastq.gz - md5sum ${meta.id}_1.fastq.gz > ${meta.id}_1.fastq.gz.md5 - fi - - if [ -f ${sra.name}_2.fastq.gz ]; then - mv ${sra.name}_2.fastq.gz ${meta.id}_2.fastq.gz - md5sum ${meta.id}_2.fastq.gz > ${meta.id}_2.fastq.gz.md5 - fi - cat <<-END_VERSIONS > versions.yml "${task.process}": sratools: \$(fasterq-dump --version 2>&1 | grep -Eo '[0-9.]+') diff --git a/modules/nf-core/modules/sratools/fasterqdump/meta.yml b/modules/nf-core/modules/sratools/fasterqdump/meta.yml new file mode 100644 index 00000000..d6fbd444 --- /dev/null +++ b/modules/nf-core/modules/sratools/fasterqdump/meta.yml @@ -0,0 +1,47 @@ +name: sratools_fasterqdump +description: Extract sequencing reads in FASTQ format from a given NCBI Sequence Read Archive (SRA). +keywords: + - sequencing + - FASTQ + - dump +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 ] + - sra: + type: directory + description: Directory containing ETL data for the given SRA. + pattern: "*/*.sra" + - ncbi_settings: + type: file + description: > + An NCBI user settings file. + pattern: "*.mkfg" + +output: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - reads: + type: file + description: Extracted FASTQ file or files if the sequencing reads are paired-end. + pattern: "*.fastq.gz" + +authors: + - "@Midnighter" diff --git a/modules/nf-core/modules/sratools/prefetch/main.nf b/modules/nf-core/modules/sratools/prefetch/main.nf new file mode 100644 index 00000000..3426ae12 --- /dev/null +++ b/modules/nf-core/modules/sratools/prefetch/main.nf @@ -0,0 +1,25 @@ +process SRATOOLS_PREFETCH { + tag "$id" + label 'process_low' + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5321ha49a11a_3' : + 'quay.io/biocontainers/sra-tools:2.11.0--pl5321ha49a11a_3' }" + + input: + tuple val(meta), val(id) + path ncbi_settings + + 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' // + template 'retry_with_backoff.sh' +} diff --git a/modules/nf-core/modules/sratools/prefetch/meta.yml b/modules/nf-core/modules/sratools/prefetch/meta.yml new file mode 100644 index 00000000..a3a26522 --- /dev/null +++ b/modules/nf-core/modules/sratools/prefetch/meta.yml @@ -0,0 +1,48 @@ +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: val + description: > + A string denoting an SRA id. + - ncbi_settings: + type: file + description: > + An NCBI user settings file. + pattern: "*.mkfg" + +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" diff --git a/modules/nf-core/modules/sratools/prefetch/templates/retry_with_backoff.sh b/modules/nf-core/modules/sratools/prefetch/templates/retry_with_backoff.sh new file mode 100644 index 00000000..cec0ab43 --- /dev/null +++ b/modules/nf-core/modules/sratools/prefetch/templates/retry_with_backoff.sh @@ -0,0 +1,55 @@ +#!/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} + +vdb-validate !{id} + +cat <<-END_VERSIONS > versions.yml +"!{task.process}": + sratools: $(prefetch --version 2>&1 | grep -Eo '[0-9.]+') +END_VERSIONS diff --git a/subworkflows/local/sra_fastq_sratools.nf b/subworkflows/local/sra_fastq_sratools.nf deleted file mode 100644 index 1d59eb61..00000000 --- a/subworkflows/local/sra_fastq_sratools.nf +++ /dev/null @@ -1,31 +0,0 @@ -// -// Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). -// - -include { SRATOOLS_PREFETCH } from '../../modules/local/sratools_prefetch' -include { SRATOOLS_FASTERQDUMP } from '../../modules/local/sratools_fasterqdump' - -workflow SRA_FASTQ_SRATOOLS { - take: - sra_ids // channel: [ val(meta), val(id) ] - - main: - - ch_versions = Channel.empty() - - // - // Prefetch sequencing reads in SRA format. - // - SRATOOLS_PREFETCH ( sra_ids ) - ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() ) - - // - // Convert the SRA format into one or more compressed FASTQ files. - // - SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra ) - ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() ) - - emit: - reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ] - versions = ch_versions // channel: [ versions.yml ] -} diff --git a/subworkflows/nf-core/srafastq/main.nf b/subworkflows/nf-core/srafastq/main.nf new file mode 100644 index 00000000..f57b6fac --- /dev/null +++ b/subworkflows/nf-core/srafastq/main.nf @@ -0,0 +1,38 @@ +include { CUSTOM_SRATOOLSNCBISETTINGS } from '../../../modules/nf-core/modules/custom/sratoolsncbisettings/main' +include { SRATOOLS_PREFETCH } from '../../../modules/nf-core/modules/sratools/prefetch/main' +include { SRATOOLS_FASTERQDUMP } from '../../../modules/nf-core/modules/sratools/fasterqdump/main' + +/** + * Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). + */ +workflow SRAFASTQ { + take: + sra_ids // channel: [ val(meta), val(id) ] + + main: + + ch_versions = Channel.empty() + + // + // Detect existing NCBI user settings or create new ones. + // + CUSTOM_SRATOOLSNCBISETTINGS() + def settings = CUSTOM_SRATOOLSNCBISETTINGS.out.ncbi_settings // value channel: path(settings) + ch_versions = ch_versions.mix( CUSTOM_SRATOOLSNCBISETTINGS.out.versions ) + + // + // Prefetch sequencing reads in SRA format. + // + SRATOOLS_PREFETCH ( sra_ids, settings ) + ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() ) + + // + // Convert the SRA format into one or more compressed FASTQ files. + // + SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra, settings ) + ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() ) + + emit: + reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ] + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/srafastq/meta.yml b/subworkflows/nf-core/srafastq/meta.yml new file mode 100644 index 00000000..873ccaca --- /dev/null +++ b/subworkflows/nf-core/srafastq/meta.yml @@ -0,0 +1,40 @@ +name: sra_fastq +description: Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). +keywords: + - SRA + - NCBI + - sequencing + - FASTQ + - prefetch + - fasterq-dump +modules: + - custom/sratoolsncbisettings + - sratools/prefetch + - sratools/fasterqdump +input: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - id: + type: string + description: > + SRA run identifier. +# TODO Update when we decide on a standard for subworkflow docs +output: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Extracted FASTQ file or files if the sequencing reads are paired-end. + pattern: "*.fastq.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@Midnighter" diff --git a/workflows/sra.nf b/workflows/sra.nf index 9336fcc1..2b3cb498 100644 --- a/workflows/sra.nf +++ b/workflows/sra.nf @@ -26,7 +26,7 @@ include { SRA_TO_SAMPLESHEET } from '../modules/local/sra_to_samplesheet' include { SRA_MERGE_SAMPLESHEET } from '../modules/local/sra_merge_samplesheet' include { MULTIQC_MAPPINGS_CONFIG } from '../modules/local/multiqc_mappings_config' -include { SRA_FASTQ_SRATOOLS } from '../subworkflows/local/sra_fastq_sratools' +include { SRAFASTQ } from '../subworkflows/nf-core/srafastq/main' /* ======================================================================================== @@ -97,16 +97,16 @@ workflow SRA { // // SUBWORKFLOW: Download sequencing reads without FTP links using sra-tools. // - SRA_FASTQ_SRATOOLS ( + SRAFASTQ ( ch_sra_reads.sra.map { meta, reads -> [ meta, meta.run_accession ] } ) - ch_versions = ch_versions.mix(SRA_FASTQ_SRATOOLS.out.versions.first()) + ch_versions = ch_versions.mix(SRAFASTQ.out.versions.first()) // // MODULE: Stage FastQ files downloaded by SRA together and auto-create a samplesheet // SRA_TO_SAMPLESHEET ( - SRA_FASTQ_FTP.out.fastq.mix(SRA_FASTQ_SRATOOLS.out.reads), + SRA_FASTQ_FTP.out.fastq.mix(SRAFASTQ.out.reads), params.nf_core_pipeline ?: '', params.sample_mapping_fields )