예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
파일: models.py 프로젝트: prasadpb/curatr
 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
예제 #5
0
 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.
예제 #6
0
파일: models.py 프로젝트: prasadpb/curatr
 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.
예제 #7
0
 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])]