private void FillLists(SrmDocument document)
        {
            ImportPeptideSearch.UpdateModificationMatches(document);

            modificationsListBox.Items.Clear();
            unmatchedListBox.Items.Clear();

            foreach (var match in ImportPeptideSearch.GetMatchedMods())
            {
                modificationsListBox.Items.Add(new ListBoxModification(match), CheckState.Unchecked);
            }

            var unmatched = ImportPeptideSearch.GetUnmatchedSequences();

            if (unmatched.Any())
            {
                splitContainer.Panel2Collapsed = false;
                foreach (var uninterpretedMod in unmatched)
                {
                    unmatchedListBox.Items.Add(uninterpretedMod);
                }
            }
            else
            {
                splitContainer.Panel2Collapsed = true;
            }
            if (modificationsListBox.Items.Count <= 3)
            {
                cbSelectAll.Visible          = false;
                modificationsListBox.Height += cbSelectAll.Bottom - modificationsListBox.Bottom;
            }
        }
Пример #2
0
        private void FillLists(SrmDocument document)
        {
            IList <StaticMod> modsToAdd, modsToCheck;

            if (ImportPeptideSearch.IsDDASearch)
            {
                modsToAdd = Settings.Default.StaticModList.ToList();
                modsToAdd.AddRange(Settings.Default.HeavyModList.Distinct());
                modsToCheck = document.Settings.PeptideSettings.Modifications.StaticModifications.ToList();
                modsToCheck.AddRange(document.Settings.PeptideSettings.Modifications.AllHeavyModifications.Distinct());
                //modsToAdd = ImportPeptideSearch.UserDefinedTypedMods;
            }
            else
            {
                ImportPeptideSearch.UpdateModificationMatches(document);
                modsToAdd   = ImportPeptideSearch.GetMatchedMods().ToList();
                modsToCheck = new List <StaticMod>(); // don't check any mods
            }

            modificationsListBox.Items.Clear();
            unmatchedListBox.Items.Clear();

            foreach (var match in modsToAdd)
            {
                modificationsListBox.Items.Add(new ListBoxModification(match, ImportPeptideSearch.IsDDASearch), modsToCheck.Contains(match));
            }

            var unmatched = ImportPeptideSearch.GetUnmatchedSequences();

            if (unmatched != null && unmatched.Any())
            {
                splitContainer.Panel2Collapsed = false;
                foreach (var uninterpretedMod in unmatched)
                {
                    unmatchedListBox.Items.Add(uninterpretedMod);
                }
            }
            else
            {
                splitContainer.Panel2Collapsed = true;
            }
            if (modificationsListBox.Items.Count <= 3)
            {
                cbSelectAll.Visible          = false;
                modificationsListBox.Height += cbSelectAll.Bottom - modificationsListBox.Bottom;
            }
        }