Beispiel #1
0
        private void mnuItemFC_Click(object sender, EventArgs e)
        {
            var mclsSelected = (clsDatasetTreeNode)ctltreeView.SelectedNode.Tag;

            if (!ValidateFactorsDefined("Calculate Fold Changes"))
            {
                return;
            }

            if (!ValidateDataMatrixTableSelected(mclsSelected))
            {
                return;
            }

            if (!ValidateExpressionsLoaded("compute fold change"))
            {
                return;
            }

            mclsFoldChangePar                 = new clsFoldChangePar();
            Rdataset                          = mclsSelected.mstrRdatasetName;
            mclsFoldChangePar.Rdataset        = Rdataset;
            mclsFoldChangePar.mstrDatasetName = mclsSelected.mstrDataText;
            mclsFoldChangePar.marrFactors     = marrFactorInfo;

            var mfrmFC = new frmFoldChangePar(mclsFoldChangePar);

            if (mfrmFC.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            mclsFoldChangePar = mfrmFC.clsFoldChangePar;
            Add2AnalysisHTable(mclsFoldChangePar, "FoldChanges");

            try
            {
                mRConnector.EvaluateNoReturn(mclsFoldChangePar.Rcmd);
                if (mRConnector.GetTableFromRmatrix("foldChanges"))
                {
                    var mDTFoldChange = mRConnector.DataTable.Copy();
                    if (mDTFoldChange != null)
                    {
                        mDTFoldChange.TableName = "foldChanges";
                        AddDataset2HashTable(mDTFoldChange);
                        AddDataNode(mhtDatasets["Fold Changes"]);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
            }
        }
        private void mnuItemFC_Click(object sender, EventArgs e)
        {
            var selectedNodeTag = (clsDatasetTreeNode)ctlTreeView.SelectedNode.Tag;

            if (!ValidateFactorsDefined("calculate fold changes"))
            {
                return;
            }

            if (!ValidateDataMatrixTableSelected(selectedNodeTag))
            {
                return;
            }

            if (!ValidateExpressionsLoaded("compute fold change"))
            {
                return;
            }

            mclsFoldChangePar                 = new clsFoldChangePar();
            RDataset                          = selectedNodeTag.RDatasetName;
            mclsFoldChangePar.RDataset        = RDataset;
            mclsFoldChangePar.mstrDatasetName = selectedNodeTag.DataText;
            mclsFoldChangePar.marrFactors     = marrFactorInfo;

            var foldChangeParams = new frmFoldChangePar(mclsFoldChangePar);

            if (foldChangeParams.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            mclsFoldChangePar = foldChangeParams.clsFoldChangePar;
            Add2AnalysisHTable(mclsFoldChangePar, "FoldChanges");

            try
            {
                mRConnector.EvaluateNoReturn(mclsFoldChangePar.RCommand);
                if (mRConnector.GetTableFromRmatrix("foldChanges"))
                {
                    var foldChangeData = mRConnector.DataTable.Copy();
                    foldChangeData.TableName = "foldChanges";
                    AddDataset2HashTable(foldChangeData);
                    AddDataNode(mhtDatasets["Fold Changes"]);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
            }
        }
        private void mnuItemFC_Click(object sender, EventArgs e)
        {
            var mclsSelected = (clsDatasetTreeNode)ctltreeView.SelectedNode.Tag;

            if (!ValidateFactorsDefined("Calculate Fold Changes"))
            {
                return;
            }

            if (!ValidateDataMatrixTableSelected(mclsSelected))
            {
                return;
            }

            if (!ValidateExpressionsLoaded("compute fold change"))
            {
                return;
            }

            mclsFoldChangePar = new clsFoldChangePar();
            Rdataset = mclsSelected.mstrRdatasetName;
            mclsFoldChangePar.Rdataset = Rdataset;
            mclsFoldChangePar.mstrDatasetName = mclsSelected.mstrDataText;
            mclsFoldChangePar.marrFactors = marrFactorInfo;

            var mfrmFC = new frmFoldChangePar(mclsFoldChangePar);

            if (mfrmFC.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            mclsFoldChangePar = mfrmFC.clsFoldChangePar;
            Add2AnalysisHTable(mclsFoldChangePar, "FoldChanges");

            try
            {
                mRConnector.EvaluateNoReturn(mclsFoldChangePar.Rcmd);
                if (mRConnector.GetTableFromRmatrix("foldChanges"))
                {
                    var mDTFoldChange = mRConnector.DataTable.Copy();
                    if (mDTFoldChange != null)
                    {
                        mDTFoldChange.TableName = "foldChanges";
                        AddDataset2HashTable(mDTFoldChange);
                        AddDataNode(mhtDatasets["Fold Changes"]);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
            }
        }