Beispiel #1
0
        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);
        }
Beispiel #2
0
 public static float GetGlycanMasswithCharge(Glycan.Type argType, int argCharge)
 {
     //
     // m/z = (mass  + Proton * charge) / charge
     //     => mass/charge + Proton
     //
     return((float)((GetGlycanMass(argType) + MassLib.Atoms.ProtonMass * argCharge) / argCharge));
 }
Beispiel #3
0
        private 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);
        }
Beispiel #4
0
 public GlycanTreeForDrawer(Glycan.Type argType)
 {
     _root = argType;
     _child = new List<GlycanTreeForDrawer>();
 }
 public GlycanTreeForDrawer(Glycan.Type argType)
 {
     _root  = argType;
     _child = new List <GlycanTreeForDrawer>();
 }