Esempio n. 1
0
        public static void CreateAndShowFindResults(ZedGraphControl sender, GraphSummary graphSummary, SrmDocument document, AreaCVGraphData.CVData data)
        {
            var peptideAnnotationPairs = data.PeptideAnnotationPairs.ToList();
            var results = new List <FindResult>(peptideAnnotationPairs.Count);

            var pred = new FindPredicate(new FindOptions().ChangeCustomFinders(new[] { new PeptideAnnotationPairFinder(peptideAnnotationPairs, data.CV) }), Program.MainWindow.SequenceTree.GetDisplaySettings(null));

            for (var i = 0; i < Math.Min(peptideAnnotationPairs.Count, MAX_FINDRESULTS_PEPTIDES); i++)
            {
                var pair        = peptideAnnotationPairs[i];
                var displayText = PeptideAnnotationPairFinder.GetDisplayText(data.CV, pair.Annotation);

                results.Add(new FindResult(pred,
                                           new BookmarkEnumerator(document,
                                                                  new Bookmark(document.GetPathTo((int)SrmDocument.Level.Molecules,
                                                                                                  document.Molecules.ToList().IndexOf(pair.Peptide)))), new FindMatch(displayText)));
            }

            var count = peptideAnnotationPairs.Count;

            if (results.Count != count)
            {
                MessageDlg.Show(sender, string.Format(Resources.HistogramHelper_CreateAndShowFindResults_Only_showing__0___1__peptides, MAX_FINDRESULTS_PEPTIDES, count));
                results = results.GetRange(0, MAX_FINDRESULTS_PEPTIDES);
            }

            if (peptideAnnotationPairs.Count == 1)
            {
                var nodes = peptideAnnotationPairs[0];
                graphSummary.StateProvider.SelectedPath = new IdentityPath(nodes.PeptideGroup.PeptideGroup, nodes.Peptide.Peptide);
            }

            Program.MainWindow.ShowFindResults(results);
        }
Esempio n. 2
0
 private string[][] GetExpected(string[] foundText)
 {
     return(foundText.Select(t => new[] { t, PeptideAnnotationPairFinder.GetDisplayText(0.14, "D102") }).ToArray());
 }