Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Data to the FastMatch Pipeline #2

Merged
merged 9 commits into from
Dec 12, 2024
8 changes: 4 additions & 4 deletions assets/samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json
sample,fastmatch_category,mlst_alleles
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json
7 changes: 7 additions & 0 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
"pattern": "^\\S+\\.mlst(\\.subtyping)?\\.json(\\.gz)?$",
"errorMessage": "MLST JSON file from locidex report, cannot contain spaces and must have the extension: '.mlst.json', '.mlst.json.gz', '.mlst.subtyping.json', or 'mlst.subtyping.json.gz'"
},
"fastmatch_category": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the specific behaviour of this column may need a bit further discussion later on, but is something we can leave for this PR (and likely for this sprint to get feedback from others).

Specifically, on the nextflow side, the data in this column is being moved into the meta object for each sample. However, we cannot use the keyword "meta" in this schema JSON file, since that is used by IRIDA Next to load data from the metadata table in IRIDA Next.

I think it would make most sense to actually use the "meta" keyword in this JSON file, but maybe change the behaviour of IRIDA Next somehow? Or, to allow loading of a metadata column OR user-entered values to set query/reference samples.

However, as this is a more complex use case it requires further discussion. So this is good as-is now. I just wanted to make a note here about this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the my question, the issue was sort of raised. Might be worth a formal discussion, I agree. I did not like my work around.

"type": "string",
"errorMessage": "Has to be either query or reference",
"description": "Identify whether a sample is query or reference",
"fa_icon": "far fa-sticky-note",
"enum": ["query", "reference"]
},
"metadata_1": {
"type": "string",
"meta": ["metadata_1"],
Expand Down
5 changes: 0 additions & 5 deletions conf/iridanext.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ iridanext {
files {
idkey = "irida_id"
global = [
"**/ArborView/arborview.clustered_data_arborview.html",
"**/clusters/gas.mcluster.clusters.text",
"**/clusters/gas.mcluster.run.json",
"**/clusters/gas.mcluster.thresholds.json",
"**/clusters/gas.mcluster.tree.nwk",
"**/distances/profile_dists.allele_map.json",
"**/distances/profile_dists.query_profile.text",
"**/distances/profile_dists.ref_profile.text",
Expand Down
8 changes: 3 additions & 5 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ params {
validationShowHiddenParams = false
validate_params = true

// FastMatch
threshold = 1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a big thing, but I was thinking about how my output script is handling this and I was assuming it was an integer (hamming distances). We'll have to remember to accommodate both integers and floats with this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's if scaled is provided it can be a float. Am I correct @apetkau?


// Profile dists args
pd_outfmt = "matrix"
pd_distm = "hamming"
Expand All @@ -54,11 +57,6 @@ params {
pd_columns = null
pd_count_missing = false

// GAS Cluster
gm_thresholds = "10,5,0"
gm_method = "average"
gm_delimiter = "."

// Metadata
metadata_1_header = "metadata_1"
metadata_2_header = "metadata_2"
Expand Down
46 changes: 17 additions & 29 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@
},
"fa_icon": "far fa-clipboard"
},
"fastmatch": {
"title": "FastMatch",
"type": "object",
"description": "Parameters for FastMatch",
"default": "",
"properties": {
"threshold": {
"type": "number",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! 8de39dd

"description": "Comparison score threshold value",
"default": 1.0,
"minimum": 0
}
}
},
"profile_dists": {
"title": "Profile Dists",
"type": "object",
Expand Down Expand Up @@ -168,32 +182,6 @@
}
}
},
"gas_cluster": {
"title": "GAS Cluster",
"type": "object",
"description": "",
"default": "Parameters for GAS mcluster",
"properties": {
"gm_thresholds": {
"type": "string",
"default": "10,5,0",
"description": "Thresholds delimited by ','. Values should match units from '--pd_distm' (either 'hamming' or 'scaled').",
"pattern": "^(\\d+(\\.\\d+)?,)*\\d+(\\.\\d+)?$"
},
"gm_method": {
"type": "string",
"default": "average",
"description": "Clustering linkage method.",
"enum": ["single", "average", "complete"]
},
"gm_delimiter": {
"type": "string",
"default": ".",
"description": "Delimiter desired for nomenclature code. Must be alphanumeric or one of [._-].",
"pattern": "^[A-Fa-f0-9\\._-]+$"
}
}
},
"institutional_config_options": {
"title": "Institutional config options",
"type": "object",
Expand Down Expand Up @@ -353,13 +341,13 @@
"$ref": "#/definitions/input_output_options"
},
{
"$ref": "#/definitions/metadata"
"$ref": "#/definitions/fastmatch"
},
{
"$ref": "#/definitions/profile_dists"
"$ref": "#/definitions/metadata"
},
{
"$ref": "#/definitions/gas_cluster"
"$ref": "#/definitions/profile_dists"
},
{
"$ref": "#/definitions/institutional_config_options"
Expand Down
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-addsamplename.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,sample_name,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,S 1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sample2,S2#,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sample3,S2_,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
sample,fastmatch_category,sample_name,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,S 1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sample2,query,S2#,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sample3,reference,S2_,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-hamming.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hamming/sample1.mlst.subtyping.json,,,,,,,,
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hamming/sample2.mlst.subtyping.json,,,,,,,,
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hamming/sample3.mlst.subtyping.json,,,,,,,,
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hamming/sample1.mlst.subtyping.json,,,,,,,,
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hamming/sample2.mlst.subtyping.json,,,,,,,,
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hamming/sample3.mlst.subtyping.json,,,,,,,,
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-hash-missing.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample1.mlst.subtyping.json,,,,,,,,
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample2.mlst.subtyping.json,,,,,,,,
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample3.mlst.subtyping.json,,,,,,,,
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample1.mlst.subtyping.json,,,,,,,,
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample2.mlst.subtyping.json,,,,,,,,
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample3.mlst.subtyping.json,,,,,,,,
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-hash-more-missing.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample1.mlst.subtyping.json,,,,,,,,
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample2.mlst.subtyping.json,,,,,,,,
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample3-more-missing.mlst.subtyping.json,,,,,,,,
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample1.mlst.subtyping.json,,,,,,,,
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample2.mlst.subtyping.json,,,,,,,,
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/case-hash-missing/sample3-more-missing.mlst.subtyping.json,,,,,,,,
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-little-metadata.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,,,,1.4,,,,
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,,,,,,,,
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,,,,,,3.8
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,,,,1.4,,,,
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,,,,,,,,
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,,,,,,3.8
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-mismatched-ids.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sampleA,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sampleB,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sampleC,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sampleA,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sampleB,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sampleC,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-no-metadata.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,,,,,,,,
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,,,,,,,,
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,,,,,,,,
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,,,,,,,,
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,,,,,,,,
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,,,,,,,,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sampleA,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sampleB,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sampleA,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sampleB,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet-tabs.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,a b,,,,,,,
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,,,,a b,,,,
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,,,,,,,,a b
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,a b,,,,,,,
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,,,,a b,,,,
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,,,,,,,,a b
8 changes: 4 additions & 4 deletions tests/data/samplesheets/samplesheet1.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sample2,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sample3,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
sample,fastmatch_category,mlst_alleles,metadata_1,metadata_2,metadata_3,metadata_4,metadata_5,metadata_6,metadata_7,metadata_8
sample1,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample1.mlst.json,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8
sample2,query,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample2.mlst.json,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8
sample3,reference,https://raw.githubusercontent.com/phac-nml/gasclustering/dev/tests/data/reports/sample3.mlst.json,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8
20 changes: 0 additions & 20 deletions tests/pipelines/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ nextflow_pipeline {
outdir = "results"

pd_distm = "scaled"
gm_thresholds = "50,20,0"

metadata_1_header = "myheader_1"
metadata_2_header = "myheader_2"
Expand Down Expand Up @@ -59,7 +58,6 @@ nextflow_pipeline {
input = "$baseDir/tests/data/samplesheets/samplesheet-hamming.csv"
outdir = "results"

gm_thresholds = "2,1,0"
}
}

Expand Down Expand Up @@ -188,24 +186,6 @@ nextflow_pipeline {
}
}

test("Test fail pipeline if invalid delimiter set") {
tag "pipeline_failure_invalid_delimiter"

when {
params {
input = "$baseDir/tests/data/samplesheets/samplesheet-hamming.csv"
outdir = "results"

gm_delimiter = ';'
}
}

then {
assert workflow.failed
assert workflow.stderr.contains('* --gm_delimiter: string [;] does not match pattern ^[A-Fa-f0-9\\._-]+$ (;)')
}
}

test("Full pipeline with no metadata") {
tag "pipeline_no_metadata"

Expand Down
94 changes: 0 additions & 94 deletions tests/pipelines/main_gm_thresholds.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,100 +3,6 @@ nextflow_pipeline {
name "Integration Tests of adjusting gm_thresholds parameter for clustering"
script "main.nf"

test("Test fail pipeline if null threshold set") {
tag "pipeline_failure_null_threshold"

when {
params {
input = "$baseDir/tests/data/samplesheets/samplesheet-hamming.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/samplesheet-hamming.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/samplesheet-hamming.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/samplesheet-hamming.csv"
outdir = "results"

gm_thresholds = "200,50"
pd_distm = "scaled"
}
}

then {
assert workflow.failed
assert workflow.stdout.contains("ERROR ~ '--pd_distm scaled' is set, but '--gm_thresholds 200,50' contains thresholds outside of range [0, 100]."
+ " 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/samplesheet-hamming.csv"
outdir = "results"

gm_thresholds = "2,0.5"
pd_distm = "hamming"
}
}

then {
assert workflow.failed
assert workflow.stdout.contains("ERROR ~ '--pd_distm hamming' is set, but '--gm_thresholds 2,0.5' contains fractions."
+ " Please either set '--pd_distm scaled' or remove fractions from distance thresholds.")
}
}

test("Test pipeline with single threshold set to 0") {
tag "pipeline_thresh_0"

Expand Down
Loading
Loading