public double CalcPeptideIonMass(string peptide, IonType type, ICalcMassOption option) { double mass = CalcPeptideMass(peptide, option); //with an addtional h2o switch (type) { case IonType.aIon: mass = mass - Oxygen * 2 - Hydrogen - Carbon; break; case IonType.bIon: mass = mass - Oxygen - Hydrogen; break; case IonType.cIon: mass = mass - Oxygen + Hydrogen * 2 + Nitrogen; // + 0.02337;//- Oxygen + Hydrogen * 2 + Nitrogen; break; case IonType.xIon: mass += Carbon + Oxygen - Hydrogen; break; case IonType.yIon: mass += Hydrogen; break; case IonType.zIon: mass = mass - Nitrogen - Hydrogen * 2; //- 16.01807;//- Nitrogen - Hydrogen * 2; break; } return(mass); }
public Y1PeptidesFilterPrecursorMatcher(IPrecursorMatcher matcher, List <IPeptide> peptides) { this.matcher = matcher; peptideDB = peptides; calcualtor = UtilMass.Instance; option = UtilMassOption.Instance; }
public PrecursorMatcherByBinSearchOnPeptidesTemplate(List <IPeptide> peptides, List <IGlycan> glycans, PrecursorParameter parameter) { matcher = new BinarySearch(); this.parameter = parameter; peptidePoints = new List <Point>(); calculator = UtilMass.Instance; option = UtilMassOption.Instance; this.glycans = glycans; // build points on peptides Dictionary <double, PrecursorPoint <IPeptide> > seen = new Dictionary <double, PrecursorPoint <IPeptide> >(); foreach (IPeptide peptide in peptides) { double mass = calculator.CalcPeptideMass(peptide, option); if (!seen.ContainsKey(mass)) { PrecursorPoint <IPeptide> pt = new PrecursorPoint <IPeptide>(mass); seen[mass] = pt; peptidePoints.Add(pt); } seen[mass].Add(peptide); } matcher.SetPoints(peptidePoints); }
public PrecursorMatcherByBinSearchOnGlycansTemplate(List <IPeptide> peptides, List <IGlycan> glycans, double tol) { matcher = new BinarySearch(); parameter = new PrecursorParameter(tol); glycanPoints = new List <Point>(); calculator = UtilMass.Instance; option = UtilMassOption.Instance; this.peptides = peptides; // build points on glycans Dictionary <double, PrecursorPoint <IGlycan> > seen = new Dictionary <double, PrecursorPoint <IGlycan> >(); foreach (IGlycan glycan in glycans) { double mass = calculator.CalcGlycanMass(glycan, option); if (!seen.ContainsKey(mass)) { PrecursorPoint <IGlycan> pt = new PrecursorPoint <IGlycan>(mass); seen[mass] = pt; glycanPoints.Add(pt); } seen[mass].Add(glycan); } matcher.SetPoints(glycanPoints); }
public double CalcGlycanMass(IGlycan glycan, ICalcMassOption option) { if (option.ExistsPermethylation()) { return(CalcPermGlycanMass(glycan, option)); } return(CalcSingleGlycanMass(glycan, option)); }
public BinSearchSpectrumEThcD(double tol = 20) { calculator = UtilMass.Instance; option = UtilMassOption.Instance; parameter = new BinSearchSpectrumEThcDParameter(tol); alpha = 1.0; beta = 0.0; }
public BinSearchSpectrumEThcD(ISearchParameter parameter) { calculator = UtilMass.Instance; option = UtilMassOption.Instance; this.parameter = parameter; alpha = 1.0; beta = 0.0; }
public TableNGlycanAccumulatedGlycanMassProxy(ITableNGlycan glycan) { this.glycan = glycan; calculator = UtilMass.Instance; option = UtilMassOption.Instance; massTable = new HashSet <double>(); massTable.Add(calculator.CalcGlycanMass(glycan, option)); }
public NGlycoPeptideNode(ITableNGlycan nGlycan, IPeptide peptide, IScore score) { glycan = nGlycan.TableClone(); this.peptide = peptide.Clone(); this.score = score.Clone(); calculator = UtilMass.Instance; option = UtilMassOption.Instance; mass = calculator.CalcGlycanMass(glycan, option) + calculator.CalcPeptideMass(peptide, option); }
public void Run() { //AccumulatedStructBruteForceNGlycanCreator creator = new AccumulatedStructBruteForceNGlycanCreator(); //creator.Generate(); ////http://db.systemsbiology.net:8080/proteomicsToolkit/FragIonServlet.html IPeptide peptide = new GeneralPeptide("test", "VVLHPNYSQVD"); //IPeptide peptide = new GeneralPeptide("test", "SRNLTK"); //IPeptide peptide = new GeneralPeptide("test", "LCPDCPLLAPLNDSR"); ICalcMass calculator = UtilMass.Instance; ICalcMassOption option = UtilMassOption.Instance; //double mass = calculator.CalcPeptideMass(peptide, option); //1154.63213937 // //double mass = calculator.CalcPeptideMass(peptide, option); //double mass = calculator.CalcPeptideIonMass("CHS", IonType.xIon, option); //Console.WriteLine(mass); //double mass = calculator.CalcPeptideIonMass("VVLHPNYSQV", IonType.cIon, option); //Console.WriteLine(mass); //mass = calculator.CalcPeptideIonMass("CHS", IonType.zIon, option); //Console.WriteLine(mass); //IGlycan glycan = new GeneralGlycan(6, 7, 2, 3, 0); IGlycan glycan = new GeneralGlycan(1, 0, 0, 0, 0); //option.SetPermethylation(true); double mass = calculator.CalcPeptideMass(peptide, option); mass += calculator.CalcGlycanMass(glycan, option); //mass = calculator.CalcGlycanYIonMass(glycan, option); //peptide = new GeneralPeptide("1", "EPTIDE"); //mass = calculator.CalcPeptideIonMass(peptide, IonType.xIon, option); //Console.WriteLine((mass+Hydrogen)/1); //peptide = new GeneralPeptide("1", "TIDE"); //mass = calculator.CalcPeptideIonMass(peptide, IonType.xIon, option); //Console.WriteLine((mass+Hydrogen)/1); //2322.82285937 Console.WriteLine(mass); Console.WriteLine(mass / 1.0 + Hydrogen); //Console.WriteLine(calculator.CalcPPM(mass, 329.09256)); Console.Read(); }
public double CalcPeptideMass(string sequence, ICalcMassOption option) { double mass = 18.0105; //water foreach (char s in sequence) { if (s == 'C') { mass += 57.02146; } mass += GetAminoAcidMW(s); } return(mass); }
protected void Constructor(List <IAccumulatedGlycanStructureProxy> glycans) { glycansTable = new Dictionary <string, List <ITableNGlycan> >(); calculator = UtilMass.Instance; option = UtilMassOption.Instance; matcher = new BinarySearch(); foreach (IAccumulatedGlycanStructureProxy g in glycans) { string id = g.GetName(); if (!glycansTable.ContainsKey(id)) { glycansTable[id] = new List <ITableNGlycan>(); } glycansTable[id].AddRange(g.GetSubTreeGlycans()); } }
public GeneralAccumulatedGlycoPeptideMassProxy( SpecialGlycoPeptide <IAccumulatedGlycanMassProxy> glycoPeptide) { calculator = UtilMass.Instance; option = UtilMassOption.Instance; mass = new HashSet <double>(); this.glycoPeptide = glycoPeptide; foreach (double glycanMass in (glycoPeptide.GetGlycan() as IAccumulatedGlycanMassProxy).GetMass()) { foreach (double peptideMass in CalcPTMPeptideMass.GetNGlycanPeptideMass( GetPeptide().GetSequence(), GetPosition())) { mass.Add(glycanMass + peptideMass); } mass.Add(glycanMass + calculator.CalcPeptideMass(glycoPeptide.GetPeptide(), option)); } mass.UnionWith(CalcPTMPeptideMass.GetNonGlycanPeptideMass(GetPeptide().GetSequence(), GetPosition())); massList = mass.ToList(); massList.Sort(); }
public double CalcGlycanYIonMass(IGlycan glycan, ICalcMassOption option) { return(CalcGlycanMass(glycan, option) + Oxygen + Hydrogen * 2); }
public FDREThcDGlycoPeptideSearchEngine() { initializer = new GeneralGlycoPeptideSearchEngineInitalizer(); calculator = UtilMass.Instance; option = UtilMassOption.Instance; }
public double CalcPeptideMass(IPeptide peptide, ICalcMassOption option) { string sequence = peptide.GetSequence(); return(CalcPeptideMass(sequence, option)); }
public double CalcChargeMass(double mz, int charge, ICalcMassOption options) { return((mz - options.GetChargeIon()) * charge); }
public double CalcPeptideIonMass(IPeptide peptide, IonType type, ICalcMassOption option) { return(CalcPeptideIonMass(peptide.GetSequence(), type, option)); }
protected double CalcPermGlycanMass(IGlycan glycan, ICalcMassOption option) { int[] compos = glycan.GetStructure(); return(compos[0] * PermHexNAc + compos[1] * PermHex + compos[2] * PermFuc + compos[3] * PermNeuAc + compos[4] * PermNeuGc); }