protected bool Criteria(IGlycan glycan) { int[] composition = glycan.GetStructure(); return(composition[0] <= HexNAcBound && composition[1] <= HexBound && composition[2] <= FucBound && composition[3] <= NeuAcBound && composition[4] <= NeuGcBound); }
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 double Compute(IGlycan glycan) { if (permethylation) { return(PermethylatedGlycanMass(glycan)); } return(NativeGlycanMass(glycan)); }
public double Compute(IGlycan glycan) { if (permethylation) { return(CalcPermGlycanMass(glycan)); } return(CalcSingleGlycanMass(glycan)); }
public double CalcGlycanMass(IGlycan glycan, ICalcMassOption option) { if (option.ExistsPermethylation()) { return(CalcPermGlycanMass(glycan, option)); } return(CalcSingleGlycanMass(glycan, option)); }
public NGlycanPeak(bool permethylated = true, int HexNAc = 2, int Hex = 3, int Fuc = 0, int NeuAc = 0, int NeuGc = 0) { glycan = new NGlycan(permethylated, HexNAc, Hex, Fuc, NeuAc, NeuGc); distrib = Brain.Run.Distribute(glycan.Formula(), order); int extra = distrib.IndexOf(distrib.Max()); peak = glycan.Mass() + neutron * extra; }
public double Compute(IGlycan glycan, IonType type) { double mass = GlycanCalcMass.Instance.Compute(glycan); switch (type) { case IonType.yIon: break; } return(mass); }
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 <double> ComputeComplex(IGlycan glycan) { List <double> massList = new List <double>(); ITableNGlycan nglycan = glycan as ITableNGlycan; int[] table = nglycan.GetNGlycanTable(); double mass = table[4] * HexNAc + table[8] * Hex + table[12] * Fuc + table[16] * NeuAc + table[20] * NeuGc; massList.Add(mass); massList.Add(mass + Hex); massList.Add(mass + Hex * 2); massList.Add(mass + Hex * 2 + HexNAc); massList.Add(mass + Hex * 2 + HexNAc * 2); return(massList); }
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); }
bool Satisify(string identified_glycan_id, IGlycan glycan) { int[] identified_glycan_table = glycans_map_[identified_glycan_id].Table(); int[] candidate_glycan_table = glycan.Table(); if (identified_glycan_table.Count() != candidate_glycan_table.Count()) { return(false); } for (int i = 0; i < identified_glycan_table.Length; i++) { if (candidate_glycan_table[i] < identified_glycan_table[i]) { return(false); } } // check terminal if (identified_glycan_table.Count() == 24) { for (int i = 0; i < 4; i++) { if ((identified_glycan_table[12 + i] > 0 || identified_glycan_table[16 + i] > 0 ) && identified_glycan_table[4 + i] != candidate_glycan_table[4 + i]) { return(false); } } } else if (identified_glycan_table.Count() == 16) { for (int i = 0; i < 2; i++) { if ((identified_glycan_table[10 + i] > 0 || identified_glycan_table[12 + i] > 0 ) && identified_glycan_table[6 + i] != candidate_glycan_table[6 + i]) { return(false); } } } return(true); }
bool SatisfyCriteria(IGlycan glycan) { int hexNAc = 0, hex = 0, fuc = 0, neuAc = 0, neuGc = 0; SortedDictionary <Monosaccharide, int> composite = glycan.Composition(); foreach (var key in composite.Keys) { switch (key) { case Monosaccharide.GlcNAc: hexNAc += composite[key]; break; case Monosaccharide.Gal: hex += composite[key]; break; case Monosaccharide.Man: hex += composite[key]; break; case Monosaccharide.Fuc: fuc += composite[key]; break; case Monosaccharide.NeuAc: neuAc += composite[key]; break; case Monosaccharide.NeuGc: neuGc += composite[key]; break; default: break; } } return(hexNAc <= hexNAc_ && hex <= hex_ && fuc <= fuc_ && neuAc <= neuAc_ && neuGc <= neuGc_); }
private double PermethylatedGlycanMass(IGlycan glycan) { double mass = 0; SortedDictionary <Monosaccharide, int> composite = glycan.Composition(); foreach (var monosaccharide in composite.Keys) { switch (monosaccharide) { case Monosaccharide.GlcNAc: mass += kPermHexNAc * composite[monosaccharide]; break; case Monosaccharide.Gal: mass += kPermHex * composite[monosaccharide]; break; case Monosaccharide.Man: mass += kPermHex * composite[monosaccharide]; break; case Monosaccharide.Fuc: mass += kPermFuc * composite[monosaccharide]; break; case Monosaccharide.NeuAc: mass += kPermNeuAc * composite[monosaccharide]; break; case Monosaccharide.NeuGc: mass += kPermNeuGc * composite[monosaccharide]; break; default: break; } } return(mass); }
protected abstract List <T> GenerateNewGlycoPeptide(IPeptide peptide, IGlycan glycan);
private double CalcPermGlycanMass(IGlycan glycan) { int[] compos = glycan.GetStructure(); return(compos[0] * PermHexNAc + compos[1] * PermHex + compos[2] * PermFuc + compos[3] * PermNeuAc + compos[4] * PermNeuGc); }
private double CalcSingleGlycanMass(IGlycan glycan) { int[] compos = glycan.GetStructure(); return(compos[0] * HexNAc + compos[1] * Hex + compos[2] * Fuc + compos[3] * NeuAc + compos[4] * NeuGc); }
protected override List <IGlycoPeptide> GenerateNewGlycoPeptide(IPeptide peptide, IGlycan glycan) { List <IGlycoPeptide> glycos = new List <IGlycoPeptide>(); glycos.Add(new GeneralGlycoPeptide(peptide, glycan, -1)); return(glycos); }
public GlycoPeptideTemplate(IPeptide peptide, IGlycan glycan, int pos) { this.peptide = peptide; this.glycan = glycan; this.position = pos; }
public GeneralGlycanMassProxy(IGlycan glycan) { this.glycan = glycan; }
public void Build() { Queue <IGlycan> queue = new Queue <IGlycan>(); IGlycan root; if (ComplexInclude) { root = new NGlycanComplex(); queue.Enqueue(root); } if (HybridInclude) { root = new NGlycanHybrid(); queue.Enqueue(root); } if (HighMannoseInclude) { root = new NHighMannose(); queue.Enqueue(root); } while (queue.Count > 0) { IGlycan node = queue.Peek(); queue.Dequeue(); // update table id double mass = util.mass.Glycan.To.Compute(node); string table_id = node.ID(); node.SetMass(mass); if (!glycans_.ContainsKey(mass)) { glycans_[mass] = new List <string>(); } glycans_[mass].Add(table_id); // next foreach (var it in candidates_) { List <IGlycan> res = node.Grow(it); foreach (var g in res) { if (SatisfyCriteria(g)) { string id = g.ID(); if (!glycans_map_.ContainsKey(id)) { node.Add(g); glycans_map_[id] = g; queue.Enqueue(glycans_map_[id]); } else { node.Add(glycans_map_[id]); } } } } } }
List <PeakNode> DynamicProgramming(List <IPeak> peaks, Dictionary <double, PeakNode> peak_nodes_map, PriorityQueue <PeakNode> queue) { List <PeakNode> matched_nodes = new List <PeakNode>(); while (queue.Count > 0) { // get node PeakNode node = queue.Dequeue(); // // match peaks double target = node.Mass(); List <int> matched = searcher_.Search(target); // max if matched a peak node.Max(peaks); // update matches if (matched.Count > 0) { node.Add(matched); node.set_miss(0); matched_nodes.Add(node); } if (node.Missing() > kMissing) { continue; } // extending queue Dictionary <string, Dictionary <string, HashSet <int> > > peakMatch = node.Matches(); foreach (var peptide in peakMatch.Keys.ToList()) { foreach (var glycan_id in peakMatch[peptide].Keys.ToList()) { List <int> peak_indexes = peakMatch[peptide][glycan_id].ToList(); IGlycan glycan = glycans_map_[glycan_id]; foreach (var g in glycan.Children()) { double mass = g.Mass() + util.mass.Peptide.To.Compute(peptide); if (!peak_nodes_map.ContainsKey(mass)) { PeakNode next = new PeakNode(); // set mass next.set_mass(mass); // set matches next.Add(peptide, g.ID(), peak_indexes); // set missing next.set_miss(node.Missing() + 1); // add node peak_nodes_map[mass] = next; // enqueue queue.Enqueue(mass, peak_nodes_map[mass]); } else { // std::cout << "here" << std::endl; PeakNode next = peak_nodes_map[mass]; // set missing next.set_miss(Math.Min(next.Missing(), node.Missing() + 1)); // set matches next.Add(peptide, g.ID(), peak_indexes); } } } } } return(matched_nodes); }
public void SetGlycan(IGlycan glycan) { glycoPeptide.SetGlycan(glycan); }
public GeneralGlycoPeptide(IPeptide peptide, IGlycan glycan, int pos) { this.peptide = peptide; this.glycan = glycan; this.position = pos; }
public double CalcGlycanYIonMass(IGlycan glycan, ICalcMassOption option) { return(CalcGlycanMass(glycan, option) + Oxygen + Hydrogen * 2); }
public void AddGlycoPeptide(IPeptide peptide, IGlycan glycan, int pos) { glycoPeptides.Add(new GeneralGlycoPeptide(peptide, glycan, pos)); }
public void Add(IGlycan glycan) { glycans.Add(glycan); }
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); }
public void SetGlycan(IGlycan glycan) { this.glycan = (T)glycan; }
public GlycanPoint(IGlycan glycan) { this.glycan = glycan; mass = GlycanCalcMass.Instance.Compute(glycan); }