Beispiel #1
0
            public bool ModificationsMatch(CrosslinkItem other)
            {
                if (PeptideLibraryKeys.Count != other.PeptideLibraryKeys.Count)
                {
                    return(false);
                }

                if (Crosslinks.Count != other.Crosslinks.Count)
                {
                    return(false);
                }

                for (int i = 0; i < PeptideLibraryKeys.Count; i++)
                {
                    if (!KeysMatch(PeptideLibraryKeys[i], other.PeptideLibraryKeys[i]))
                    {
                        return(false);
                    }
                }

                for (int i = 0; i < Crosslinks.Count; i++)
                {
                    if (!LibKeyIndex.ModificationsMatch(Crosslinks[i].Name, other.Crosslinks[i].Name))
                    {
                        return(false);
                    }

                    if (!Equals(Crosslinks[i].Positions, other.Crosslinks[i].Positions))
                    {
                        return(false);
                    }
                }

                return(true);
            }
Beispiel #2
0
            protected override IEnumerable <IndexItem> ItemsMatching(CrosslinkLibraryKey key)
            {
                var crosslinkItem = new CrosslinkItem(new IndexItem(key, -1));

                foreach (var match in CrosslinkItemsMatchingWithoutModifications(crosslinkItem))
                {
                    if (match.ModificationsMatch(crosslinkItem))
                    {
                        yield return(match.IndexItem);
                    }
                }
            }
Beispiel #3
0
            private IEnumerable <CrosslinkItem> CrosslinkItemsMatchingWithoutModifications(CrosslinkItem key)
            {
                ImmutableList <CrosslinkItem> matches;

                if (!_entries.TryGetValue(key.GetUnmodifiedSequences(), out matches))
                {
                    return(ImmutableList.Empty <CrosslinkItem>());
                }

                return(matches);
            }
Beispiel #4
0
            protected override IEnumerable <IndexItem> ItemsMatchingWithoutModifications(CrosslinkLibraryKey key)
            {
                var crosslinkItem = new CrosslinkItem(new IndexItem(key, -1));

                return(CrosslinkItemsMatchingWithoutModifications(crosslinkItem).Select(item => item.IndexItem));
            }