-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
327e46b
commit 95c0f5c
Showing
2 changed files
with
156 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
nextflow_pipeline { | ||
|
||
name "Integration Tests of adjusting gm_thresholds parameters" | ||
script "main.nf" | ||
|
||
test("Test fail pipeline if null threshold set") { | ||
tag "pipeline_failure_null_threshold" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = null | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert workflow.stdout.contains("ERROR ~ --gm_thresholds null: Cannot pass null or empty string") | ||
} | ||
} | ||
|
||
test("Test fail pipeline if empty threshold set") { | ||
tag "pipeline_failure_no_threshold" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = "" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert workflow.stdout.contains("ERROR ~ --gm_thresholds : Cannot pass null or empty string") | ||
} | ||
} | ||
|
||
test("Test fail pipeline if negative threshold set") { | ||
tag "pipeline_failure_negative_threshold" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = "-1" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert workflow.stderr.contains('* --gm_thresholds: string [-1] does not match pattern ^(\\d+(\\.\\d+)?,)*\\d+(\\.\\d+)?$ (-1)') | ||
} | ||
} | ||
|
||
test("Test fail pipeline if mismatch between thresholds and scaled distm") { | ||
tag "pipeline_failure_threshold_scaled" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = "1,0.5,2" | ||
pd_distm = "scaled" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert workflow.stdout.contains("ERROR ~ '--pd_distm scaled' is set, but '--gm_thresholds 1,0.5,2' contains thresholds outside of range [0,1]." | ||
+ " Please either set '--pd_distm hamming' or adjust the threshold values.") | ||
} | ||
} | ||
|
||
test("Test fail pipeline if mismatch between thresholds and hamming distm") { | ||
tag "pipeline_failure_threshold_hamming" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = "2,1,0.5" | ||
pd_distm = "hamming" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert workflow.stdout.contains("ERROR ~ '--pd_distm hamming' is set, but '--gm_thresholds 2,1,0.5' contains fractions." | ||
+ " Please either set '--pd_distm scaled' or remove fractions from distance thresholds.") | ||
} | ||
} | ||
|
||
test("Test pipeline with single threshold set to 1") { | ||
tag "pipeline_thresh_1" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = "1" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert (workflow.stdout =~ /Error \[1.0\] supplied thresholds do not equal the number of threshold columns in reference_clusters.txt/).find() | ||
} | ||
} | ||
|
||
test("Test pipeline with threshold set to 1,0") { | ||
tag "pipeline_thresh_1.0" | ||
|
||
when { | ||
params { | ||
input = "$baseDir/tests/data/samplesheets/samplesheet1.csv" | ||
outdir = "results" | ||
|
||
gm_thresholds = "1,0" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.failed | ||
assert (workflow.stdout =~ /Error \[1.0, 0.0\] supplied thresholds do not equal the number of threshold columns in reference_clusters.txt/).find() | ||
} | ||
} | ||
} |
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