public void results_decoy_dataframe_with_something()
        {
            Sweet.lollipop = new Lollipop();
            Sweet.lollipop.input_files.Add(ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Identification, "n", "s", "1", "1", "1")); //0
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("E1");

            e.linked_proteoform_references = new List <Proteoform>(new List <Proteoform> {
                ConstructorsForTesting.make_a_theoretical()
            });
            e.ptm_set = e.linked_proteoform_references.Last().ptm_set;
            ProteoformFamily f = new ProteoformFamily(e);

            f.construct_family();
            Sweet.lollipop.decoy_proteoform_communities.Add("Decoy1", new ProteoformCommunity());
            Sweet.lollipop.decoy_proteoform_communities["Decoy1"].families = new List <ProteoformFamily> {
                f
            };
            var time_stamp = Sweet.time_stamp();
            var directory  = TestContext.CurrentContext.TestDirectory;

            ResultsSummaryGenerator.save_all(TestContext.CurrentContext.TestDirectory, time_stamp, Sweet.lollipop.TusherAnalysis1 as IGoAnalysis, Sweet.lollipop.TusherAnalysis1 as TusherAnalysis);
            Assert.IsTrue(File.Exists(Path.Combine(directory, "decoy_experimental_results_" + time_stamp + ".tsv")));
            var lines = File.ReadAllLines(Path.Combine(directory, "decoy_experimental_results_" + time_stamp + ".tsv"));

            Assert.AreEqual(2, lines.Length);
        }
Example #2
0
        public void FillTablesAndCharts()
        {
            DisplayUtility.FillDataGridView(dgv_fileList, Sweet.lollipop.get_files(Sweet.lollipop.input_files, new Purpose[] { Purpose.Identification, Purpose.Quantification }).Select(c => new DisplayInputFile(c)));
            DisplayInputFile.FormatInputFileTable(dgv_fileList, new Purpose[] { Purpose.Identification, Purpose.Quantification });
            dgv_fileList.ReadOnly = true;

            if (rb_displayIdentificationComponents.IsChecked.HasValue && (bool)rb_displayIdentificationComponents.IsChecked.Value && Sweet.lollipop.raw_experimental_components.Count > 0)
            {
                DisplayUtility.FillDataGridView(dgv_rawComponents, Sweet.lollipop.raw_experimental_components.Select(c => new DisplayComponent(c)));
            }

            if (rb_displayQuantificationComponents.IsChecked.HasValue && (bool)rb_displayQuantificationComponents.IsChecked.Value && Sweet.lollipop.raw_quantification_components.Count > 0)
            {
                DisplayUtility.FillDataGridView(dgv_rawComponents, Sweet.lollipop.raw_quantification_components.Select(c => new DisplayComponent(c)));
            }

            DisplayComponent.FormatComponentsTable(dgv_rawComponents);

            rtb_raw_components_counts.Text = ResultsSummaryGenerator.raw_components_report();

            NeuCodePairs pairs_form = this.MDIParent.neuCodePairs;

            if (Sweet.lollipop.neucode_labeled && pairs_form.ReadyToRunTheGamut())
            {
                pairs_form.RunTheGamut(false);
            }
        }
 public void results_summary_doesnt_crash_without_initializing()
 {
     Sweet.lollipop = new Lollipop();
     Assert.True(ResultsSummaryGenerator.generate_full_report().Length > 0);
     Assert.True(ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.experimental_results_dataframe(Sweet.lollipop.target_proteoform_community, new TusherAnalysis1())).Length > 0);
     Assert.True(ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.topdown_results_dataframe()).Length > 0);
     Assert.True(ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.experimental_intensities_dataframe()).Length > 0);
 }
        public void test_results_summary_with_peaks()
        {
            SaveState.lollipop.theoretical_database.theoretical_proteins = new Dictionary <InputFile, Protein[]>();
            SaveState.lollipop.theoretical_database.expanded_proteins    = new ProteinWithGoTerms[0];
            ProteoformCommunity community = construct_two_families_with_potentially_colliding_theoreticals();

            Assert.True(ResultsSummaryGenerator.generate_full_report().Length > 0);
        }
        public void biorepintensitytableLog2Fold()
        {
            Sweet.lollipop = new Lollipop();
            Dictionary <string, List <string> > conditionsBioReps = new Dictionary <string, List <string> >
            {
                { "n", new List <string> {
                      1.ToString(), 2.ToString(), 3.ToString()
                  } },
                { "s", new List <string> {
                      1.ToString(), 2.ToString(), 3.ToString()
                  } },
            };

            Sweet.lollipop.Log2FoldChangeAnalysis.conditionBiorepIntensitySums = conditionsBioReps.SelectMany(kv => kv.Value.Select(v => new Tuple <string, string>(kv.Key, v))).ToDictionary(t => t, t => 1d);
            List <InputFile> input_files = new List <InputFile>
            {
                ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Quantification, "n", "s", "1", "1", "1"), //0
                ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Quantification, "n", "s", "1", "2", "1"), //1
                ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Quantification, "n", "s", "2", "1", "1"), //2
                ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Quantification, "n", "s", "2", "2", "1"), //3
                ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Quantification, "n", "s", "3", "1", "1"), //4
                ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Quantification, "n", "s", "3", "2", "1"), //5
            };
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("asdf");

            e.quant.Log2FoldChangeValues.allIntensities = new Dictionary <Tuple <string, string>, BiorepIntensity>
            {
                { new Tuple <string, string>("n", 1.ToString()), new BiorepIntensity(false, 1.ToString(), "n", 1) },
                { new Tuple <string, string>("n", 2.ToString()), new BiorepIntensity(true, 2.ToString(), "n", 1) },
                { new Tuple <string, string>("n", 3.ToString()), new BiorepIntensity(false, 3.ToString(), "n", 1) },
                { new Tuple <string, string>("s", 1.ToString()), new BiorepIntensity(false, 1.ToString(), "s", 1) },
                { new Tuple <string, string>("s", 2.ToString()), new BiorepIntensity(false, 2.ToString(), "s", 1) },
                { new Tuple <string, string>("s", 3.ToString()), new BiorepIntensity(false, 3.ToString(), "s", 1) },
            };
            // With imputation uses processed values
            Assert.False(ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.biological_replicate_intensities(Sweet.lollipop.Log2FoldChangeAnalysis, new List <ExperimentalProteoform> {
                e
            }, input_files, conditionsBioReps, true, true)).Contains("NaN"));

            // Without imputation uses raw values
            e.biorepIntensityList = e.quant.Log2FoldChangeValues.allIntensities.Values.Where(x => !x.imputed).ToList();
            Assert.True(ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.biological_replicate_intensities(Sweet.lollipop.Log2FoldChangeAnalysis, new List <ExperimentalProteoform> {
                e
            }, input_files, conditionsBioReps, false, true)).Contains("\t0\t"));

            // Headers should be condition_biorep_fraction_techrep
            string[] header = ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.biological_replicate_intensities(Sweet.lollipop.Log2FoldChangeAnalysis, new List <ExperimentalProteoform> {
                e
            }, input_files, conditionsBioReps, false, true)).Split('\n')[0].Split('\t');
            Assert.True(header[1] == "n_1" && header[2] == "n_2" && header[3] == "n_3" && header[4] == "s_1" && header[5] == "s_2" && header[6] == "s_3");
            string[] line = ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.biological_replicate_intensities(Sweet.lollipop.Log2FoldChangeAnalysis, new List <ExperimentalProteoform> {
                e
            }, input_files, conditionsBioReps, false, true)).Split('\n')[1].Split('\t');
            Assert.True(line.First() == e.accession);
            Assert.True(line[1] == "1" && line[2] == "0" && line[3] == "1" && line[4] == "1" && line[5] == "1" && line[6] == "1"); // all "n" condition is imputed
        }
Example #6
0
        /// <summary>
        /// generate report and change selected table names based on # decoy communities
        /// </summary>
        public void update_figures_of_merit()
        {
            rtb_proteoformFamilyResults.Text = ResultsSummaryGenerator.proteoform_families_report();
            int selection = cmbx_tableSelector.SelectedIndex;

            cmbx_tableSelector.Items.Clear();
            cmbx_tableSelector.Items.AddRange(table_names);
            cmbx_tableSelector.Items.AddRange(Enumerable.Range(0, Sweet.lollipop.decoy_proteoform_communities.Count).Select(i => "Decoy Community " + i).ToArray());
            cmbx_tableSelector.SelectedIndex = selection < cmbx_tableSelector.Items.Count ? selection : 0;
        }
        private void btn_save_Click(object sender, EventArgs e)
        {
            if (!Directory.Exists(SaveState.lollipop.results_folder))
            {
                return;
            }
            string timestamp = SaveState.time_stamp();

            ResultsSummaryGenerator.save_all(SaveState.lollipop.results_folder, timestamp);
            ((ProteoformSweet)MdiParent).save_all_plots(SaveState.lollipop.results_folder, timestamp);
        }
        public void saveall()
        {
            SaveState.lollipop = new Lollipop();
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("asdf");

            SaveState.lollipop.qVals.Add(e.quant);
            GoTermNumber g = new GoTermNumber(new GoTerm("id", "desc", Aspect.BiologicalProcess), 0, 0, 0, 0);

            g.by = -1;
            SaveState.lollipop.goTermNumbers.Add(g);
            ResultsSummaryGenerator.save_all(TestContext.CurrentContext.TestDirectory, SaveState.time_stamp());
        }
        private void btn_save_Click(object sender, RoutedEventArgs e)
        {
            if (!Directory.Exists(Sweet.lollipop.results_folder))
            {
                return;
            }
            string timestamp = Sweet.time_stamp();

            ResultsSummaryGenerator.save_all(Sweet.lollipop.results_folder, timestamp, get_go_analysis(), get_tusher_analysis());
            MDIParent.save_all_plots(Sweet.lollipop.results_folder, timestamp);
            using (StreamWriter file = new StreamWriter(System.IO.Path.Combine(Sweet.lollipop.results_folder, "presets_" + timestamp + ".xml")))
                file.WriteLine(Sweet.save_method());
        }
        public void results_dataframe_with_something()
        {
            Sweet.lollipop = new Lollipop();
            Sweet.lollipop.input_files.Add(ConstructorsForTesting.InputFile("fake.txt", Labeling.NeuCode, Purpose.Identification, "n", "s", "1", "1", "1")); //0
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("E1");

            e.linked_proteoform_references = new List <Proteoform>(new List <Proteoform> {
                ConstructorsForTesting.make_a_theoretical()
            });
            e.ptm_set = e.linked_proteoform_references.Last().ptm_set;
            ProteoformFamily f = new ProteoformFamily(e);

            f.construct_family();
            Sweet.lollipop.target_proteoform_community.families = new List <ProteoformFamily> {
                f
            };
            string[] lines = ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.experimental_results_dataframe(Sweet.lollipop.target_proteoform_community, Sweet.lollipop.TusherAnalysis1)).Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            Assert.True(lines.Count() == 3);
            Assert.True(lines.Any(a => a.Contains("E1")));
            TopDownProteoform td = ConstructorsForTesting.TopDownProteoform("TD1", 1000, 10);

            td.linked_proteoform_references = new List <Proteoform>(new List <Proteoform> {
                ConstructorsForTesting.make_a_theoretical()
            });
            td.ptm_set = e.linked_proteoform_references.Last().ptm_set;
            ProteoformFamily f2 = new ProteoformFamily(td);

            f2.construct_family();
            Sweet.lollipop.target_proteoform_community.families = new List <ProteoformFamily> {
                f2
            };
            Sweet.lollipop.topdown_proteoforms = new List <TopDownProteoform>()
            {
                td
            };
            lines = ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.experimental_results_dataframe(Sweet.lollipop.target_proteoform_community, Sweet.lollipop.TusherAnalysis1)).Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            Assert.True(lines.Count() == 3);
            lines = ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.topdown_results_dataframe()).Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            Assert.True(lines.Count() == 3);
            Assert.True(lines.Any(a => a.Contains("TD1")));
            Sweet.lollipop.target_proteoform_community.families = new List <ProteoformFamily> {
                f, f2
            };
            lines = ResultsSummaryGenerator.datatable_tostring(ResultsSummaryGenerator.experimental_intensities_dataframe()).Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            Assert.AreEqual(lines.Count(), 4);
            Assert.True(lines.Any(a => a.Contains("E1")));
            Assert.True(lines.Any(a => a.Contains("TD1")));
        }
        public void saveall()
        {
            Sweet.lollipop = new Lollipop();
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("asdf");

            Sweet.lollipop.qVals.Add(e.quant);
            GoTermNumber g = new GoTermNumber(new GoTerm("id", "desc", Aspect.BiologicalProcess), 0, 0, 0, 0);

            g.by = -1;
            Sweet.lollipop.TusherAnalysis1.GoAnalysis.goTermNumbers.Add(g);
            Sweet.lollipop.topdown_proteoforms = new List <TopDownProteoform>()
            {
                ConstructorsForTesting.TopDownProteoform("td1", 1000, 10)
            };
            ResultsSummaryGenerator.save_all(TestContext.CurrentContext.TestDirectory, Sweet.time_stamp(), Sweet.lollipop.TusherAnalysis1 as IGoAnalysis, Sweet.lollipop.TusherAnalysis1 as TusherAnalysis);
        }
        public void results_dataframe_with_something()
        {
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("E1");

            e.linked_proteoform_references = new List <Proteoform>(new List <Proteoform> {
                ConstructorsForTesting.make_a_theoretical()
            });
            e.ptm_set = e.linked_proteoform_references.Last().ptm_set;
            ProteoformFamily f = new ProteoformFamily(e);

            f.construct_family();
            SaveState.lollipop.target_proteoform_community.families = new List <ProteoformFamily> {
                f
            };
            string[] lines = ResultsSummaryGenerator.results_dataframe().Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            Assert.True(lines.Count() == 3);
            Assert.True(lines.Any(a => a.Contains("E1")));
        }
        public void update_figures_of_merit()
        {
            rtb_proteoformFamilyResults.Text = ResultsSummaryGenerator.proteoform_families_report();

            //change selected table names based on # decoy communities
            int decoy_communities = SaveState.lollipop.decoy_proteoform_communities.Count;

            for (int i = 0; i < decoy_communities; i++)
            {
                if (!cmbx_tableSelector.Items.Contains("Decoy Community " + i))
                {
                    cmbx_tableSelector.Items.Add("Decoy Community " + i);
                }
            }

            //if more items than decoy databases, remove later ones //FIX
            while (cmbx_tableSelector.Items.Count - 5 - decoy_communities > 0)
            {
                cmbx_tableSelector.Items.RemoveAt(5 + decoy_communities);
            }
        }
        public void experimental_intensitites_dataframe()
        {
            Sweet.lollipop = new Lollipop();
            int id_file_index = Lollipop.file_types.ToList().IndexOf(Lollipop.file_types.Where(f => f.Contains(Purpose.Identification)).First());

            Sweet.lollipop.enter_input_files(new string[] { Path.Combine(TestContext.CurrentContext.TestDirectory, "05-26-17_B7A_yeast_td_fract5_rep1.xlsx") }, Lollipop.acceptable_extensions[id_file_index], Lollipop.file_types[id_file_index], Sweet.lollipop.input_files, false);
            Sweet.lollipop.enter_input_files(new string[] { Path.Combine(TestContext.CurrentContext.TestDirectory, "05-26-17_B7A_yeast_td_fract5_rep1_3columns.tsv") }, Lollipop.acceptable_extensions[id_file_index], Lollipop.file_types[id_file_index], Sweet.lollipop.input_files, false);
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).First().fraction                 = "5";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).First().biological_replicate     = "1";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).First().technical_replicate      = "1";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).First().lt_condition             = "1";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).ToList()[1].fraction             = "5";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).ToList()[1].biological_replicate = "1";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).ToList()[1].technical_replicate  = "1";
            Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).ToList()[1].lt_condition         = "1";
            Sweet.lollipop.process_raw_components(Sweet.lollipop.input_files.Where(f => f.purpose == Purpose.Identification).ToList(), Sweet.lollipop.raw_experimental_components, Purpose.Identification, false);
            Sweet.lollipop.aggregate_proteoforms(true, null, Sweet.lollipop.raw_experimental_components, null, 1);
            Sweet.lollipop.construct_target_and_decoy_families();
            var dt = ResultsSummaryGenerator.experimental_intensities_dataframe();

            Assert.AreEqual(111, dt.Rows.Count);
            Assert.AreEqual(10, dt.Columns.Count);
        }
        public bool full_run()
        {
            clear_lists();
            if (!SaveState.lollipop.theoretical_database.ready_to_make_database(Environment.CurrentDirectory))
            {
                if (SaveState.lollipop.get_files(SaveState.lollipop.input_files, Purpose.ProteinDatabase).Count() <= 0)
                {
                    MessageBox.Show("Please list at least one protein database.", "Full Run");
                    return(false);
                }
                else
                {
                    DialogResult d = MessageBox.Show("No PTM list is listed.\n\nWill now download the default PTM list from UniProt and use it for the Full Run.", "Full Run", MessageBoxButtons.OKCancel);
                    if (d == DialogResult.OK)
                    {
                        SaveState.lollipop.enter_uniprot_ptmlist();
                        if (loadDeconvolutionResults.ReadyToRunTheGamut())
                        {
                            loadDeconvolutionResults.RunTheGamut(); // updates the dgvs
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            if (SaveState.lollipop.results_folder == "")
            {
                DialogResult d = MessageBox.Show("Choose a results folder for this Full Run?", "Full Run", MessageBoxButtons.YesNoCancel);
                if (d == DialogResult.Yes)
                {
                    FolderBrowserDialog folderBrowser = new FolderBrowserDialog();
                    DialogResult        dr            = folderBrowser.ShowDialog();
                    if (dr == DialogResult.OK)
                    {
                        string temp_folder_path = folderBrowser.SelectedPath;
                        SaveState.lollipop.results_folder = temp_folder_path;
                        loadDeconvolutionResults.InitializeParameterSet(); // updates the textbox
                    }
                    else if (dr == DialogResult.Cancel)
                    {
                        return(false);
                    }
                }
                else if (d == DialogResult.Cancel)
                {
                    return(false);
                }
            }

            Cursor = Cursors.WaitCursor;
            foreach (ISweetForm sweet in forms)
            {
                if (sweet.ReadyToRunTheGamut())
                {
                    sweet.RunTheGamut();
                }
            }
            string timestamp = SaveState.time_stamp();

            ResultsSummaryGenerator.save_all(SaveState.lollipop.results_folder, timestamp);
            save_all_plots(SaveState.lollipop.results_folder, timestamp);
            Cursor = Cursors.Default;
            return(true);
        }
        public Stopwatch full_run()
        {
            forms[1].ClearListsTablesFigures(true); // clear forms following load deconvolution results

            MessageBoxResult d3 = MessageBox.Show("Use presets for this Full Run?", "Full Run", MessageBoxButton.YesNoCancel);

            if (d3 == MessageBoxResult.Yes)
            {
                bool?dr = methodFileOpen.ShowDialog();
                if (dr == true)
                {
                    string           filepath = methodFileOpen.FileName;
                    MessageBoxResult d4       = MessageBox.Show("Add files at the listed paths if they still exist?", "Full Run", MessageBoxButton.YesNoCancel);
                    if (d4 == MessageBoxResult.Cancel)
                    {
                        return(null);
                    }

                    if (!open_method(filepath, File.ReadAllLines(filepath), d4 == MessageBoxResult.Yes))
                    {
                        return(null);
                    }
                    ;
                }
                else if (dr == false)
                {
                    return(null);
                }
            }
            else if (d3 == MessageBoxResult.Cancel)
            {
                return(null);
            }

            loadResults.FillTablesAndCharts(); // updates the filelists in form

            //  Check that there are input files
            if (Sweet.lollipop.input_files.Count == 0)
            {
                MessageBox.Show("Please load in deconvolution result files in order to use load and run.", "Full Run");
                return(null);
            }

            // Check that theoretical database(s) are present

            if (Sweet.lollipop.get_files(Sweet.lollipop.input_files, Purpose.ProteinDatabase).Count() <= 0)
            {
                MessageBox.Show("Please list at least one protein database.", "Full Run");
                return(null);
            }


            // Option to choose a result folder
            if (Sweet.lollipop.results_folder == "")
            {
                MessageBoxResult d2 = MessageBox.Show("Choose a results folder for this Full Run?", "Full Run", MessageBoxButton.YesNoCancel);
                if (d2 == MessageBoxResult.Yes)
                {
                    System.Windows.Forms.FolderBrowserDialog folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
                    System.Windows.Forms.DialogResult        dr            = folderBrowser.ShowDialog();
                    if (dr == System.Windows.Forms.DialogResult.OK)
                    {
                        string temp_folder_path = folderBrowser.SelectedPath;
                        Sweet.lollipop.results_folder = temp_folder_path;
                        loadResults.InitializeParameterSet(); // updates the textbox
                    }
                    else if (dr == System.Windows.Forms.DialogResult.Cancel)
                    {
                        return(null);
                    }
                }
                else if (d2 == MessageBoxResult.Cancel)
                {
                    return(null);
                }
            }
            else
            {
                MessageBoxResult d2 = MessageBox.Show("Would you like to save results of this Full Run to " + Sweet.lollipop.results_folder + "?", "Full Run", MessageBoxButton.YesNoCancel);
                if (d2 == MessageBoxResult.No)
                {
                    Sweet.lollipop.results_folder = "";
                }
                else if (d2 == MessageBoxResult.Cancel)
                {
                    return(null);
                }
            }

            //Run the program
            Mouse.OverrideCursor = Cursors.Wait;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            foreach (ISweetForm sweet in forms)
            {
                if (sweet.ReadyToRunTheGamut())
                {
                    sweet.RunTheGamut(true);
                }
            }

            //  Save the results
            resultsSummary.InitializeParameterSet();
            if (Sweet.lollipop.results_folder != "")
            {
                string timestamp = Sweet.time_stamp();
                ResultsSummaryGenerator.save_all(Sweet.lollipop.results_folder, timestamp, resultsSummary.get_go_analysis(), resultsSummary.get_tusher_analysis());
                save_all_plots(Sweet.lollipop.results_folder, timestamp);
                using (StreamWriter file = new StreamWriter(Path.Combine(Sweet.lollipop.results_folder, "presets_" + timestamp + ".xml")))
                    file.WriteLine(Sweet.save_method());
            }
            List <string> warning_methods = new List <string>()
            {
                "Warning:"
            };

            if (Sweet.lollipop.bottomupReader.bad_ptms.Count > 0)
            {
                warning_methods.Add("The following PTMs in the bottom-up file were not matched with any PTMs in the theoretical database: ");
                warning_methods.Add(string.Join(", ", Sweet.lollipop.bottomupReader.bad_ptms.Distinct()));
            }
            if (Sweet.lollipop.topdownReader.bad_ptms.Count > 0)
            {
                warning_methods.Add("Top-down proteoforms with the following modifications were not matched to a modification in the theoretical PTM list: ");
                warning_methods.Add(string.Join(", ", Sweet.lollipop.topdownReader.bad_ptms.Distinct()));
            }
            if (Sweet.lollipop.topdown_proteoforms_no_theoretical.Count() > 0)
            {
                warning_methods.Add("Top-down proteoforms with the following accessions were not matched to a theoretical proteoform in the theoretical database: ");
                warning_methods.Add(string.Join(", ", Sweet.lollipop.topdown_proteoforms_no_theoretical.Select(t => t.accession.Split('_')[0]).Distinct()));
            }
            if (warning_methods.Count > 1)
            {
                MessageBox.Show(String.Join("\n\n", warning_methods));
            }
            //  Program ran successfully
            stopwatch.Stop();
            Mouse.OverrideCursor = null;
            return(stopwatch);
        }
 public void results_summary_doesnt_crash_without_initializing()
 {
     Assert.True(ResultsSummaryGenerator.generate_full_report().Length > 0);
     Assert.True(ResultsSummaryGenerator.results_dataframe().Length > 0);
 }
 public void create_summary()
 {
     rtb_summary.Text = ResultsSummaryGenerator.generate_full_report();
 }