How to use the pyteomics.cmass.std_aa_mass function in pyteomics

To help you get started, we’ve selected a few pyteomics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bittremieux / spectrum_utils / spectrum_utils / spectrum.py View on Github external
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()
github bittremieux / spectrum_utils / spectrum_utils / spectrum.py View on Github external
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