mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
refactor: accept settings as input
This commit is contained in:
parent
46a9aabfa3
commit
f6936e5270
2 changed files with 4 additions and 7 deletions
|
@ -9,10 +9,11 @@ process SRATOOLS_PREFETCH {
|
|||
|
||||
input:
|
||||
tuple val(meta), val(id)
|
||||
path(ncbi_settings)
|
||||
|
||||
output:
|
||||
tuple val(meta), path(id), emit: sra
|
||||
path "versions.yml" , emit: versions
|
||||
path 'versions.yml' , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
@ -20,7 +21,5 @@ process SRATOOLS_PREFETCH {
|
|||
shell:
|
||||
args = task.ext.args ?: ''
|
||||
args2 = task.ext.args2 ?: '5 1 100' // <num retries> <base delay in seconds> <max delay in seconds>
|
||||
config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n"
|
||||
|
||||
template 'retry_with_backoff.sh'
|
||||
}
|
||||
|
|
|
@ -40,10 +40,8 @@ retry_with_backoff() {
|
|||
echo "${output}"
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
retry_with_backoff !{args2} \
|
||||
|
|
Loading…
Reference in a new issue