-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from nf-core/91-implement-tests-with-nf-test
Adding nf-tests for pipeline. Currently, only the main aligners: alevin, kallisto, star and cellranger.
- Loading branch information
Showing
13 changed files
with
518 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ testing* | |
log/ | ||
reports/ | ||
testme.sh | ||
.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
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,8 @@ | ||
config { | ||
|
||
testsDir "tests" | ||
workDir ".nf-test" | ||
configFile "tests/nextflow.config" | ||
profile "docker" | ||
|
||
} |
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,67 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test Workflow main.nf" | ||
script "main.nf" | ||
|
||
test("test-dataset_alevin_aligner") { | ||
|
||
when { | ||
// the rest is taken from shared config | ||
params { | ||
aligner = 'alevin' | ||
outdir = "${outputDir}/results_alevin" | ||
|
||
// Limit resources so that this can run on GitHub Actions -- for some reason it had not been taken from shared config | ||
max_cpus = 2 | ||
max_memory = '6.GB' | ||
max_time = '6.h' | ||
} | ||
} | ||
|
||
then { | ||
|
||
assertAll( | ||
|
||
// | ||
// General assertions | ||
// | ||
|
||
// Did it finish successfully? | ||
{assert workflow.success}, | ||
|
||
// How many tasks were executed? | ||
{assert workflow.trace.tasks().size() == 16}, | ||
|
||
// How many results were produced? | ||
{assert path("${outputDir}/results_alevin").list().size() == 5}, | ||
{assert path("${outputDir}/results_alevin/alevin").list().size() == 4}, | ||
{assert path("${outputDir}/results_alevin/alevin/mtx_conversions").list().size() == 4}, | ||
{assert path("${outputDir}/results_alevin/alevinqc").list().size() == 2}, | ||
{assert path("${outputDir}/results_alevin/fastqc").list().size() == 12}, | ||
{assert path("${outputDir}/results_alevin/multiqc").list().size() == 3}, | ||
|
||
// | ||
// Check if files were produced | ||
// | ||
{assert new File( "${outputDir}/results_alevin/alevin/mtx_conversions/Sample_X/Sample_X_matrix.h5ad" ).exists()}, | ||
{assert new File( "${outputDir}/results_alevin/alevin/mtx_conversions/Sample_Y/Sample_Y_matrix.h5ad" ).exists()}, | ||
|
||
// | ||
// Check if files are the same | ||
// | ||
{assert snapshot( | ||
workflow, | ||
path( "${outputDir}/results_alevin/alevin/Sample_X_alevin_results/af_quant/alevin/quants_mat_cols.txt" ), | ||
path( "${outputDir}/results_alevin/alevin/Sample_X_alevin_results/af_quant/alevin/quants_mat.mtx" ), | ||
path( "${outputDir}/results_alevin/alevin/Sample_X_alevin_results/af_quant/alevin/quants_mat_rows.txt" ), | ||
path( "${outputDir}/results_alevin/alevin/Sample_Y_alevin_results/af_quant/alevin/quants_mat_cols.txt" ), | ||
path( "${outputDir}/results_alevin/alevin/Sample_Y_alevin_results/af_quant/alevin/quants_mat.mtx" ), | ||
path( "${outputDir}/results_alevin/alevin/Sample_Y_alevin_results/af_quant/alevin/quants_mat_rows.txt" ) | ||
).match()} | ||
|
||
) // end of assertAll() | ||
|
||
} | ||
} | ||
|
||
} |
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,32 @@ | ||
{ | ||
"test-dataset_alevin_aligner": { | ||
"content": [ | ||
{ | ||
"stderr": [ | ||
|
||
], | ||
"errorReport": "", | ||
"exitStatus": 0, | ||
"failed": false, | ||
"stdout": [ | ||
|
||
], | ||
"errorMessage": "", | ||
"trace": { | ||
"tasksFailed": 0, | ||
"tasksCount": 16, | ||
"tasksSucceeded": 16 | ||
}, | ||
"name": "workflow", | ||
"success": true | ||
}, | ||
"quants_mat_cols.txt:md5,e9868982c17a330392e38c2a5933cf97", | ||
"quants_mat.mtx:md5,b8aa7b3c488fd8923de50a3621d4991f", | ||
"quants_mat_rows.txt:md5,6227df5a13127b71c71fb18cd8574857", | ||
"quants_mat_cols.txt:md5,e9868982c17a330392e38c2a5933cf97", | ||
"quants_mat.mtx:md5,54cd12666016adce94c025b2e07f4b02", | ||
"quants_mat_rows.txt:md5,6b458a7777260ba90eccbe7919df934b" | ||
], | ||
"timestamp": "2024-01-19T10:28:35.652763852" | ||
} | ||
} |
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,75 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test Workflow main.nf" | ||
script "main.nf" | ||
|
||
test("test-dataset_cellranger_aligner") { | ||
|
||
when { | ||
// the rest is taken from shared config | ||
params { | ||
aligner = 'cellranger' | ||
outdir = "${outputDir}/results_cellranger" | ||
|
||
// Limit resources so that this can run on GitHub Actions -- for some reason it had not been taken from shared config | ||
max_cpus = 2 | ||
max_memory = '6.GB' | ||
max_time = '6.h' | ||
} | ||
} | ||
|
||
then { | ||
|
||
assertAll( | ||
|
||
// | ||
// General assertions | ||
// | ||
|
||
// Did it finish successfully? | ||
{assert workflow.success}, | ||
|
||
// How many tasks were executed? | ||
{assert workflow.trace.tasks().size() == 15}, | ||
|
||
// How many results were produced? | ||
{assert path("${outputDir}/results_cellranger").list().size() == 4}, | ||
{assert path("${outputDir}/results_cellranger/cellranger").list().size() == 4}, | ||
{assert path("${outputDir}/results_cellranger/cellranger/mtx_conversions").list().size() == 4}, | ||
{assert path("${outputDir}/results_cellranger/cellranger/count").list().size() == 3}, | ||
{assert path("${outputDir}/results_cellranger/fastqc").list().size() == 12}, | ||
{assert path("${outputDir}/results_cellranger/multiqc").list().size() == 3}, | ||
|
||
// | ||
// Check if files were produced | ||
// | ||
{assert new File( "${outputDir}/results_cellranger/cellranger/mtx_conversions/Sample_X/Sample_X_matrix.h5ad" ).exists()}, | ||
{assert new File( "${outputDir}/results_cellranger/cellranger/mtx_conversions/Sample_Y/Sample_Y_matrix.h5ad" ).exists()}, | ||
|
||
// | ||
// Check if files are the same | ||
// | ||
{assert snapshot( | ||
workflow, | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_X/outs/filtered_feature_bc_matrix/barcodes.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_X/outs/filtered_feature_bc_matrix/features.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_X/outs/filtered_feature_bc_matrix/matrix.mtx.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_Y/outs/filtered_feature_bc_matrix/barcodes.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_Y/outs/filtered_feature_bc_matrix/features.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_Y/outs/filtered_feature_bc_matrix/matrix.mtx.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_X/outs/raw_feature_bc_matrix/barcodes.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_X/outs/raw_feature_bc_matrix/features.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_X/outs/raw_feature_bc_matrix/matrix.mtx.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_Y/outs/raw_feature_bc_matrix/barcodes.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_Y/outs/raw_feature_bc_matrix/features.tsv.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/count/Sample_Y/outs/raw_feature_bc_matrix/matrix.mtx.gz" ), | ||
path( "${outputDir}/results_cellranger/cellranger/mtx_conversions/Sample_X/Sample_X_matrix.rds" ), | ||
path( "${outputDir}/results_cellranger/cellranger/mtx_conversions/Sample_Y/Sample_Y_matrix.rds" ) | ||
).match()} | ||
|
||
) // end of assertAll() | ||
|
||
} | ||
} | ||
|
||
} |
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,40 @@ | ||
{ | ||
"test-dataset_cellranger_aligner": { | ||
"content": [ | ||
{ | ||
"stderr": [ | ||
|
||
], | ||
"errorReport": "", | ||
"exitStatus": 0, | ||
"failed": false, | ||
"stdout": [ | ||
|
||
], | ||
"errorMessage": "", | ||
"trace": { | ||
"tasksFailed": 0, | ||
"tasksCount": 15, | ||
"tasksSucceeded": 15 | ||
}, | ||
"name": "workflow", | ||
"success": true | ||
}, | ||
"barcodes.tsv.gz:md5,fe6e51564b4405b37ca8604a844b1f2e", | ||
"features.tsv.gz:md5,99e453cb1443a3e43e99405184e51a5e", | ||
"matrix.mtx.gz:md5,79471f700ec5bab852a960f0d1537705", | ||
"barcodes.tsv.gz:md5,77afe9a76631fc7b44236d3962a55aa5", | ||
"features.tsv.gz:md5,99e453cb1443a3e43e99405184e51a5e", | ||
"matrix.mtx.gz:md5,e224aa759250fa5730dc069bce9be253", | ||
"barcodes.tsv.gz:md5,85da6b6e0c78dfe81af8c07c2017ab5e", | ||
"features.tsv.gz:md5,99e453cb1443a3e43e99405184e51a5e", | ||
"matrix.mtx.gz:md5,1bc71041a425bfcee38472bfec5997f8", | ||
"barcodes.tsv.gz:md5,081f72b5252ccaf5ffd535ffbd235c4c", | ||
"features.tsv.gz:md5,99e453cb1443a3e43e99405184e51a5e", | ||
"matrix.mtx.gz:md5,a4db04e43e650accc96361a287126a6b", | ||
"Sample_X_matrix.rds:md5,f9191ba575a3ab79ada4807715f18573", | ||
"Sample_Y_matrix.rds:md5,7be3f7b29d668dcf7e951b9f4d371a5e" | ||
], | ||
"timestamp": "2024-01-22T15:19:20.134275449" | ||
} | ||
} |
Oops, something went wrong.