def get_mass(self): logging.info(self.sum_formula) logging.info(pyisocalc.parseSumFormula(self.sum_formula)) spec = pyisocalc.perfect_pattern(pyisocalc.parseSumFormula(self.sum_formula), charge=0) logging.info(spec) mass = spec.get_spectrum(source='centroids')[0][np.argmax(spec.get_spectrum(source='centroids')[1])] logging.info(mass) return mass
def get_isotope_pattern(self, formula_adduct_string, charge): perfect_pattern = pyisocalc.perfect_pattern(pyisocalc.parseSumFormula(formula_adduct_string), charge=charge) sigma = self.sigma_at_mz(perfect_pattern.get_spectrum(source='centroids')[0][0]) pts_per_mz = self.points_per_mz(sigma) spec = pyisocalc.apply_gaussian(perfect_pattern, sigma, pts_per_mz) centroided_mzs, centroided_ints, _ = gradient(*spec.get_spectrum()) spec.add_centroids(centroided_mzs, centroided_ints) return spec
def get_isotope_pattern(self, formula_adduct_string, charge): perfect_pattern = pyisocalc.perfect_pattern( pyisocalc.parseSumFormula(formula_adduct_string), charge=charge) sigma = self.sigma_at_mz( perfect_pattern.get_spectrum(source='centroids')[0][0]) pts_per_mz = self.points_per_mz(sigma) spec = pyisocalc.apply_gaussian(perfect_pattern, sigma, pts_per_mz) centroided_mzs, centroided_ints, _ = gradient(*spec.get_spectrum()) spec.add_centroids(centroided_mzs, centroided_ints) return spec
def get_mass(self): logging.info(self.sum_formula) logging.info(pyisocalc.parseSumFormula(self.sum_formula)) spec = pyisocalc.perfect_pattern(pyisocalc.parseSumFormula( self.sum_formula), charge=0) logging.info(spec) mass = spec.get_spectrum(source='centroids')[0][np.argmax( spec.get_spectrum(source='centroids')[1])] logging.info(mass) return mass
def get_mz(self, adduct): """ Calculate the precursor mass for this molecule with a given adduct :param adduct: object of class Adduct :return: float """ try: formula = self.make_ion_formula(adduct) spec = pyisocalc.perfect_pattern(pyisocalc.parseSumFormula(formula), charge=adduct.charge) mass = spec.get_spectrum(source='centroids')[0][np.argmax(spec.get_spectrum(source='centroids')[1])] return mass except: logging.debug(self.name, adduct) return -1.
def get_mz(self, adduct): """ Calculate the precursor mass for this molecule with a given adduct :param adduct: object of class Adduct :return: float """ try: formula = self.make_ion_formula(adduct) spec = pyisocalc.perfect_pattern( pyisocalc.parseSumFormula(formula), charge=adduct.charge) mass = spec.get_spectrum(source='centroids')[0][np.argmax( spec.get_spectrum(source='centroids')[1])] return mass except: logging.debug(self.name, adduct) return -1.
def get_principal_peak(self, formula_adduct_string, charge): perfect_pattern = pyisocalc.perfect_pattern( pyisocalc.parseSumFormula(formula_adduct_string), charge=charge).get_spectrum(source='centroids') return perfect_pattern[0][np.argmax(perfect_pattern[1])]