public List <IPeptide> PeptidesFilter(ISpectrum spectrum) { List <IPeptide> peptides = new List <IPeptide>(); List <double> massList = new List <double>(); int parentCharge = (spectrum as ISpectrumMSn).GetParentCharge(); for (int i = 1; i <= parentCharge; i++) { foreach (IPeak peak in spectrum.GetPeaks()) { massList.Add(calcualtor.CalcChargeMass(peak.GetMZ(), i, option)); } } if (massList.Count > 0) { massList.Sort(); } foreach (IPeptide peptide in peptideDB) { double mass = calcualtor.CalcPeptideMass(peptide, option) + UtilMass.HexNAc; if (MassBinarySearch.FindPPM(mass, massList, matcher.GetTolerance())) { peptides.Add(peptide); } } return(peptides); }
protected bool MatchPeakGlycoPeptideMass(IPeak peak, int charge, List <double> massList) { for (int i = 1; i <= charge; i++) { double mass = calculator.CalcChargeMass(peak.GetMZ(), i, option);; // peak.GetMZ() * charge; if (MassBinarySearch.Find(mass, massList, parameter.GetTolerance())) { return(true); } } return(false); }