Skip to content

Commit

Permalink
feat: porting over test_variantmapper_cp_real (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Feb 28, 2023
1 parent 0eff9b4 commit 5352c7d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
19 changes: 19 additions & 0 deletions src/mapper/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,25 @@ mod test {

Ok(())
}

// The following tests correspond to the tests in `test_hgvs_variantmapper_cp_real.py`.

#[test]
fn hgvs_c_to_p_format() -> Result<(), anyhow::Error> {
let mapper = build_mapper()?;
let hgvs_c = "NM_022464.4:c.3G>A"; // gene SIL1
// let hgvsp_expected_alternative = "NP_071909.1:p.?";

let var_c = HgvsVariant::from_str(hgvs_c)?;
let var_p = mapper.c_to_p(&var_c, None)?;
assert_eq!(format!("{}", &var_p), "NP_071909.1:p.Met1?");

// TODO(#25): implement formatting of display and uncomment
// alt_format_p = var_p.format(conf={"p_init_met": False})
// self.assertEqual(hgvsp_expected_alternative, alt_format_p)

Ok(())
}
}

// <LICENSE>
Expand Down
1 change: 1 addition & 0 deletions tests/data/data/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ OPA1
OR9A4
PTH2
RET
SIL1
SRD5A2
SSTR3
EOF
Expand Down
4 changes: 2 additions & 2 deletions tests/data/data/uta_20210129-subset.pgd.gz
Git LFS file not shown
4 changes: 2 additions & 2 deletions tests/data/seqrepo_cache.fasta
Git LFS file not shown

0 comments on commit 5352c7d

Please sign in to comment.