Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generate_aa_comp():
"""
>>> aa_comp = generate_aa_comp()
>>> aa_comp["M"]
Composition({'H': 9, 'C': 5, 'S': 1, 'O': 1, 'N': 1})
>>> aa_comp["Z"]
Composition({'H': 9, 'C': 5, 'S': 1, 'O': 2, 'N': 1})
"""
db = pyteomics.mass.Unimod()
aa_comp = dict(pyteomics.mass.std_aa_comp)
s = db.by_title("Oxidation")["composition"]
aa_comp["Z"] = aa_comp["M"] + s
s = db.by_title("Carbamidomethyl")["composition"]
aa_comp["C"] = aa_comp["C"] + s
return aa_comp