def test_too_many_in_circular(self, _patched_bridge): features = [ SeqFeature(build_compound([(10, 30), (0, 9)], -1), type="CDS"), SeqFeature(build_compound([(10, 30), (0, 9)], -1), type="gene"), SeqFeature(build_compound([(10, 30), (0, 9)], -1), type="CDS") ] with self.assertRaisesRegex(ValueError, "inconsistent exon ordering"): self.check(features, circular=True)
def test_inconsistent(self): features = [ SeqFeature(build_compound([(10, 30), (40, 70)], -1), type="CDS"), SeqFeature(build_compound([(40, 70), (10, 30)], -1), type="gene"), SeqFeature(build_compound([(40, 70), (10, 30)], None), type="other") ] with self.assertRaisesRegex(ValueError, "inconsistent exon ordering"): self.check(features)
def test_reversed(self): features = [ SeqFeature(build_compound([(10, 30), (40, 70)], -1), type="CDS"), SeqFeature(build_compound([(10, 30), (40, 70)], -1), type="gene"), SeqFeature(build_compound([(40, 70), (10, 30)], None), type="other") ] self.check(features) for feature in features: assert feature.location.parts[0].start == 40
def test_overlapping_exons(self, _patched_overlap): features = [SeqFeature(FeatureLocation(5, 8, 1))] with self.assertRaisesRegex(ValueError, "contains overlapping exons"): self.check(features)
def test_outside_seq(self): features = [SeqFeature(FeatureLocation(50, 140, 1))] with self.assertRaisesRegex(ValueError, "feature outside record sequence"): self.check(features)