public IGlycoPeptideProxy Generate(IGlycan glycan, IPeptide peptide, int modifySite) { if (glycan is ITableNGlycanMassProxy) { IGlycoPeptide glycoPeptide = new GeneralGlycoPeptide(glycan, peptide, modifySite); IGlycoPeptideMassProxy glycoPeptideMassProxy = new GeneralGlycoPeptideMassProxy(glycoPeptide); foreach (double glycanMass in (glycan as ITableNGlycanMassProxy).GetMass()) { glycoPeptideMassProxy.AddMass(glycanMass + PeptideCalcMass.Instance.Compute(glycoPeptide.GetPeptide()), MassType.Branch); } foreach (double glycanMass in (glycan as ITableNGlycanMassProxy).GetCoreMass()) { glycoPeptideMassProxy.AddMass(glycanMass + PeptideCalcMass.Instance.Compute(glycoPeptide.GetPeptide()), MassType.Core); } glycoPeptideMassProxy.AddRangeMass(SingaturePeakCalcMass.Instance.ComputeComplex(glycan), MassType.Glycan); double mass = GlycanCalcMass.Instance.Compute(glycan); foreach (double peptideMass in PTMPeptideCalcMass.Compute(peptide.GetSequence(), modifySite)) { glycoPeptideMassProxy.AddMass(mass + peptideMass, MassType.Peptide); } return(glycoPeptideMassProxy); } else { throw new InvalidCastException("Can not cast to ITableNGlycanMassProxy"); } }
public List <IGlycoPeptide> Create(IGlycan glycan, IPeptide peptide) { List <IGlycoPeptide> glycoPeptides = new List <IGlycoPeptide>(); foreach (int pos in FindPTMPosition.FindNGlycanSite(peptide.GetSequence())) { glycoPeptides.Add(new GeneralGlycoPeptide(peptide, glycan, pos)); } return(glycoPeptides); }
GenerateNewGlycoPeptide(IPeptide peptide, IGlycan glycan) { List <IAccumulatedGlycoPeptideMassProxy> glycos = new List <IAccumulatedGlycoPeptideMassProxy>(); foreach (int pos in FindPTMPosition.FindNGlycanSite(peptide.GetSequence())) { SpecialGlycoPeptide <IAccumulatedGlycanMassProxy> g = new SpecialGlycoPeptide <IAccumulatedGlycanMassProxy>(peptide, glycan as IAccumulatedGlycanMassProxy, pos); glycos.Add(new GeneralAccumulatedGlycoPeptideMassProxy(g)); } return(glycos); }
public List <IGlycoPeptide> Create(IGlycan glycan, IPeptide peptide) { List <IGlycoPeptide> glycoPeptides = new List <IGlycoPeptide>(); foreach (int pos in FindPTMPosition.FindNGlycanSite(peptide.GetSequence())) { try { IGlycoPeptideProxy glycoPeptideProxy = generator.Generate(glycan, peptide, pos); glycoPeptides.Add(glycoPeptideProxy); } catch (Exception e) { Console.WriteLine(e.Message); } } return(glycoPeptides); }
public string GetID() { return(glycan.GetName() + peptide.GetSequence()); }
public double Compute(IPeptide peptide, IonType type) { return(ComputePeptide(peptide.GetSequence(), type)); }
public double Compute(IPeptide peptide) { return(Compute(peptide.GetSequence())); }
public double CalcPeptideIonMass(IPeptide peptide, IonType type, ICalcMassOption option) { return(CalcPeptideIonMass(peptide.GetSequence(), type, option)); }
protected void InitMatcher(IGlycoPeptide glycoPeptide) { List <Point> points = new List <Point>(); List <ITableNGlycan> glycans = glycansTable[ glycoPeptide.GetGlycan().GetName()]; IPeptide peptide = glycoPeptide.GetPeptide(); string seq = peptide.GetSequence(); int pos = glycoPeptide.GetPosition(); Dictionary <double, BinSearchAnnotatedPoint> seen = new Dictionary <double, BinSearchAnnotatedPoint>(); //glycanfrag foreach (ITableNGlycan g in glycans) { double glycanMass = calculator.CalcGlycanMass(g, option); double mass = calculator.CalcPeptideMass(seq, option) + glycanMass; if (!seen.ContainsKey(mass)) { BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass); seen[mass] = p; points.Add(p); } seen[mass].AddGlycoPeptide( new GeneralPeptide(peptide.GetID(), seq), g, pos); //n-peptidefrag for (int i = 0; i < pos; i++) { mass = calculator.CalcPeptideIonMass( seq.Substring(0, i + 1), IonType.cIon, option) + glycanMass; if (!seen.ContainsKey(mass)) { BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass); seen[mass] = p; points.Add(p); } seen[mass].AddGlycoPeptide( new GeneralPeptide(peptide.GetID(), seq.Substring(0, i + 1)), g, pos); } //c-peptidefrag for (int i = pos + 1; i < seq.Length; i++) { mass = calculator.CalcPeptideIonMass( seq.Substring(i, seq.Length - i), IonType.zIon, option) + glycanMass; if (!seen.ContainsKey(mass)) { BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass); seen[mass] = p; points.Add(p); } seen[mass].AddGlycoPeptide( new GeneralPeptide(peptide.GetID(), seq.Substring(i, seq.Length - i)), g, pos); } } points.Sort(); matcher.SetPoints(points); }
public double CalcPeptideMass(IPeptide peptide, ICalcMassOption option) { string sequence = peptide.GetSequence(); return(CalcPeptideMass(sequence, option)); }