コード例 #1
0
ファイル: test_feature.py プロジェクト: APengs494/antismash
 def test_invalid_codon_start(self):
     seqf = SeqFeature(FeatureLocation(5, AfterPosition(12), -1))
     seqf.type = "test"
     for codon_start in ["-1", "4", "NA"]:
         seqf.qualifiers["codon_start"] = [codon_start]
         with self.assertRaisesRegex(ValueError, "invalid codon_start"):
             Feature.from_biopython(seqf)
コード例 #2
0
ファイル: test_feature.py プロジェクト: APengs494/antismash
 def test_biopython_conversion(self):
     bio = SeqFeature(FeatureLocation(1, 5))
     bio.qualifiers["foo"] = ["bar"]
     bio.qualifiers["key_only"] = None
     # check that features without types are caught
     with self.assertRaisesRegex(ValueError, "invalid length"):
         sec = Feature.from_biopython(bio)
     bio.type = "test"
     sec = Feature.from_biopython(bio)
     assert sec.get_qualifier("foo") == tuple(["bar"])
     assert sec.get_qualifier("bar") is None
     assert sec.get_qualifier("key_only") is True
コード例 #3
0
ファイル: test_feature.py プロジェクト: APengs494/antismash
 def test_conversion_with_codon_start_reverse(self):
     seqf = SeqFeature(FeatureLocation(5, AfterPosition(12), -1))
     seqf.type = "test"
     for codon_start in "123":
         seqf.qualifiers["codon_start"] = [codon_start]
         feature = Feature.from_biopython(seqf)
         assert feature._original_codon_start == int(codon_start) - 1
         assert feature.location.end == AfterPosition(12 - feature._original_codon_start)
         new = feature.to_biopython()[0]
         assert new.qualifiers["codon_start"] == [codon_start]
         assert new.location.start == seqf.location.start
         assert new.location.end == seqf.location.end