def test_result_vec_to_features(self):
     "Test lassopeptides.result_vec_to_features()"
     orig_feature = DummyCDS(0, 165, strand=1, locus_tag='FAKE0001')
     seq = "TAILTAILTAILTAILTAILTAILTAILTAILTAILCCTIP"
     vec = Lassopeptide(23, 42, 51, "HEADHEADHEAD", seq)
     vec.c_cut = "TIP"
     motif = result_vec_to_motif(orig_feature, vec)
     assert motif.locus_tag == "FAKE0001"
     assert motif.location == orig_feature.location
     assert motif.leader == "HEADHEADHEAD"
     assert motif.tail == "TIP"
     assert motif.core == seq[:-len(motif.tail)]
     assert motif.detailed_information.num_bridges == 1
     assert motif.peptide_subclass == "Class III"
     assert motif.detailed_information.rodeo_score == 51
     assert motif.score == 42
     assert motif.detailed_information.macrolactam == ""
     self.assertAlmostEqual(motif.monoisotopic_mass, 4103.5, delta=1)
     self.assertAlmostEqual(motif.molecular_weight, 4106.1, delta=1)
     self.assertAlmostEqual(motif.detailed_information.cut_mass,
                            3792.3,
                            delta=1)
     self.assertAlmostEqual(motif.detailed_information.cut_weight,
                            3794.7,
                            delta=1)
Exemple #2
0
 def test_molecular_weight(self):
     "Test Lassopeptide.molecular_weight"
     lasso = Lassopeptide(23, 42, 17, 51, "lead", "MAGICHATTIP")
     lasso.c_cut = "TIP"
     analysis = ProteinAnalysis("MAGICHATTIP", monoisotopic=False)
     cut_analysis = ProteinAnalysis("MAGICHAT", monoisotopic=False)
     mw = analysis.molecular_weight() - 18.02
     cut_mw = cut_analysis.molecular_weight() - 18.02
     self.assertAlmostEqual(mw, lasso.molecular_weight)
     self.assertAlmostEqual(cut_mw, lasso.cut_weight)