Example #1
0
        public override IEnumerable <DocNode> GetChoices(bool useFilter)
        {
            var mods            = DocNode.ExplicitMods;
            var listChildrenNew = new List <DocNode>();

            foreach (TransitionGroup group in DocNode.GetTransitionGroups(DocSettings, mods, useFilter))
            {
                // The maximum allowable precursor charge may be larger than it makes sense to show.
                var charges = group.IsProteomic
                    ? DocSettings.TransitionSettings.Filter.PeptidePrecursorCharges
                    : DocSettings.TransitionSettings.Filter.SmallMoleculePrecursorAdducts;
                if (Math.Abs(group.PrecursorAdduct.AdductCharge) <= TransitionGroup.MAX_PRECURSOR_CHARGE_PICK || charges.Contains(group.PrecursorAdduct))
                {
                    var nodeChoice = CreateChoice(group, mods);
                    if (!useFilter || DocSettings.TransitionSettings.Libraries.HasMinIonCount(nodeChoice))
                    {
                        listChildrenNew.Add(nodeChoice);
                    }
                }
            }
            var nodePep = (PeptideDocNode)DocNode.ChangeChildren(listChildrenNew);

            nodePep.ChangeSettings(DocSettings, SrmSettingsDiff.PROPS);
            listChildrenNew = new List <DocNode>(nodePep.Children);
            MergeChosen(listChildrenNew, useFilter);
            return(listChildrenNew);
        }
        public override IEnumerable <DocNode> GetChoices(bool useFilter)
        {
            var mods            = DocNode.ExplicitMods;
            var listChildrenNew = new List <DocNode>();

            foreach (TransitionGroup group in DocNode.GetTransitionGroups(DocSettings, mods, useFilter))
            {
                // The maximum allowable precursor charge may be larger than it makes sense to show
                // For custom ions we just show what's already there, so don't worry about charge
                if (group.IsCustomIon || Math.Abs(group.PrecursorCharge) <= TransitionGroup.MAX_PRECURSOR_CHARGE_PICK ||
                    DocSettings.TransitionSettings.Filter.PrecursorCharges.Contains(group.PrecursorCharge))
                {
                    listChildrenNew.Add(CreateChoice(group, mods));
                }
            }
            var nodePep = (PeptideDocNode)DocNode.ChangeChildren(listChildrenNew);

            nodePep.ChangeSettings(DocSettings, SrmSettingsDiff.PROPS);
            listChildrenNew = new List <DocNode>(nodePep.Children);
            MergeChosen(listChildrenNew, useFilter);
            return(listChildrenNew);
        }