Skip to content

Commit b7b415b

Browse files
committed
hotfix for ig variants
1 parent ac0946c commit b7b415b

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ga4ghphetools"
3-
version = "0.5.16"
3+
version = "0.5.17"
44
edition = "2021"
55
keywords = ["GA4GH", "Phenopacket Schema", "Human Phenotype Ontology"]
66
description = "Generate GA4GH phenopackets from tabular data"

src/etl/etl_tools.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ impl EtlTools {
611611
} else {
612612
return Err("No disease data available".to_string());
613613
};
614-
println!("process_allele_column {} - {} - {}", symbol, hgnc, transcript);
615614
let mut vmanager = VariantManager::new(&symbol, &hgnc, &transcript);
616615
let pb = |p:u32,q:u32|{ println!("{}/{} variants validated", p, q)};
617616
vmanager.validate_all_variants(&all_alleles, pb)?;

src/variant/intergenic_hgvs_validator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn get_variant_validator_url(
4949
let encoded_hgvs = urlencoding::encode(&hgvs);
5050

5151

52-
let full_url = format!("{}/{}/{}/mane?content-type=application%2Fjson",
52+
let full_url = format!("{}/{}/{}/select?content-type=application%2Fjson",
5353
BASE_URL,
5454
genome_assembly,
5555
encoded_hgvs
@@ -88,7 +88,7 @@ impl IntergenicHgvsValidator {
8888
let hgvs = &vv_dto.variant_string;
8989
let url = get_variant_validator_url(&self.genome_assembly, hgvs);
9090
let response: Value = get(&url)
91-
.map_err(|e| format!("Could not map {hgvs}: {e}"))?
91+
.map_err(|e| format!("Could not map intergenic {hgvs}: {e}"))?
9292
.json()
9393
.map_err(|e| format!("Could not parse JSON for {hgvs}: {e}"))?;
9494
let mut ig = self.from_json(response)?;
@@ -102,7 +102,7 @@ impl IntergenicHgvsValidator {
102102
pub fn from_json(&mut self, response: Value) -> Result<IntergenicHgvsVariant, String> {
103103
self.extract_variant_validator_warnings(&response)?;
104104
if let Some(flag) = response.get("flag") {
105-
if flag != "intergenic" {
105+
if flag != "gene_variant" {
106106
return Err(format!("Expecting to get an intergenic variant but got {}", flag));
107107
}
108108
}
@@ -291,7 +291,7 @@ response
291291
vvdto: VariantDto
292292
){
293293
let intergenic = "NC_000019.10:g.12887294G>A";
294-
let expected = "https://rest.variantvalidator.org/VariantValidator/variantvalidator/hg38/NC_000019.10%3Ag.12887294G%3EA/mane?content-type=application%2Fjson";
294+
let expected = "https://rest.variantvalidator.org/VariantValidator/variantvalidator/hg38/NC_000019.10%3Ag.12887294G%3EA/select?content-type=application%2Fjson";
295295
let my_url = get_variant_validator_url("hg38", intergenic);
296296
assert_eq!(expected, my_url);
297297
}

src/variant/variant_manager.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl VariantManager {
9595
} else if allele.starts_with("NC_") {
9696
if self.validate_intergenic(allele).is_ok() {
9797
n_validated += 1;
98-
}
98+
}
9999
} else if self.validate_sv(&allele).is_ok() {
100100
n_validated += 1;
101101
}
@@ -394,6 +394,7 @@ mod tests {
394394
}
395395

396396
#[test]
397+
#[ignore = "API call"]
397398
fn test_malformed_sv() {
398399
// Note this test does not make it to the API and thus does not touch the network
399400
let label = "deletion:c.[6236 + 1_6237–1]_[6432 + 1_6433–1]del";
@@ -410,6 +411,7 @@ mod tests {
410411

411412

412413
#[test]
414+
#[ignore = "API call"]
413415
fn test_intergenic() {
414416
let symbol = "KLF1";
415417
let transcript = "NM_006563.5";
@@ -422,5 +424,19 @@ mod tests {
422424
println!("{:?}", ig);
423425
}
424426

427+
#[test]
428+
#[ignore = "API call"]
429+
fn test_intergenic_TMEM216() {
430+
let symbol = "TMEM216";
431+
let transcript = "NM_001173990.3";
432+
let hgnc = "HGNC:25018";
433+
let allele = "NC_000011.10:g.61392563G>T";
434+
let mut manager = VariantManager::new(symbol, hgnc, transcript);
435+
let result = manager.get_validated_intergenic_hgvs(allele);
436+
assert!(result.is_ok());
437+
let ig = result.unwrap();
438+
println!("{:?}", ig);
439+
}
440+
425441

426442
}

0 commit comments

Comments
 (0)