-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#730 - reformatted with black and isort
- Loading branch information
Showing
2 changed files
with
24 additions
and
16 deletions.
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
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 |
---|---|---|
@@ -1,31 +1,39 @@ | ||
import os | ||
import pytest | ||
import unittest | ||
import hgvs.dataproviders.uta | ||
import hgvs.assemblymapper | ||
|
||
import pytest | ||
from support import CACHE | ||
|
||
import hgvs.assemblymapper | ||
import hgvs.dataproviders.uta | ||
|
||
|
||
@pytest.mark.issues | ||
class Test_Issues(unittest.TestCase): | ||
''' | ||
HGVS-730 fixes an issue where AARefAlt.format() sometimes returned the three letter amino acid | ||
when the single letter format was requested. | ||
''' | ||
""" | ||
HGVS-730 fixes an issue where AARefAlt.format() sometimes returned the three letter amino acid | ||
when the single letter format was requested. | ||
""" | ||
|
||
@classmethod | ||
def setUpClass(self): | ||
self.hdp = hgvs.dataproviders.uta.connect(mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE) | ||
self.am37 = hgvs.assemblymapper.AssemblyMapper(self.hdp, replace_reference=True, assembly_name="GRCh37", alt_aln_method="splign") | ||
self.hdp = hgvs.dataproviders.uta.connect( | ||
mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE | ||
) | ||
self.am37 = hgvs.assemblymapper.AssemblyMapper( | ||
self.hdp, replace_reference=True, assembly_name="GRCh37", alt_aln_method="splign" | ||
) | ||
self.hp = hgvs.parser.Parser() | ||
|
||
def test_730_format_startloss_as_configured(self): | ||
''' | ||
Parse a start loss and make sure the one letter and three letter protein genotypes come back as expected. | ||
''' | ||
var_g = self.hp.parse_hgvs_variant('NC_000016.9:g.89985662_89985667del') | ||
var_c = self.am37.g_to_c(var_g, str('NM_002386.3')) | ||
""" | ||
Parse a start loss and make sure the one letter and three letter protein genotypes come back as expected. | ||
""" | ||
var_g = self.hp.parse_hgvs_variant("NC_000016.9:g.89985662_89985667del") | ||
var_c = self.am37.g_to_c(var_g, str("NM_002386.3")) | ||
var_p = self.am37.c_to_p(var_c) | ||
var_p_one_letter = var_p.format(conf={"p_3_letter": False}) | ||
var_p_three_letter = var_p.format(conf={"p_3_letter": True}) | ||
|
||
self.assertEqual(var_p_one_letter, "NP_002377.4:p.M1?") | ||
self.assertEqual(var_p_three_letter, "NP_002377.4:p.Met1?") |