Beispiel #1
0
 def test_compound_reverse(self):
     self.feature.location = CompoundLocation([FeatureLocation(21, 27, -1),
                                               FeatureLocation(12, 15, -1),
                                               FeatureLocation(0, 6, -1)])
     assert self.get_sub(2, 3) == FeatureLocation(12, 15, -1)
Beispiel #2
0
 def test_simple_reverse(self):
     self.feature.location = FeatureLocation(10, 40, -1)
     assert self.get_sub(0, 1) == FeatureLocation(37, 40, -1)
     assert self.get_sub(2, 4) == FeatureLocation(28, 34, -1)
     assert self.get_sub(9, 10) == FeatureLocation(10, 13, -1)
Beispiel #3
0
 def test_simple_forward(self):
     assert self.get_sub(0, 1) == FeatureLocation(10, 13, 1)
     assert self.get_sub(2, 4) == FeatureLocation(16, 22, 1)
     assert self.get_sub(9, 10) == FeatureLocation(37, 40, 1)
Beispiel #4
0
 def setUp(self):
     self.feature = Feature(FeatureLocation(10, 40, 1), feature_type="test")
     self.get_sub = self.feature.get_sub_location_from_protein_coordinates
Beispiel #5
0
 def test_negative_locations(self):
     loc = FeatureLocation(-2, 500, strand=1)
     with self.assertRaisesRegex(ValueError, "negative coordinate"):
         Feature(loc, feature_type="")
Beispiel #6
0
 def test_bridging_fails(self):
     parts = [FeatureLocation(9, 12, strand=1), FeatureLocation(0, 3, strand=1)]
     with self.assertRaisesRegex(ValueError, "bridge the record origin"):
         Feature(CompoundLocation(parts, operator="join"), feature_type="test")
     Feature(CompoundLocation(parts[::-1], operator="join"), feature_type="test")