예제 #1
0
        private void dataGridProteins_PreviewKeyDown_1(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Delete)
            {
                ////We need to remove all spectra and peptides from the protein object
                Console.WriteLine("Updating result profile.");

                List <MyProtein> proteinsToRemove = new List <MyProtein>();

                foreach (MyProtein p in dataGridProteins.SelectedItems)
                {
                    proteinsToRemove.Add(p);
                    Console.WriteLine("Removing protein: " + p.Locus);
                }

                ResultViewerResultPackage.RemoveProtein(proteinsToRemove);

                UpdateFDRLabels();

                ////We now need to update the wpf table
                List <MyProtein> tmpList = new List <MyProtein>();
                dataGridProteins.ItemsSource = tmpList;
                this.UpdateLayout();
                dataGridProteins.ItemsSource = ResultViewerResultPackage.MyProteins.MyProteinList;
            }
        }
예제 #2
0
        private void UpdateFDRLabels()
        {
            //Update the FDRs
            labelSpectraFDR.Content = ResultViewerResultPackage.MyFDRResult.SpectraFDRLabel;
            labelPeptideFDR.Content = ResultViewerResultPackage.MyFDRResult.PeptideFDRLabel;
            labelProteinFDR.Content = ResultViewerResultPackage.MyFDRResult.ProteinFDRLabel;
            labelUniquePtn.Content  = ResultViewerResultPackage.MyProteins.MyProteinList.FindAll(a => a.ContainsUniquePeptide > 0).Count();


            string unlabeledDecoy = ResultViewerResultPackage.MyParameters.UnlabeledDecoyTag;

            //for backwards compatibility
            if (string.IsNullOrEmpty(unlabeledDecoy))
            {
                unlabeledDecoy = "Reverse_";
            }

            labelUnlabeledDecoyPtns.Content = ResultViewerResultPackage.MyProteins.MyProteinList.FindAll(a => a.Locus.StartsWith(unlabeledDecoy)).Count() + " / " +
                                              (from protein in ResultViewerResultPackage.MyProteins.MyProteinList
                                               where protein.Locus.StartsWith(unlabeledDecoy)
                                               select protein.GroupNo).Distinct().Count().ToString();

            int maxParsimonyProteinCount = ResultViewerResultPackage.MaxParsimonyList().Count;

            labelMaxParsimony.Content = maxParsimonyProteinCount.ToString();
        }
예제 #3
0
 private void radioButtonProteinMaxParsView_Checked(object sender, RoutedEventArgs e)
 {
     if (ResultViewerResultPackage != null)
     {
         List <MyProtein> maxParsimonyProt = ResultViewerResultPackage.MaxParsimonyList();
         CalculateSAF(maxParsimonyProt);
         dataGridProteins.ItemsSource = maxParsimonyProt;
         dataGridProteins.Visibility  = System.Windows.Visibility.Visible;
         System.Windows.GridLength g = new GridLength(117, GridUnitType.Star);
         grid1.RowDefinitions[2].Height = g;
     }
 }