Daniel Straub
03/06/2026, 12:26 PMparams_ref_url = "url/to/reference/database/file"
params_ref_storage = "path/to/local_dir" // default: ""
file_in_ref_storage = "${params_ref_storage}/${file(params_ref_url).name.toString()}"
if ( !params_ref_storage ) {
// no reference storage used
ch_ref = channel.fromPath( params_ref_url )
} else if ( file( file_in_ref_storage ).exists() ) {
// if file already stored
ch_ref = channel.fromPath( file_in_ref_storage )
} else {
// if file not yet stored
file( params_ref_storage ).mkdir()
file( params_ref_url ).copyTo( params_ref_storage )
ch_ref = channel.fromPath( file_in_ref_storage )
}
Is somewhere already a solution to it? Might that mess with -resume?Mahesh Binzer-Panchal
03/06/2026, 12:59 PMstoreDir
params.ref_url = "<https://url/to/reference/database/file.fa.gz>"
params.ref_storage = "/path/to/local_dir" // default: ""
process DOWNLOAD_REFERENCE {
storeDir params.ref_storage ?: "${launchDir}/reference_store"
input:
val ref_url
output:
path "${local_filename}"
script:
local_filename = file(ref_url).name
"""
wget -O "${local_filename}" "${ref_url}"
# or use curl:
# curl -L -o ${local_filename} ${ref_url}
"""
}Daniel Straub
03/06/2026, 1:08 PMDaniel Straub
03/06/2026, 1:08 PM