public void PlotBoxPlots(clsBoxPlotPar clsBoxPlotPar) // this will be called from the plot forms. // thus the reason to be public { if (mtabControlData.Controls.Count != 0) { #region Hook Threading events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_BoxPlotCompleted; #endregion var boxPlotParams = new frmBoxPlotPar(clsBoxPlotPar); var res = boxPlotParams.ShowDialog(); if (res == DialogResult.OK) { mclsBoxPlotPar = boxPlotParams.clsBoxPlotPar; var boxPlot = new clsRplotData(mclsBoxPlotPar.Rcmd, "Box"); m_BackgroundWorker.RunWorkerAsync(boxPlot); mfrmShowProgress.Reset("Generating the Box Plot ..."); mfrmShowProgress.ShowDialog(); } #region Unhook Threading events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_BoxPlotCompleted; #endregion } }
public void PlotMA(clsMAplotsPar plotOptions) // this will be called from the plot forms. // thus the reason to be public { if (mDataTab.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_MAplotCompleted; #endregion var maPlotParams = new frmMAplotsPar(plotOptions); var res = maPlotParams.ShowDialog(); if (res == DialogResult.OK) { mclsMApar = maPlotParams.clsMAplotPar; var maPlot = new clsRplotData(mclsMApar.RCommand, "MA"); m_BackgroundWorker.RunWorkerAsync(maPlot); mProgressForm.Reset("Generating MA Plots ..."); mProgressForm.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_MAplotCompleted; #endregion } }
// this will be called from the plot forms. // thus the reason to be public public void PlotBoxPlots(clsBoxPlotPar clsBoxPlotPar) { if (mtabControlData.Controls.Count != 0) { #region Hook Threading events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_BoxPlotCompleted; #endregion var mfrmBoxplotPar = new frmBoxPlotPar(clsBoxPlotPar); var res = mfrmBoxplotPar.ShowDialog(); if (res == DialogResult.OK) { mclsBoxPlotPar = mfrmBoxplotPar.clsBoxPlotPar; var mclsRplots = new clsRplotData(mclsBoxPlotPar.Rcmd, "Box"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating the Box Plot ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_BoxPlotCompleted; #endregion } }
// this will be called from the plot forms. // thus the reason to be public public void PlotCorrelation(clsCorrelationPar clsCorrPar) { if (mtabControlData.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_CorrPlotCompleted; #endregion frmCorrelationPar mfrmCorrPar; mfrmCorrPar = new frmCorrelationPar(clsCorrPar); DialogResult res = mfrmCorrPar.ShowDialog(); if (res == DialogResult.OK) { mclsCorrPar = mfrmCorrPar.clsCorrPar; var mclsRplots = new clsRplotData(mclsCorrPar.Rcmd, "Corr"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating Correlation Plot ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_CorrPlotCompleted; #endregion } }
public void PlotVenn(clsVennPar vennParameters) { if (mDataTab.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_VennCompleted; #endregion var vennDiagramParams = new frmVennDiagramPar(vennParameters); var res = vennDiagramParams.ShowDialog(); if (res == DialogResult.OK) { vennParameters = vennDiagramParams.clsVennPar; var vennDiagramPlot = new clsRplotData(vennParameters.RCommand, "Venn"); m_BackgroundWorker.RunWorkerAsync(vennDiagramPlot); mProgressForm.Reset("Generating Venn Diagram ..."); mProgressForm.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_VennCompleted; #endregion } }
void m_BackgroundWorker_GenerateHeatmap(object sender, DoWorkEventArgs e) { DataTable mDTclusters = new DataTable(); clsRplotData arg = (clsRplotData)e.Argument; string rcmd = arg.mstrRcmd; string plotname = arg.mstrPlotName; clsPlotResult mclsPlotResult; try { rConnector.rdcom.EvaluateNoReturn(rcmd); if (doClust) { if (rConnector.GetTableFromRvector("clusterResults")) { mDTclusters = rConnector.mDataTable.Copy(); mDTclusters.TableName = "clusterResults"; AddDataset2HashTable(mDTclusters); } } rConnector.rdcom.EvaluateNoReturn("cat(\"Heatmap done.\n\")"); mclsPlotResult = new clsPlotResult(LoadImage(tempFile), plotname); e.Result = mclsPlotResult; } catch (Exception ex) { MessageBox.Show("RDCOM failed: " + ex.Message, "Error!"); e.Result = null; e.Cancel = true; DeleteTempFile(tempFile); } }
public void PlotHeatmap(clsHeatmapPar mclsHmapPar) { if (mtabControlData.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GenerateHeatmap; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_HeatMapCompleted; #endregion var mfrmHmapPar = new frmHeatMapPar(mclsHmapPar) { maxRowCount = maxRow }; var res = mfrmHmapPar.ShowDialog(); if (res == DialogResult.OK) { mclsHeatmapPar = mfrmHmapPar.clsHmapPar; doClust = mfrmHmapPar.DoClust; var mclsRplots = new clsRplotData(mclsHeatmapPar.Rcmd, "Hmap"); Add2AnalysisHTable(mclsHeatmapPar, "Heatmap_Clustering"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating Heatmap ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GenerateHeatmap; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_HeatMapCompleted; #endregion } }
public void PlotQQ(clsQQPar clsQQPar) // this will be called from the plot forms. // thus the reason to be public { if (mtabControlData.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_QQPlotCompleted; #endregion var mfrmQQPar = new frmQQPar(clsQQPar); var res = mfrmQQPar.ShowDialog(); if (res == DialogResult.OK) { mclsQQPar = mfrmQQPar.clsQQPar; var mclsRplots = new clsRplotData(clsQQPar.Rcmd, "QQ"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating Q-Q Plots ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_QQPlotCompleted; #endregion } }
public void PlotQQ(clsQQPar clsQQPar) // this will be called from the plot forms. // thus the reason to be public { if (mDataTab.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_QQPlotCompleted; #endregion var qqParams = new frmQQPar(clsQQPar); var res = qqParams.ShowDialog(); if (res == DialogResult.OK) { mclsQQPar = qqParams.clsQQPar; var qqPlot = new clsRplotData(clsQQPar.RCommand, "QQ"); m_BackgroundWorker.RunWorkerAsync(qqPlot); mProgressForm.Reset("Generating Q-Q Plots ..."); mProgressForm.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_QQPlotCompleted; #endregion } }
public void PlotVenn(clsVennPar vennParameters) { if (mtabControlData.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_VennCompleted; #endregion var mfrmVennPar = new frmVennDiagramPar(vennParameters); var res = mfrmVennPar.ShowDialog(); if (res == DialogResult.OK) { vennParameters = mfrmVennPar.clsVennPar; var mclsRplots = new clsRplotData(vennParameters.Rcmd, "Venn"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating Venn Diagram ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_VennCompleted; #endregion } }
/// <summary> /// This will be called from the plot forms. thus the reason to be public /// </summary> /// <param name="mclsPCA"></param> public void PlotPCA(clsPCAplotPar pcaPlottingOptions) { if (mDataTab.Controls.Count == 0) { return; } #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_PCAPlotCompleted; #endregion var frmPCA = new frmPCAplotPar(pcaPlottingOptions); if (mhtDatasets.ContainsKey("Factors")) { var factorTable = mhtDatasets["Factors"]; if (factorTable.mDTable.Columns.Count - 1 == pcaPlottingOptions.Datasets.Count) { frmPCA.PopulateFactorComboBox = clsDataTable.DataTableRows(factorTable.mDTable); } else { frmPCA.PopulateFactorComboBox = null; } } else { frmPCA.PopulateFactorComboBox = null; } if (frmPCA.ShowDialog() == DialogResult.OK) { mPCAOptions = frmPCA.PCAOptions; var pcaPlots = new clsRplotData(mPCAOptions.RCommand, "PCA"); m_BackgroundWorker.RunWorkerAsync(pcaPlots); mProgressForm.Reset("Generating PCA Plots ..."); mProgressForm.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_PCAPlotCompleted; #endregion }
/// <summary> /// This will be called from the plot forms. thus the reason to be public /// </summary> /// <param name="mclsPCA"></param> public void PlotPCA(clsPCAplotPar mclsPCA) { if (mtabControlData.Controls.Count == 0) { return; } #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_PCAPlotCompleted; #endregion var mfrmPCA = new frmPCAplotPar(mclsPCA); if (mhtDatasets.ContainsKey("Factors")) { var mclsFactors = mhtDatasets["Factors"]; if ((mclsFactors.mDTable.Columns.Count - 1) == mclsPCA.Datasets.Count) { mfrmPCA.PopulateFactorComboBox = clsDataTable.DataTableRows(mclsFactors.mDTable); } else { mfrmPCA.PopulateFactorComboBox = null; } } else { mfrmPCA.PopulateFactorComboBox = null; } if (mfrmPCA.ShowDialog() == DialogResult.OK) { mclsPCApar = mfrmPCA.clsPCApar; var mclsRplots = new clsRplotData(mclsPCApar.Rcmd, "PCA"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating PCA Plots ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_PCAPlotCompleted; #endregion }
void m_BackgroundWorker_GeneratePlots(object sender, DoWorkEventArgs e) { clsRplotData arg = (clsRplotData)e.Argument; string rcmd = arg.mstrRcmd; string plotname = arg.mstrPlotName; clsPlotResult mclsPlotResult; try { rConnector.rdcom.EvaluateNoReturn(rcmd); mclsPlotResult = new clsPlotResult(LoadImage(tempFile), plotname); e.Result = mclsPlotResult; } catch (Exception ex) { MessageBox.Show("RDCOM failed: " + ex.Message, "Error!"); e.Result = null; e.Cancel = true; DeleteTempFile(tempFile); } }
public void PlotHeatmap(clsHeatmapPar heatmapOptions) { if (mDataTab.Controls.Count != 0) { #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GenerateHeatmap; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_HeatMapCompleted; #endregion var frmHeatmapParams = new frmHeatMapPar(heatmapOptions) { maxRowCount = maxRow }; var res = frmHeatmapParams.ShowDialog(); if (res == DialogResult.OK) { mHeatmapOptions = frmHeatmapParams.clsHmapPar; mDoClustering = frmHeatmapParams.DoClust; var heatmapPlot = new clsRplotData(mHeatmapOptions.RCommand, "Hmap"); Add2AnalysisHTable(mHeatmapOptions, "Heatmap_Clustering"); m_BackgroundWorker.RunWorkerAsync(heatmapPlot); mProgressForm.Reset("Generating Heatmap ..."); mProgressForm.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GenerateHeatmap; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_HeatMapCompleted; #endregion } }
/// <summary> /// This will be called from the plot forms. thus the reason to be public /// </summary> /// <param name="mclsPCA"></param> public void PlotPCA(clsPCAplotPar mclsPCA) { if (mtabControlData.Controls.Count == 0) { return; } #region Hook Threading Events m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_PCAPlotCompleted; #endregion var mfrmPCA = new frmPCAplotPar(mclsPCA); if (mhtDatasets.ContainsKey("Factors")) { var mclsFactors = mhtDatasets["Factors"]; if ((mclsFactors.mDTable.Columns.Count - 1) == mclsPCA.Datasets.Count) mfrmPCA.PopulateFactorComboBox = clsDataTable.DataTableRows(mclsFactors.mDTable); else mfrmPCA.PopulateFactorComboBox = null; } else mfrmPCA.PopulateFactorComboBox = null; if (mfrmPCA.ShowDialog() == DialogResult.OK) { mclsPCApar = mfrmPCA.clsPCApar; var mclsRplots = new clsRplotData(mclsPCApar.Rcmd, "PCA"); m_BackgroundWorker.RunWorkerAsync(mclsRplots); mfrmShowProgress.Message = "Generating PCA Plots ..."; mfrmShowProgress.ShowDialog(); } #region Unhook Threading Events m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots; m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_PCAPlotCompleted; #endregion }