-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init for the new subworkflow generate-downstream-samplesheet
- Loading branch information
1 parent
85add1b
commit f2a4f6b
Showing
5 changed files
with
173 additions
and
19 deletions.
There are no files selected for viewing
48 changes: 29 additions & 19 deletions
48
nf_core/pipeline-template/subworkflows/local/generate_downstream_samplesheets/main.nf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...-template/subworkflows/local/generate_downstream_samplesheets/tests/main.function.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
nextflow_function { | ||
|
||
name "Test Functions" | ||
script "../main.nf" | ||
tag 'subworkflows' | ||
tag 'generate_downstream_samplesheets' | ||
tag 'subworkflows/generate_downstream_samplesheets' | ||
|
||
test("Test Function channelToSamplesheet - csv") { | ||
|
||
function "channelToSamplesheet" | ||
|
||
when { | ||
function { | ||
""" | ||
// define inputs of the function here. Example: | ||
input[0] = Channel.of( | ||
[ | ||
[sample: 'test-pe', | ||
fastq_1: 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', | ||
fastq_2: 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', | ||
strandedness: 'auto'] | ||
], | ||
[ | ||
[sample: 'test-se', | ||
fastq_1: 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', | ||
fastq_2: '', | ||
strandedness: 'auto'] | ||
] | ||
input[1] = "$outputDir/test.csv" | ||
input[2] = "csv" | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert function.success }, | ||
{ assert snapshot(function.result).match() } | ||
) | ||
} | ||
} | ||
|
||
test("Test Function channelToSamplesheet - tsv") { | ||
|
||
function "channelToSamplesheet" | ||
|
||
when { | ||
function { | ||
""" | ||
// define inputs of the function here. Example: | ||
input[0] = Channel.of( | ||
[ | ||
[sample: 'test-pe', | ||
fastq_1: 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', | ||
fastq_2: 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', | ||
strandedness: 'auto'] | ||
], | ||
[ | ||
[sample: 'test-se', | ||
fastq_1: 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', | ||
fastq_2: '', | ||
strandedness: 'auto'] | ||
] | ||
input[1] = "$outputDir/test.tsv" | ||
input[2] = "tsv" | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert function.success }, | ||
{ assert snapshot(function.result).match() } | ||
) | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...-template/subworkflows/local/generate_downstream_samplesheets/tests/main.workflow.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
nextflow_workflow { | ||
|
||
name "Test Workflow GENERATE_DOWNSTREAM_SAMPLESHEETS" | ||
script "../main.nf" | ||
workflow "GENERATE_DOWNSTREAM_SAMPLESHEETS" | ||
tag 'subworkflows' | ||
tag 'generate_downstream_samplesheets' | ||
tag 'subworkflows/generated_downstream_samplesheets' | ||
|
||
test("Test worfklow rnaseq") { | ||
when { | ||
params { | ||
outdir = "." | ||
generate_pipeline_samplesheets = 'rnaseq' | ||
generate_pipeline_samplesheets_format = 'csv' | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.of( | ||
[ | ||
[id: 'test-pe', single_end: false, reads: ['test_1.fastq.gz', 'test_2.fastq.gz']] | ||
], | ||
[ | ||
[id: 'test-se', single_end: true, reads: ['test_1.fastq.gz']] | ||
] | ||
) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert workflow.success }, | ||
{ assert snapshot( | ||
[ | ||
"${params.outdir}/downstream_samplesheets/rnaseq.csv" | ||
]).match() | ||
} | ||
) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters