Exemplo n.º 1
0
 internal clsSpectraSeries(IChartDataProvider provider, clsPlotParams plotParams, String filename) :
     base(provider, plotParams)
 {
     this.mFilename = filename;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Displays the scan vs. NET values for a single analysis.
        /// </summary>
        /// <param name="analysis"></param>
        private void DisplayScansVsNet(Analysis analysis)
        {
            // Either the display does not have the analysis, or the display series was reset and needs to be re-rendered
            if (!m_displayCache.ContainsKey(analysis) || m_displayCache[analysis] == null)
            {
                BubbleShape      shape      = new BubbleShape(1, false);
                clsColorIterator colors     = new clsColorIterator();
                Color            plotColor  = colors.GetColor(analysis.Id);
                clsPlotParams    parameters = new clsPlotParams(shape, plotColor, false, true, true);
                parameters.Name = analysis.Name;

                float[] ordinate = new float[analysis.Targets.Count];
                float[] abscissa = new float[analysis.Targets.Count];
                int     i        = 0;
                if (!mcheckBox_useResiduals.Checked)
                {
                    foreach (Target target in analysis.Targets)
                    {
                        if (radioButtonAverageNET.Checked)
                        {
                            ordinate[i]   = Convert.ToSingle(target.ParentTarget.GaNetAverage);
                            abscissa[i++] = Convert.ToSingle(target.Scan);
                        }
                        else
                        {
                            /// Only display predicted peptides if not using average NET
                            if (!target.IsPredicted)
                            {
                                continue;
                            }

                            ordinate[i]   = Convert.ToSingle(target.NetPredicted);
                            abscissa[i++] = Convert.ToSingle(target.Scan);
                        }
                    }
                }
                else
                {
                    foreach (Target target in analysis.Targets)
                    {
                        if (radioButtonAverageNET.Checked)
                        {
                            ordinate[i]   = Convert.ToSingle(target.ParentTarget.GaNetAverage - target.NetAligned);
                            abscissa[i++] = Convert.ToSingle(target.Scan);
                        }
                        else
                        {
                            /// Only display predicted peptides if not using average NET
                            if (!target.IsPredicted)
                            {
                                continue;
                            }

                            ordinate[i]   = Convert.ToSingle(target.NetPredicted - target.NetAligned);
                            abscissa[i++] = Convert.ToSingle(target.Scan);
                        }
                    }
                }

                clsSeries newSeries = new clsSeries(new ArrayChartDataProvider(abscissa, ordinate), parameters);
                if (!m_displayCache.ContainsKey(analysis))
                {
                    m_displayCache.Add(analysis, null);
                }
                m_displayCache[analysis] = newSeries;
            }

            clsSeries series = m_displayCache[analysis];

            ctlChartScanVsNET.SeriesCollection.Add(series);
            ctlChartScanVsNET.AutoViewPort();
        }