MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / testAASequenceTutorial

Function testAASequenceTutorial

src/pyOpenMS/tests/unittests/test_tutorial.py:88–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87@report
88def testAASequenceTutorial():
89
90 seq = AASequence.fromString("DFPIANGER")
91 prefix = seq.getPrefix(4)
92 suffix = seq.getSuffix(5)
93 concat = seq + seq
94
95 print(seq)
96 print(concat)
97 print(suffix)
98 seq.getMonoWeight() # weight of M
99 seq.getMonoWeight(Residue.ResidueType.Full, 2) # weight of M+2H
100 mz = seq.getMonoWeight(Residue.ResidueType.Full, 2) / 2.0 # m/z of M+2H
101 concat.getMonoWeight()
102
103 print("Monoisotopic m/z of (M+2H)2+ is", mz)
104
105 seq_formula = seq.getFormula()
106 print("Peptide", seq, "has molecular formula", seq_formula)
107 print("="*35)
108
109 isotopes = seq_formula.getIsotopeDistribution( CoarseIsotopePatternGenerator(6) )
110 for iso in isotopes.getContainer():
111 print ("Isotope", iso.getMZ(), ":", iso.getIntensity())
112
113 suffix = seq.getSuffix(3) # y3 ion "GER"
114 print("="*35)
115 print("y3 ion :", suffix)
116 y3_formula = suffix.getFormula(Residue.ResidueType.YIon, 2) # y3++ ion
117 suffix.getMonoWeight(Residue.ResidueType.YIon, 2) / 2.0 # CORRECT
118 suffix.getMonoWeight(Residue.ResidueType.XIon, 2) / 2.0 # CORRECT
119 suffix.getMonoWeight(Residue.ResidueType.BIon, 2) / 2.0 # INCORRECT
120 assert str(y3_formula) == "C13H24N6O6", str(y3_formula)
121 assert str(seq_formula) == "C44H67N13O15"
122
123
124 print("y3 mz :", suffix.getMonoWeight(Residue.ResidueType.YIon, 2) / 2.0 )
125 print(y3_formula)
126 print(seq_formula)
127
128 seq = AASequence.fromString("PEPTIDESEKUEM(Oxidation)CER")
129 print(seq)
130 print(seq.toString())
131 print(seq.toUnmodifiedString())
132 print(seq.toUniModString())
133 print(seq.toBracketString())
134 print(seq.toBracketString(False))
135
136 print(AASequence.fromString("DFPIAM(UniMod:35)GER"))
137 print(AASequence.fromString("DFPIAM[+16]GER"))
138 print(AASequence.fromString("DFPIAM[+15.99]GER"))
139 print(AASequence.fromString("DFPIAM[147]GER"))
140 print(AASequence.fromString("DFPIAM[147.035405]GER"))
141
142 s = AASequence.fromString(".(Dimethyl)DFPIAMGER.")
143 print(s, s.hasNTerminalModification())
144 s = AASequence.fromString(".DFPIAMGER.(Label:18O(2))")
145 print(s, s.hasCTerminalModification())

Callers

nothing calls this directly

Calls 15

storeMethod · 0.95
loadMethod · 0.95
FASTAEntryClass · 0.85
toUnmodifiedStringMethod · 0.80
toUniModStringMethod · 0.80
toBracketStringMethod · 0.80
fromStringMethod · 0.45
getPrefixMethod · 0.45

Tested by

no test coverage detected