tests: add settings input or not and test all branches

This commit is contained in:
Moritz E. Beber 2022-05-08 17:00:28 +02:00
parent d4f13ebfff
commit eae7161a32
4 changed files with 103 additions and 8 deletions

View file

@ -5,7 +5,11 @@ nextflow.enable.dsl = 2
include { UNTAR } from '../../../../modules/untar/main.nf'
include { SRATOOLS_FASTERQDUMP } from '../../../../modules/sratools/fasterqdump/main.nf'
workflow test_sratools_fasterqdump_single_end {
workflow test_sratools_fasterqdump_single_end_with_input {
file(params.settings_path).mkdirs()
def settings = file(params.settings_file)
settings.text = "/LIBS/GUID = \"5b0d4b7d-88c7-4802-98fd-e3afd06feb32\"\n/libs/cloud/report_instance_identity = \"true\"\n"
archive = [ [], file(params.test_data['sarscov2']['illumina']['SRR13255544_tar_gz'], checkIfExists: true) ]
UNTAR ( archive )
@ -13,10 +17,14 @@ workflow test_sratools_fasterqdump_single_end {
def input = Channel.of([ id:'test_single_end', single_end:true ])
.combine(UNTAR.out.untar.map{ it[1] })
SRATOOLS_FASTERQDUMP ( input )
SRATOOLS_FASTERQDUMP(input, settings)
}
workflow test_sratools_fasterqdump_paired_end {
workflow test_sratools_fasterqdump_paired_end_with_input {
file(params.settings_path).mkdirs()
def settings = file(params.settings_file)
settings.text = "/LIBS/GUID = \"5b0d4b7d-88c7-4802-98fd-e3afd06feb32\"\n/libs/cloud/report_instance_identity = \"true\"\n"
archive = [ [], file(params.test_data['sarscov2']['illumina']['SRR11140744_tar_gz'], checkIfExists: true) ]
UNTAR ( archive )
@ -24,5 +32,35 @@ workflow test_sratools_fasterqdump_paired_end {
def input = Channel.of([ id:'test_paired_end', single_end:false ])
.combine(UNTAR.out.untar.map{ it[1] })
SRATOOLS_FASTERQDUMP ( input )
SRATOOLS_FASTERQDUMP(input, settings)
}
workflow test_sratools_fasterqdump_single_end_without_input {
file(params.settings_path).mkdirs()
def settings = file(params.settings_file)
settings.text = "/LIBS/GUID = \"5b0d4b7d-88c7-4802-98fd-e3afd06feb32\"\n/libs/cloud/report_instance_identity = \"true\"\n"
archive = [ [], file(params.test_data['sarscov2']['illumina']['SRR13255544_tar_gz'], checkIfExists: true) ]
UNTAR ( archive )
def input = Channel.of([ id:'test_single_end', single_end:true ])
.combine(UNTAR.out.untar.map{ it[1] })
SRATOOLS_FASTERQDUMP(input, file('EXISTS'))
}
workflow test_sratools_fasterqdump_paired_end_without_input {
file(params.settings_path).mkdirs()
def settings = file(params.settings_file)
settings.text = "/LIBS/GUID = \"5b0d4b7d-88c7-4802-98fd-e3afd06feb32\"\n/libs/cloud/report_instance_identity = \"true\"\n"
archive = [ [], file(params.test_data['sarscov2']['illumina']['SRR11140744_tar_gz'], checkIfExists: true) ]
UNTAR ( archive )
def input = Channel.of([ id:'test_paired_end', single_end:false ])
.combine(UNTAR.out.untar.map{ it[1] })
SRATOOLS_FASTERQDUMP(input, file('EXISTS'))
}

View file

@ -1,3 +1,6 @@
params.settings_path = '/tmp/.ncbi'
params.settings_file = "${params.settings_path}/user-settings.mkfg"
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

View file

@ -0,0 +1,18 @@
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_FASTERQDUMP {
containerOptions = {
(workflow.containerEngine == 'singularity') ?
"-B ${params.settings_path}:${params.settings_path}" :
"-v ${params.settings_path}:${params.settings_path}"
}
}
}

View file

@ -1,5 +1,5 @@
- name: sratools fasterqdump test_sratools_fasterqdump_single_end
command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_single_end -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow.config
- name: sratools fasterqdump test_sratools_fasterqdump_single_end_with_input
command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_single_end_with_input -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow.config
tags:
- sratools
- sratools/fasterqdump
@ -8,9 +8,12 @@
md5sum: 1054c7b71884acdb5eed8a378f18be82
- path: output/untar/SRR13255544/SRR13255544.sra
md5sum: 466d05dafb2eec672150754168010b4d
- path: output/sratools/versions.yml
contains:
- "sratools: 2.11.0"
- name: sratools fasterqdump test_sratools_fasterqdump_paired_end
command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow.config
- name: sratools fasterqdump test_sratools_fasterqdump_paired_end_with_input
command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_paired_end_with_input -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow.config
tags:
- sratools
- sratools/fasterqdump
@ -21,3 +24,36 @@
md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e
- path: output/untar/SRR11140744/SRR11140744.sra
md5sum: 065666caf5b2d5dfb0cb25d5f3abe659
- path: output/sratools/versions.yml
contains:
- "sratools: 2.11.0"
- name: sratools fasterqdump test_sratools_fasterqdump_single_end_without_input
command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_single_end_without_input -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow_mount.config
tags:
- sratools
- sratools/fasterqdump
files:
- path: output/sratools/SRR13255544.fastq.gz
md5sum: 1054c7b71884acdb5eed8a378f18be82
- path: output/untar/SRR13255544/SRR13255544.sra
md5sum: 466d05dafb2eec672150754168010b4d
- path: output/sratools/versions.yml
contains:
- "sratools: 2.11.0"
- name: sratools fasterqdump test_sratools_fasterqdump_paired_end_without_input
command: nextflow run ./tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_paired_end_without_input -c ./tests/config/nextflow.config -c ./tests/modules/sratools/fasterqdump/nextflow_mount.config
tags:
- sratools
- sratools/fasterqdump
files:
- path: output/sratools/SRR11140744_1.fastq.gz
md5sum: 193809c784a4ea132ab2a253fa4f55b6
- path: output/sratools/SRR11140744_2.fastq.gz
md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e
- path: output/untar/SRR11140744/SRR11140744.sra
md5sum: 065666caf5b2d5dfb0cb25d5f3abe659
- path: output/sratools/versions.yml
contains:
- "sratools: 2.11.0"