Пример #1
0
        public static void MakeGeneLengthDistro()
        {
            try
            {
                UpdateLog("Scanning annotation element lengths..", true);

                Dictionary <string, List <double> > tdict = Genome.GetAllElementLengths();

                UpdateLog("Making Distributions..", true);
                MultiHisto mHist = new MultiHisto(tdict, 50, ModelDisplayType.Bar);

                PlotModel model = new PlotModel {
                    Title = "Annotation Element Lengths in Base-Pairs"
                };
                LinearAxis axX = new LinearAxis(AxisPosition.Bottom, 0, mHist.GetXPercentLimit(0.90), "Length (BP)");
                LinearAxis axY = new LinearAxis(AxisPosition.Left, 0, mHist.GetYPercentLimit(0.95), "Density");
                model.TitlePadding    = 10;
                axX.AxisTitleDistance = 10;
                axY.AxisTitleDistance = 10;
                model.Axes.Add(axX);
                model.Axes.Add(axY);

                mHist.AddToModel(model);

                model.IsLegendVisible = true;

                MainWindow.InsertGraph(GraphWindow.Gene, model, mHist);
                UpdateLog("Made a length distribution graph in the Gene tab.", true);

                ProgramState.MadeGeneGraph = true;
            }
            catch (Exception e) {
                ShowMessageWindow(e.Message, true);
            }
        }
Пример #2
0
        public static void MakeMethyCovDepthScoreDistro()
        {
            try
            {
                UpdateLog("Calculating annotation element read depth-coverage scores..", true);

                Dictionary <string, List <double> > tdict = Genome.GetAllElementDepthScores();

                UpdateLog("Making Distributions..", true);
                MultiHisto mHist = new MultiHisto(tdict, 100, ModelDisplayType.Line);

                PlotModel model = new PlotModel {
                    Title = "Annotation Element per-base read coverage depth"
                };
                LinearAxis axX = new LinearAxis(AxisPosition.Bottom, 0, mHist.GetXPercentLimit(0.9), "Read depth-coverage of element");
                LinearAxis axY = new LinearAxis(AxisPosition.Left, 0, mHist.GetYPercentLimit(1), "Density");
                model.TitlePadding    = 10;
                axX.AxisTitleDistance = 10;
                axY.AxisTitleDistance = 10;
                model.Axes.Add(axX);
                model.Axes.Add(axY);

                mHist.AddToModel(model);

                model.IsLegendVisible = true;

                MainWindow.InsertGraph(GraphWindow.Meth, model, mHist);
                UpdateLog("Made a depth-coverage score graph in the SAM-read tab.", true);

                ProgramState.MadeMethGraph = true;
            }
            catch (Exception e) {
                ShowMessageWindow(e.Message, true);
            }
        }
Пример #3
0
        public static void MakeMultiHistoRankGraph(Dictionary <string, List <double> > data, GraphWindow grWind,
                                                   string xLab, string yLab, string title, RSplitContainer <double> rsc, bool mergeOld)
        {
            try
            {
                UpdateLog("Making Odds ratios..", true);

                MultiHisto mHist = new MultiHisto(data, 100, ModelDisplayType.Line);
                PlotModel  model = new PlotModel {
                    Title = title
                };
                LinearAxis axX = new LinearAxis(AxisPosition.Bottom, 0, mHist.GetXPercentLimit(1) + 1, xLab);
                LinearAxis axY = new LinearAxis(AxisPosition.Left, 0, mHist.GetYPercentLimit(1), yLab);

                model.TitlePadding    = 10;
                axX.AxisTitleDistance = 10;
                axY.AxisTitleDistance = 10;
                model.Axes.Add(axX);
                model.Axes.Add(axY);

                mHist.AddToModel(model);

                if (mergeOld && RSPToMergeSeries != null)
                {
                    foreach (Series sr in RSPToMergeSeries)
                    {
                        model.Series.Add(sr);
                    }
                }
                else
                {
                    if (RSPToMergeSeries != null)
                    {
                        RSPToMergeSeries.Clear();
                    }
                }
                RSPToMergeSeries.AddRange(mHist.GetNextSeries(title.Split(' ')[0]));

                model.IsLegendVisible = true;

                MainWindow.InsertGraph(grWind, model, mHist);
                MainWindow.SetRSplitDoubleContainer(rsc);
                UpdateLog("Made a density-based Rank/Split graph...", true);

                ProgramState.MadeGlobalGraph = true;
            }
            catch (Exception e) {
                ShowMessageWindow(e.Message, true);
            }
        }
Пример #4
0
        public static void MakeGeneBaseRatio()
        {
            try
            {
                UpdateLog("Scanning base ratios for each included genomic annotation/element..", true);

                Dictionary <string, List <double> > tdict = Genome.FindAllElementBaseRatios();

                UpdateLog("Making Distributions..", true);
                MultiHisto mHist = new MultiHisto(tdict, 50, ModelDisplayType.Line);

                PlotModel model = new PlotModel {
                    Title = "Annotation Element Base Ratios: CG / (CG + AT)"
                };
                LinearAxis axX = new LinearAxis(AxisPosition.Bottom, 0, 1, "Ratio");
                LinearAxis axY = new LinearAxis(AxisPosition.Left, 0, mHist.GetYPercentLimit(1), "Density");
                //LogarithmicAxis
                model.TitlePadding    = 10;
                axX.AxisTitleDistance = 10;
                axY.AxisTitleDistance = 10;
                model.Axes.Add(axX);
                model.Axes.Add(axY);

                mHist.AddToModel(model);

                model.IsLegendVisible   = true;
                model.LegendItemSpacing = 10;

                MainWindow.InsertGraph(GraphWindow.Gene, model, mHist);
                UpdateLog("Made a base ratio graph in the Gene tab,", true);

                ProgramState.MadeGeneGraph = true;
            } catch (Exception e) {
                ShowMessageWindow(e.Message, true);
            }
        }