mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
refactor: always output settings
This commit is contained in:
parent
64ff23f3c1
commit
e4551a9ab3
7 changed files with 30 additions and 24 deletions
|
@ -8,8 +8,8 @@ process SRATOOLS_NCBISETTINGS {
|
|||
'quay.io/biocontainers/sra-tools:2.11.0--pl5321ha49a11a_3' }"
|
||||
|
||||
output:
|
||||
path('user-settings.mkfg'), optional: true, emit: ncbi_settings
|
||||
path 'versions.yml' , emit: versions
|
||||
path('*.mkfg') , emit: ncbi_settings
|
||||
path 'versions.yml', emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
|
|
@ -21,8 +21,8 @@ output:
|
|||
pattern: "versions.yml"
|
||||
- ncbi_settings:
|
||||
type: file
|
||||
description: An optional, minimal NCBI settings file.
|
||||
pattern: "user-settings.mkfg"
|
||||
description: An NCBI user settings file.
|
||||
pattern: "*.mkfg"
|
||||
|
||||
authors:
|
||||
- "@Midnighter"
|
||||
|
|
|
@ -31,6 +31,12 @@ else
|
|||
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
|
||||
|
|
|
@ -37,10 +37,5 @@ workflow test_sratools_ncbisettings_with_bad_existing {
|
|||
}
|
||||
|
||||
workflow test_sratools_ncbisettings_with_nonexisting {
|
||||
|
||||
file(params.settings_path).mkdirs()
|
||||
def settings = file(params.settings_file)
|
||||
settings.delete()
|
||||
|
||||
SRATOOLS_NCBISETTINGS()
|
||||
}
|
||||
|
|
|
@ -1,17 +1,5 @@
|
|||
params.settings_path = '/tmp/.ncbi'
|
||||
params.settings_file = "${params.settings_path}/user-settings.mkfg"
|
||||
|
||||
env.NCBI_SETTINGS = params.settings_file
|
||||
|
||||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
withName: SRATOOLS_NCBISETTINGS {
|
||||
containerOptions = {
|
||||
(workflow.containerEngine == 'singularity') ?
|
||||
"-B ${params.settings_path}:${params.settings_path}" :
|
||||
"-v ${params.settings_path}:${params.settings_path}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
17
tests/modules/sratools/ncbisettings/nextflow_mount.config
Normal file
17
tests/modules/sratools/ncbisettings/nextflow_mount.config
Normal file
|
@ -0,0 +1,17 @@
|
|||
params.settings_path = '/tmp/.ncbi'
|
||||
params.settings_file = "${params.settings_path}/user-settings.mkfg"
|
||||
|
||||
env.NCBI_SETTINGS = params.settings_file
|
||||
|
||||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
withName: SRATOOLS_NCBISETTINGS {
|
||||
containerOptions = {
|
||||
(workflow.containerEngine == 'singularity') ?
|
||||
"-B ${params.settings_path}:${params.settings_path}" :
|
||||
"-v ${params.settings_path}:${params.settings_path}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +1,17 @@
|
|||
- name: "sratools ncbisettings test_sratools_ncbisettings_with_good_existing"
|
||||
command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_good_existing -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow.config
|
||||
command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_good_existing -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow_mount.config
|
||||
tags:
|
||||
- "sratools"
|
||||
- "sratools/ncbisettings"
|
||||
files:
|
||||
- path: "output/sratools/user-settings.mkfg"
|
||||
should_exist: false
|
||||
md5sum: 955e27aff2c277c2f1f0943a098888c1
|
||||
- path: output/sratools/versions.yml
|
||||
contains:
|
||||
- "sratools: 2.11.0"
|
||||
|
||||
- name: "sratools ncbisettings test_sratools_ncbisettings_with_bad_existing"
|
||||
command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_bad_existing -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow.config
|
||||
command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_bad_existing -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow_mount.config
|
||||
tags:
|
||||
- "sratools"
|
||||
- "sratools/ncbisettings"
|
||||
|
|
Loading…
Reference in a new issue