示例#1
0
        /// <summary>
        /// This method should alwys be called in a try catch
        /// </summary>
        private void checkIfResultsAreLoaded()
        {
            if (resultParser.TheResults.Count == 0)
            {
                openFileDialog1.Title  = "Load results";
                openFileDialog1.Filter = "PatternLab project file (*.plp)|*.plp|AC/TFold, TrendQuest files (*.txt)|*.txt";

                if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
                {
                    resultParser.ParseTrendQuestACFoldOrIndex(openFileDialog1.FileName);
                    resultParser.PrepareTranslatedDictionary(ref gt);

                    richTextBoxLog.AppendText("User expression data loaded\n");
                    termScoreCalculator = new TermScoreCalculator(ref gt, ref resultParser);
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }
        }
示例#2
0
        private void buttonVerifyExperimentalData_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            ResultParser resultParser = new ResultParser();

            resultParser.ParseTrendQuestACFoldOrIndex(openFileDialog1.FileName);

            int           failCounter         = 0;
            int           idsProcessedCounter = 0;
            List <string> failedIDs           = new List <string>();

            foreach (KeyValuePair <string, double> r in resultParser.TheResults)
            {
                try
                {
                    idsProcessedCounter++;
                }
                catch
                {
                    failCounter++;
                    failedIDs.Add(r.Key);
                }
            }

            richTextBoxLog.AppendText("Total IDs processed =" + idsProcessedCounter.ToString() + "\n");
            richTextBoxLog.AppendText("FailCounter = " + failCounter.ToString() + "\n");

            for (int i = 0; i < failedIDs.Count; i++)
            {
                int a = i + 1;
                richTextBoxLog.AppendText(a.ToString() + ": " + failedIDs[i] + "\n");
            }
        }