def test_alignmentmapper_failures(self):
     with self.assertRaises(HGVSDataNotAvailableError):
         AlignmentMapper(self.hdp,
                         tx_ac="bogus",
                         alt_ac="NM_033089.6",
                         alt_aln_method="splign")
     with self.assertRaises(HGVSDataNotAvailableError):
         AlignmentMapper(self.hdp,
                         tx_ac="bogus",
                         alt_ac="NM_033089.6",
                         alt_aln_method="transcript")
     with self.assertRaises(HGVSDataNotAvailableError):
         AlignmentMapper(self.hdp,
                         tx_ac="NM_033089.6",
                         alt_ac="bogus",
                         alt_aln_method="splign")
     with self.assertRaises(HGVSDataNotAvailableError):
         AlignmentMapper(self.hdp,
                         tx_ac="NM_000051.3",
                         alt_ac="NC_000011.9",
                         alt_aln_method="bogus")
     with self.assertRaises(HGVSInvalidIntervalError):
         AlignmentMapper(self.hdp, 'NM_000348.3',
                         'NC_000002.11', 'splign').n_to_g(
                             self.parser.parse_n_interval("-1"))
     with self.assertRaises(HGVSInvalidIntervalError):
         AlignmentMapper(self.hdp, 'NM_000348.3',
                         'NC_000002.11', 'splign').n_to_c(
                             self.parser.parse_n_interval("-1"))
     with self.assertRaises(HGVSInvalidIntervalError):
         AlignmentMapper(self.hdp, 'NM_000348.3', 'NC_000002.11',
                         'splign').c_to_n(
                             self.parser.parse_c_interval("99999"))
示例#2
0
 def test_alignmentmapper_AlignmentMapper_LCE3C_uncertain(self):
     """Use NM_178434.2 tests to test mapping with uncertain positions"""
     tx_ac = "NM_178434.2"
     alt_ac = "NC_000001.10"
     tm = AlignmentMapper(self.hdp, tx_ac, alt_ac, alt_aln_method="splign")
     parser = hgvs.parser.Parser()
     test_cases = [
     # ? is not yet supported
     # {"g": parser.parse_g_interval("(?_152573139)"), "n": parser.parse_n_interval("(?_2)"), "c": parser.parse_c_interval("(?_-69)")},
     # {"g": parser.parse_g_interval("(152573138_?)"), "n": parser.parse_n_interval("(1_?)"), "c": parser.parse_c_interval("(-70_?)")},
     ]
     self.run_cases(tm, test_cases)
示例#3
0
 def test_alignmentmapper_AlignmentMapper_LCE3C(self):
     """NM_178434.2: LCE3C single exon, strand = +1, all coordinate input/output are in HGVS"""
     tx_ac = "NM_178434.2"
     alt_ac = "NC_000001.10"
     tm = AlignmentMapper(self.hdp, tx_ac, alt_ac, alt_aln_method="splign")
     parser = hgvs.parser.Parser()
     test_cases = [
     # 5'
         {
             "g": parser.parse_g_interval("152573138"),
             "n": parser.parse_n_interval("1"),
             "c": parser.parse_c_interval("-70")
         },
         {
             "g": parser.parse_g_interval("152573140"),
             "n": parser.parse_n_interval("3"),
             "c": parser.parse_c_interval("-68")
         },
     # cds
         {
             "g": parser.parse_g_interval("152573207"),
             "n": parser.parse_n_interval("70"),
             "c": parser.parse_c_interval("-1")
         },
         {
             "g": parser.parse_g_interval("152573208"),
             "n": parser.parse_n_interval("71"),
             "c": parser.parse_c_interval("1")
         },
     # 3'
         {
             "g": parser.parse_g_interval("152573492"),
             "n": parser.parse_n_interval("355"),
             "c": parser.parse_c_interval("285")
         },
         {
             "g": parser.parse_g_interval("152573493"),
             "n": parser.parse_n_interval("356"),
             "c": parser.parse_c_interval("*1")
         },
         {
             "g": parser.parse_g_interval("152573560"),
             "n": parser.parse_n_interval("423"),
             "c": parser.parse_c_interval("*68")
         },
         {
             "g": parser.parse_g_interval("152573562"),
             "n": parser.parse_n_interval("425"),
             "c": parser.parse_c_interval("*70")
         },
     ]
     self.run_cases(tm, test_cases)
示例#4
0
 def test_alignmentmapper_AlignmentMapper_HIST3H2A(self):
     """NM_033445.2: LCE3C single exon, strand = -1, all coordinate input/output are in HGVS"""
     tx_ac = "NM_033445.2"
     alt_ac = "NC_000001.10"
     tm = AlignmentMapper(self.hdp, tx_ac, alt_ac, alt_aln_method="splign")
     parser = hgvs.parser.Parser()
     test_cases = [
     # 3'
         {
             "g": parser.parse_g_interval("228645560"),
             "n": parser.parse_n_interval("1"),
             "c": parser.parse_c_interval("-42")
         },
         {
             "g": parser.parse_g_interval("228645558"),
             "n": parser.parse_n_interval("3"),
             "c": parser.parse_c_interval("-40")
         },
     # cds
         {
             "g": parser.parse_g_interval("228645519"),
             "n": parser.parse_n_interval("42"),
             "c": parser.parse_c_interval("-1")
         },
         {
             "g": parser.parse_g_interval("228645518"),
             "n": parser.parse_n_interval("43"),
             "c": parser.parse_c_interval("1")
         },
     # 5'
         {
             "g": parser.parse_g_interval("228645126"),
             "n": parser.parse_n_interval("435"),
             "c": parser.parse_c_interval("393")
         },
         {
             "g": parser.parse_g_interval("228645125"),
             "n": parser.parse_n_interval("436"),
             "c": parser.parse_c_interval("*1")
         },
         {
             "g": parser.parse_g_interval("228645124"),
             "n": parser.parse_n_interval("437"),
             "c": parser.parse_c_interval("*2")
         },
         {
             "g": parser.parse_g_interval("228645065"),
             "n": parser.parse_n_interval("496"),
             "c": parser.parse_c_interval("*61")
         },
     ]
     self.run_cases(tm, test_cases)
示例#5
0
 def test_alignmentmapper_AlignmentMapper_PTH2(self):
     """NM_178449.3: PTH2, two exons, strand = -1, all coordinate input/output are in HGVS"""
     tx_ac = "NM_178449.3"
     alt_ac = "NC_000019.9"
     tm = AlignmentMapper(self.hdp, tx_ac, alt_ac, alt_aln_method="splign")
     parser = hgvs.parser.Parser()
     test_cases = [
     # 3'
         {
             "g": parser.parse_g_interval("49926698"),
             "n": parser.parse_n_interval("1"),
             "c": parser.parse_c_interval("-102")
         },
     # cds
         {
             "g": parser.parse_g_interval("49926597"),
             "n": parser.parse_n_interval("102"),
             "c": parser.parse_c_interval("-1")
         },
         {
             "g": parser.parse_g_interval("49926596"),
             "n": parser.parse_n_interval("103"),
             "c": parser.parse_c_interval("1")
         },
     # around end of exon 1
         {
             "g": parser.parse_g_interval("49926469"),
             "n": parser.parse_n_interval("230"),
             "c": parser.parse_c_interval("128")
         },
         {
             "g": parser.parse_g_interval("49926468"),
             "n": parser.parse_n_interval("230+1"),
             "c": parser.parse_c_interval("128+1")
         },
     # span
         {
             "g": parser.parse_g_interval("49925901_49926467"),
             "n": parser.parse_n_interval("230+2_231-2"),
             "c": parser.parse_c_interval("128+2_129-2")
         },
     # around beginning of exon 2
         {
             "g": parser.parse_g_interval("49925900"),
             "n": parser.parse_n_interval("231-1"),
             "c": parser.parse_c_interval("129-1")
         },
         {
             "g": parser.parse_g_interval("49925899"),
             "n": parser.parse_n_interval("231"),
             "c": parser.parse_c_interval("129")
         },
     # around end of exon 2
         {
             "g": parser.parse_g_interval("49925725"),
             "n": parser.parse_n_interval("405"),
             "c": parser.parse_c_interval("303")
         },
         {
             "g": parser.parse_g_interval("49925724"),
             "n": parser.parse_n_interval("406"),
             "c": parser.parse_c_interval("*1")
         },
         {
             "g": parser.parse_g_interval("49925671"),
             "n": parser.parse_n_interval("459"),
             "c": parser.parse_c_interval("*54")
         },
     ]
     self.run_cases(tm, test_cases)
示例#6
0
 def test_alignmentmapper_AlignmentMapper_LCE2B(self):
     """NM_014357.4: LCE2B, two exons, strand = +1, all coordinate input/output are in HGVS"""
     tx_ac = "NM_014357.4"
     alt_ac = "NC_000001.10"
     tm = AlignmentMapper(self.hdp, tx_ac, alt_ac, alt_aln_method="splign")
     parser = hgvs.parser.Parser()
     test_cases = [
     # 5'
         {
             "g": parser.parse_g_interval("152658599"),
             "n": parser.parse_n_interval("1"),
             "c": parser.parse_c_interval("-54")
         },
         {
             "g": parser.parse_g_interval("152658601"),
             "n": parser.parse_n_interval("3"),
             "c": parser.parse_c_interval("-52")
         },
     # cds
         {
             "g": parser.parse_g_interval("152659319"),
             "n": parser.parse_n_interval("54"),
             "c": parser.parse_c_interval("-1")
         },
         {
             "g": parser.parse_g_interval("152659320"),
             "n": parser.parse_n_interval("55"),
             "c": parser.parse_c_interval("1")
         },
     # around end of exon 1
         {
             "g": parser.parse_g_interval("152658632"),
             "n": parser.parse_n_interval("34"),
             "c": parser.parse_c_interval("-21")
         },
         {
             "g": parser.parse_g_interval("152658633"),
             "n": parser.parse_n_interval("34+1"),
             "c": parser.parse_c_interval("-21+1")
         },
     # span
         {
             "g": parser.parse_g_interval("152658633_152659299"),
             "n": parser.parse_n_interval("34+1_35-1"),
             "c": parser.parse_c_interval("-21+1_-20-1")
         },
     # around beginning of exon 2
         {
             "g": parser.parse_g_interval("152659300"),
             "n": parser.parse_n_interval("35"),
             "c": parser.parse_c_interval("-20")
         },
         {
             "g": parser.parse_g_interval("152659299"),
             "n": parser.parse_n_interval("35-1"),
             "c": parser.parse_c_interval("-20-1")
         },
     # around end of exon 2
         {
             "g": parser.parse_g_interval("152659652"),
             "n": parser.parse_n_interval("387"),
             "c": parser.parse_c_interval("333")
         },
         {
             "g": parser.parse_g_interval("152659653"),
             "n": parser.parse_n_interval("388"),
             "c": parser.parse_c_interval("*1")
         },
     # span
         {
             "g": parser.parse_g_interval("152659651_152659654"),
             "n": parser.parse_n_interval("386_389"),
             "c": parser.parse_c_interval("332_*2")
         },
     # 3'
         {
             "g": parser.parse_g_interval("152659877"),
             "n": parser.parse_n_interval("612"),
             "c": parser.parse_c_interval("*225")
         },
     ]
     self.run_cases(tm, test_cases)