Beispiel #1
0
 def test_infers_within_frame_position(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent(
             "c.3A>G").codon_frame_position(one_based=False),
         1,
     )
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent(
             "c.3A>G").codon_frame_position(one_based=True),
         3,
     )
Beispiel #2
0
 def test_negative_rna_position_error(self):
     with self.assertRaises(IndexError):
         utilities.NucleotideSubstitutionEvent("r.-100a>u")
Beispiel #3
0
 def test_parses_negative_positions(self):
     nt = utilities.NucleotideSubstitutionEvent("n.-100A>T")
     self.assertEqual(nt.position, -100)
Beispiel #4
0
 def test_parses_prefix(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1A>G").prefix, "c")
Beispiel #5
0
 def test_formats_event_string_correctly(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1A>G").event, "1A>G")
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1=").event, "1=")
Beispiel #6
0
 def test_parses_alt_base(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1A>G").alt, "G")
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1=").alt, None)
Beispiel #7
0
 def test_infers_silent(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1=").silent, True)
Beispiel #8
0
 def test_parses_ref_base(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1A>G").ref, "A")
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1=").ref, None)
Beispiel #9
0
 def test_error_negative_position_when_computing_codon_position(self):
     nt = utilities.NucleotideSubstitutionEvent("c.-1A>G")
     with self.assertRaises(ValueError):
         nt.codon_position()
     with self.assertRaises(ValueError):
         nt.codon_frame_position()
Beispiel #10
0
 def test_parses_position(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.1A>G").position, 1)
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent("c.-1A>G").position, -1)
Beispiel #11
0
 def test_strips_ws(self):
     self.assertEqual(
         utilities.NucleotideSubstitutionEvent(" c.1A>G ").variant,
         "c.1A>G")
Beispiel #12
0
 def test_error_invalid_dna_substitution_syntax(self):
     with self.assertRaises(exceptions.InvalidVariantType):
         utilities.NucleotideSubstitutionEvent("c.100_101delins")