Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/nextclade-schemas/input-pathogen-json.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,14 @@
"items": {
"type": "string"
}
},
"cutoff": {
"description": "Minimizer acceptance threshold given as an exponent: the retained fraction of k-mers is `2^cutoff / 2^32`. When absent, a default cutoff is used.",
"type": [
"integer",
"null"
],
"format": "int64"
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions packages/nextclade-schemas/input-pathogen-json.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ definitions:
type: array
items:
type: string
cutoff:
description: 'Minimizer acceptance threshold given as an exponent: the retained fraction of k-mers is `2^cutoff / 2^32`. When absent, a default cutoff is used.'
type:
- integer
- 'null'
format: int64
LabelledMutationsConfig:
description: Mapping from specific mutations to human-readable labels (e.g. clade-defining or drug-resistance mutations).
examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,14 @@
"items": {
"type": "string"
}
},
"cutoff": {
"description": "Minimizer acceptance threshold given as an exponent: the retained fraction of k-mers is `2^cutoff / 2^32`. When absent, a default cutoff is used.",
"type": [
"integer",
"null"
],
"format": "int64"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ definitions:
type: array
items:
type: string
cutoff:
description: 'Minimizer acceptance threshold given as an exponent: the retained fraction of k-mers is `2^cutoff / 2^32`. When absent, a default cutoff is used.'
type:
- integer
- 'null'
format: int64
LabelledMutationsConfig:
description: Mapping from specific mutations to human-readable labels (e.g. clade-defining or drug-resistance mutations).
examples:
Expand Down
7 changes: 6 additions & 1 deletion packages/nextclade/src/analyze/virus_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ pub struct MinimizerIndexConfig {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub references: Vec<String>,

/// Minimizer acceptance threshold given as an exponent: the retained fraction of k-mers is `2^cutoff / 2^32`. When absent, a default cutoff is used.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cutoff: Option<i64>,

#[serde(flatten)]
pub other: serde_json::Value,
}
Expand Down Expand Up @@ -482,12 +486,13 @@ mod tests {

#[test]
fn test_virus_properties_parses_minimizer_index() {
let json = r#"{"schemaVersion":"3.0.0","minimizerIndex":{"references":["minimizer_refs/additional_refs.fasta"]}}"#;
let json = r#"{"schemaVersion":"3.0.0","minimizerIndex":{"references":["minimizer_refs/additional_refs.fasta"],"cutoff":31}}"#;
let props = VirusProperties::from_str(&json).unwrap();
let mi = props
.minimizer_index
.expect("minimizerIndex should parse into the typed field");
assert_eq!(vec_of_owned!["minimizer_refs/additional_refs.fasta"], mi.references);
assert_eq!(Some(31), mi.cutoff);
assert!(props.other.get("minimizerIndex").is_none());
}

Expand Down
Loading