def min_mass(self): b = mass.get_aa_mass(self.peptide[0]) if self.peptide[0] == 'C': b += 57.02146 y = mass.get_aa_mass(self.peptide[self.length - 1]) if self.peptide[self.length - 1] == 'C': y += 57.02146 return min(b, y)
def max_mass(self): b = 0 y = 0 for i in range(self.length - 1): b += mass.get_aa_mass(self.peptide[i]) if self.peptide[i] == 'C': b += 57.02146 y += mass.get_aa_mass(self.peptide[i + 1]) if self.peptide[i + 1] == 'C': y += 57.02146 return max(b, y)
def max_peak_mass(self, fragmentation_site, ion_type): if fragmentation_site <= 0 or fragmentation_site >= self.length: return 0 peak_mass = 0 if ion_type == 'b': for i in range(fragmentation_site): if self.peptide[i] == 'C': peak_mass += 57.02146 peak_mass += mass.get_aa_mass(self.peptide[i]) elif ion_type == 'y': for i in range(fragmentation_site, self.length): if self.peptide[i] == 'C': peak_mass += 57.02146 peak_mass += mass.get_aa_mass(self.peptide[i]) return self.max - peak_mass
def relative_peak_mass(self, fragmentation_site, ion_type): if fragmentation_site <= 0 or fragmentation_site >= self.length: return 0 peak_mass = 0 if ion_type == 'b': for i in range(fragmentation_site): if self.peptide[i] == 'C': peak_mass += 57.02146 peak_mass += mass.get_aa_mass(self.peptide[i]) elif ion_type == 'y': for i in range(fragmentation_site, self.length): if self.peptide[i] == 'C': peak_mass += 57.02146 peak_mass += mass.get_aa_mass(self.peptide[i]) # (peak_mass - min peak) / (max peak - min peak) return (peak_mass - self.min_peak_mass(fragmentation_site, ion_type))\ / (self.max_peak_mass(fragmentation_site, ion_type) - self.min_peak_mass(fragmentation_site, ion_type))