Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reset_modifications() -> None:
"""
Undo all static modifications and reset to the standard amino acid
monoisotopic masses.
"""
global _aa_mass
_aa_mass = mass.std_aa_mass.copy()
import operator
import warnings
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
import numba as nb
import numpy as np
from rdkit import Chem
try:
from pyteomics import cmass as mass
except ImportError:
from pyteomics import mass
from spectrum_utils import utils
_aa_mass = mass.std_aa_mass.copy()
def static_modification(amino_acid: str, mass_diff: float) -> None:
"""
Globally modify the monoisotopic mass of an amino acid to set a static
modification.
Parameters
----------
amino_acid : str
The amino acid whose monoisotopic mass is modified.
mass_diff : float
The *mass difference* to be added to the amino acid's original
monoisotopic mass.
"""
global _aa_mass