示例#1
0
 public GlycanStructure(Glycan argGlycan, MSPoint argPeak)
 {
     _tree = new GlycanTreeNode(argGlycan.GlycanType, _nextID);
     _nextID++;
     _y1    = argPeak;
     _IUPAC = _tree.GetIUPACString();
 }
示例#2
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;
 }
示例#3
0
 public GlycanStructure(Glycan argGlycan, float argY1)
 {
     _tree = new GlycanTreeNode(argGlycan.GlycanType, _nextID);
     _nextID++;
     _y1    = new MSPoint(argY1, 0.0f);
     _IUPAC = _tree.GetIUPACString();
 }
示例#4
0
        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);
        }
示例#5
0
        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);
            }
        }
示例#6
0
 //Constrator
 public GlycanStructure(Glycan argGlycan)
 {
     new GlycanStructure(argGlycan, 0.0f);
 }
示例#7
0
        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;
        }
示例#8
0
 public GlycanTreeForDrawer(Glycan.Type argType)
 {
     _root = argType;
     _child = new List<GlycanTreeForDrawer>();
 }