From d4f13ebfff9b421bd36dbc6001669078adc2369a Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Sun, 8 May 2022 16:46:52 +0200 Subject: [PATCH] refactor: create new settings input --- modules/sratools/fasterqdump/main.nf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/sratools/fasterqdump/main.nf b/modules/sratools/fasterqdump/main.nf index 1980ffeb..6351efd2 100644 --- a/modules/sratools/fasterqdump/main.nf +++ b/modules/sratools/fasterqdump/main.nf @@ -9,6 +9,7 @@ process SRATOOLS_FASTERQDUMP { input: tuple val(meta), path(sra) + path(ncbi_settings) output: tuple val(meta), path(output), emit: reads @@ -20,16 +21,13 @@ process SRATOOLS_FASTERQDUMP { script: 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. 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}" + if [[ "${ncbi_settings.name}" != "EXISTS" ]]; then + export NCBI_SETTINGS="\$PWD/${ncbi_settings}" fi fasterq-dump \\