public GlycanStructure(Glycan argGlycan, MSPoint argPeak) { _tree = new GlycanTreeNode(argGlycan.GlycanType, _nextID); _nextID++; _y1 = argPeak; _IUPAC = _tree.GetIUPACString(); }
public static float GetGlycanAVGMass(Glycan.Type argType) { float Mass = 0.0f; if (argType == Glycan.Type.HexNAc) { Mass = _HexNAcAVG; } else if (argType == Glycan.Type.Hex) { Mass = _HexAVG; } else if (argType == Glycan.Type.DeHex) { Mass = _DeHexAVG; } else if (argType == Glycan.Type.NeuAc) { Mass = _NeuAcAVG; } else { Mass = _NeuGcAVG; } return Mass; }
public GlycanStructure(Glycan argGlycan, float argY1) { _tree = new GlycanTreeNode(argGlycan.GlycanType, _nextID); _nextID++; _y1 = new MSPoint(argY1, 0.0f); _IUPAC = _tree.GetIUPACString(); }
public static float GetGlycanAVGMasswithCharge(Glycan.Type argType, int argCharge) { // // m/z = (mass + Proton * charge) / charge // => mass/charge + Proton // return (float)((GetGlycanAVGMass(argType) + MassLib.Atoms.ProtonMass* argCharge) / argCharge); }
public int NoOfGlycan(Glycan argGlycan) { switch (argGlycan.GlycanType) { case Glycan.Type.HexNAc: return(NoOfHex); case Glycan.Type.NeuAc: return(NoOfNeuAc); case Glycan.Type.NeuGc: return(NoOfNeuGc); case Glycan.Type.DeHex: return(NoOfDeHex); default: return(NoOfHex); } }
//Constrator public GlycanStructure(Glycan argGlycan) { new GlycanStructure(argGlycan, 0.0f); }
public Image GlycanCartoon(Glycan.Type argType) { Bitmap glycan = new Bitmap(11 ,11 ); Graphics g = Graphics.FromImage(glycan); Brush SolidBrush; Pen Linear = new Pen(Color.Black, 1.0f * _ScaleFactor); Point[] loc; switch (argType) { case Glycan.Type.DeHex: SolidBrush = new SolidBrush(Color.FromArgb(255,0,0) ); if (_isBW) { SolidBrush = new SolidBrush(Color.White); } loc = new Point[] { new Point(0, 10 ), new Point(5 , 0), new Point(10 , 10 ) }; g.FillPolygon(SolidBrush, loc); g.DrawPolygon(Linear, loc); break; case Glycan.Type.Gal: SolidBrush = new SolidBrush(Color.FromArgb(255, 255, 0)); if (_isBW) { SolidBrush = new SolidBrush(Color.White); } g.FillEllipse(SolidBrush, 0, 0, 10 * _ScaleFactor, 10 * _ScaleFactor); g.DrawEllipse(Linear, 0, 0, 10 * _ScaleFactor, 10 * _ScaleFactor); break; case Glycan.Type.HexNAc: SolidBrush = new SolidBrush(Color.FromArgb(0, 0, 250)); if (_isBW) { SolidBrush = new SolidBrush(Color.White); } g.FillRectangle(SolidBrush, 0, 0, 10 * _ScaleFactor, 10 * _ScaleFactor); g.DrawRectangle(Linear, 0, 0, 10 * _ScaleFactor, 10 * _ScaleFactor); break; case Glycan.Type.Man: SolidBrush = new SolidBrush(Color.FromArgb(0, 200, 50)); if (_isBW) { SolidBrush = new SolidBrush(Color.White); } g.FillEllipse(SolidBrush, 0, 0, 10 * _ScaleFactor, 10 * _ScaleFactor); g.DrawEllipse(Linear, 0, 0, 10 * _ScaleFactor, 10 * _ScaleFactor); break; case Glycan.Type.NeuAc: SolidBrush = new SolidBrush(Color.FromArgb(200, 0, 200)); if (_isBW) { SolidBrush = new SolidBrush(Color.White); } loc = new Point[] { new Point(0, 5 ), new Point(5 , 10 ), new Point(10 , 5 ), new Point(5 , 0) }; g.FillPolygon(SolidBrush, loc); g.DrawPolygon(Linear, loc); break; case Glycan.Type.NeuGc: SolidBrush = new SolidBrush(Color.FromArgb(233, 255, 255)); if (_isBW) { SolidBrush = new SolidBrush(Color.White); } loc = new Point[] { new Point(0, 5 ), new Point(5 , 10 ), new Point(10 , 5 ), new Point(5 , 0) }; g.FillPolygon(SolidBrush, loc); g.DrawPolygon(Linear, loc); break; } return glycan; }
public GlycanTreeForDrawer(Glycan.Type argType) { _root = argType; _child = new List<GlycanTreeForDrawer>(); }