-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added nf-tests * Add missing tags * Fix conda tests * Update versions.yml file * Update version generation * Update versions command * Removed quotes from versions * add modules to pytest-workflow excludes * Addressing PR comments * Addressing PR comments * Addressing PR comments * Update container for matrix * Update snaps * Fix linting * Updated datasets paths * Replace base path in datasets * Adjust indentation of test inputs --------- Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Co-authored-by: Anabella Trigila <18577080+atrigila@users.noreply.github.com>
- Loading branch information
1 parent
1f2b32d
commit c835e16
Showing
23 changed files
with
530 additions
and
411 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
nextflow_process { | ||
|
||
name "Test Process CUSTOM_MATRIXFILTER" | ||
script "../main.nf" | ||
process "CUSTOM_MATRIXFILTER" | ||
config "./nextflow.config" | ||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "custom_matrixfilter" | ||
tag "custom" | ||
tag "custom/matrixfilter" | ||
|
||
test("test_custom_matrixfilter") { | ||
|
||
when { | ||
params { | ||
observations_id_col = 'sample' | ||
filtering_min_samples = 1.0 | ||
filtering_min_abundance = 10 | ||
filtering_min_proportion = null | ||
filtering_grouping_var = null | ||
filtering_min_proportion_not_na = 0.5 | ||
filtering_min_samples_not_na = null | ||
|
||
module_args = [ | ||
"--sample_id_col \"${params.observations_id_col}\"", | ||
"--minimum_samples ${params.filtering_min_samples}", | ||
"--minimum_abundance ${params.filtering_min_abundance}", | ||
(params.filtering_min_proportion ? "--minimum_proportion ${params.filtering_min_proportion}" : ''), | ||
(params.filtering_grouping_var ? "--grouping_variable \"${params.filtering_grouping_var}\"" : ''), | ||
(params.filtering_min_proportion_not_na ? "--minimum_proportion_not_na \"${params.filtering_min_proportion_not_na}\"" : ''), | ||
(params.filtering_min_samples_not_na ? "--minimum_samples_not_na \"${params.filtering_min_samples_not_na}\"" : '') | ||
].join(' ').trim() | ||
} | ||
process { | ||
""" | ||
input[0] = [ [id:"test"], | ||
file(params.modules_testdata_base_path + "genomics/mus_musculus/rnaseq_expression/SRP254919.salmon.merged.gene_counts.top1000cov.assay.tsv",checkIfExists: true) | ||
] | ||
input[1] = [ [id:"test"], | ||
file(params.modules_testdata_base_path + "genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.sample_metadata.tsv",checkIfExists: true) | ||
] | ||
""" | ||
|
||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.filtered, | ||
process.out.tests, | ||
process.out.versions).match() } | ||
) | ||
} | ||
} | ||
|
||
test("test_custom_matrixfilter - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
params { | ||
observations_id_col = 'sample' | ||
filtering_min_samples = 1.0 | ||
filtering_min_abundance = 10 | ||
filtering_min_proportion = null | ||
filtering_grouping_var = null | ||
filtering_min_proportion_not_na = 0.5 | ||
filtering_min_samples_not_na = null | ||
module_args = [ | ||
"--sample_id_col \"${params.observations_id_col}\"", | ||
"--minimum_samples ${params.filtering_min_samples}", | ||
"--minimum_abundance ${params.filtering_min_abundance}", | ||
(params.filtering_min_proportion ? "--minimum_proportion ${params.filtering_min_proportion}" : ''), | ||
(params.filtering_grouping_var ? "--grouping_variable \"${params.filtering_grouping_var}\"" : ''), | ||
(params.filtering_min_proportion_not_na ? "--minimum_proportion_not_na \"${params.filtering_min_proportion_not_na}\"" : ''), | ||
(params.filtering_min_samples_not_na ? "--minimum_samples_not_na \"${params.filtering_min_samples_not_na}\"" : '') | ||
].join(' ').trim() | ||
} | ||
process { | ||
""" | ||
input[0] = [ [id:"test"], | ||
file(params.modules_testdata_base_path + "genomics/mus_musculus/rnaseq_expression/SRP254919.salmon.merged.gene_counts.top1000cov.assay.tsv",checkIfExists: true) | ||
] | ||
input[1] = [ [id:"test"], | ||
file(params.modules_testdata_base_path + "genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.sample_metadata.tsv",checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
modules/nf-core/custom/matrixfilter/tests/main.nf.test.snap
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,95 @@ | ||
{ | ||
"test_custom_matrixfilter": { | ||
"content": [ | ||
[ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.filtered.tsv:md5,ecc3ca4c6538f9248dce844108474a66" | ||
] | ||
], | ||
[ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tests.tsv:md5,9a0f14988df8c1b8975039eed91b85e2" | ||
] | ||
], | ||
[ | ||
"versions.yml:md5,275e382be9ca5bdd30ff5d6fc4340616" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.2" | ||
}, | ||
"timestamp": "2024-12-13T21:21:11.862199262" | ||
}, | ||
"test_custom_matrixfilter - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tests.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"2": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.R_sessionInfo.log:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"3": [ | ||
"versions.yml:md5,275e382be9ca5bdd30ff5d6fc4340616" | ||
], | ||
"filtered": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"session_info": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.R_sessionInfo.log:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"tests": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tests.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,275e382be9ca5bdd30ff5d6fc4340616" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.2" | ||
}, | ||
"timestamp": "2024-12-13T21:22:31.144793503" | ||
} | ||
} |
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,3 @@ | ||
process { | ||
ext.args = params.module_args | ||
} |
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
63 changes: 63 additions & 0 deletions
63
modules/nf-core/custom/tabulartogseacls/tests/main.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,63 @@ | ||
nextflow_process { | ||
|
||
name "Test Process CUSTOM_TABULARTOGSEACLS" | ||
script "../main.nf" | ||
process "CUSTOM_TABULARTOGSEACLS" | ||
config "./nextflow.config" | ||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "custom_tabulartogseacls" | ||
tag "custom" | ||
tag "custom/tabulartogseacls" | ||
|
||
test("test_custom_tabulartogseacls") { | ||
|
||
when { | ||
params { | ||
module_args = [ "separator": "\t", "variable": "treatment" ] | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
[id:'treatment_mCherry_hND6_sample_number', variable:'treatment', reference:'mCherry', target:'hND6', blocking:'sample_number'], | ||
file(params.modules_testdata_base_path + "genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.sample_metadata.tsv", checkIfExists: true) | ||
] | ||
""" | ||
|
||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("test_custom_tabulartogseacls - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
params { | ||
module_args = { [ "separator": "\t", "variable": "treatment" ] } | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
[id:'treatment_mCherry_hND6_sample_number', variable:'treatment', reference:'mCherry', target:'hND6', blocking:'sample_number'], | ||
file(params.modules_testdata_base_path + "genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.sample_metadata.tsv", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.