/// <summary> /// If peptides match to multiple proteins, ask the user what they want to do with these /// peptides. /// </summary> public DialogResult EnsureDuplicateProteinFilter(IWin32Window parent, bool single) { var result = DialogResult.OK; var multipleProteinsPerPeptideCount = PeptideMatches.Values.Count( pepMatch => pepMatch.Proteins != null && pepMatch.Proteins.Count > 1); var unmatchedPeptidesCount = PeptideMatches.Values.Count(pepMatch => pepMatch.Proteins != null && pepMatch.Proteins.Count == 0); var filteredPeptidesCount = PeptideMatches.Values.Count(pepMatch => !pepMatch.MatchesFilterSettings); if (multipleProteinsPerPeptideCount > 0 || unmatchedPeptidesCount > 0 || filteredPeptidesCount > 0) { using (var peptideProteinsDlg = new FilterMatchedPeptidesDlg(multipleProteinsPerPeptideCount, unmatchedPeptidesCount, filteredPeptidesCount, single)) { result = peptideProteinsDlg.ShowDialog(parent); } } return(result); }
/// <summary> /// If peptides match to multiple proteins, ask the user what they want to do with these /// peptides. /// </summary> public DialogResult EnsureDuplicateProteinFilter(IWin32Window parent, bool single, AuditLogEntryCreatorList entryCreators) { var result = DialogResult.OK; var multipleProteinsPerPeptideCount = PeptideMatches.Values.Count( pepMatch => pepMatch.Proteins != null && pepMatch.Proteins.Count > 1); var unmatchedPeptidesCount = PeptideMatches.Values.Count(pepMatch => pepMatch.Proteins != null && pepMatch.Proteins.Count == 0); var filteredPeptidesCount = PeptideMatches.Values.Count(pepMatch => !pepMatch.MatchesFilterSettings); if (multipleProteinsPerPeptideCount > 0 || unmatchedPeptidesCount > 0 || filteredPeptidesCount > 0) { var hasSmallMolecules = PeptideMatches.Any(p => !p.Key.IsProteomic); using (var peptideProteinsDlg = new FilterMatchedPeptidesDlg(multipleProteinsPerPeptideCount, unmatchedPeptidesCount, filteredPeptidesCount, single, hasSmallMolecules)) { result = peptideProteinsDlg.ShowDialog(parent); if (entryCreators != null) { entryCreators.Add(peptideProteinsDlg.FormSettings.EntryCreator); } } } return(result); }