示例#1
0
        public ComplexFragmentIon MakeComplexFragmentIon(SrmSettings settings, IsotopeLabelType labelType, ComplexFragmentIonName complexFragmentIonName)
        {
            var        transitionGroup = GetTransitionGroup(labelType, Adduct.SINGLY_PROTONATED);
            Transition transition;

            if (complexFragmentIonName.IonType == IonType.precursor || complexFragmentIonName.IonType == IonType.custom)
            {
                transition = new Transition(transitionGroup, IonType.precursor, Peptide.Length - 1, 0, Adduct.SINGLY_PROTONATED);
            }
            else
            {
                transition = new Transition(transitionGroup, complexFragmentIonName.IonType,
                                            Transition.OrdinalToOffset(complexFragmentIonName.IonType, complexFragmentIonName.Ordinal, Peptide.Length),
                                            0, Adduct.SINGLY_PROTONATED);
            }

            var result = new ComplexFragmentIon(transition, null, CrosslinkStructure, complexFragmentIonName.IsOrphan);

            if (ExplicitMods != null)
            {
                foreach (var child in complexFragmentIonName.Children)
                {
                    LinkedPeptide linkedPeptide;
                    if (!ExplicitMods.Crosslinks.TryGetValue(child.Item1, out linkedPeptide))
                    {
                        throw new InvalidOperationException(@"No crosslink at " + child.Item1);
                    }
                    result = result.AddChild(child.Item1,
                                             linkedPeptide.MakeComplexFragmentIon(settings, labelType, child.Item2));
                }
            }

            return(result);
        }
示例#2
0
        public MoleculeMassOffset GetNeutralFormula(ComplexFragmentIon complexFragmentIon)
        {
            var result = GetSimpleFragmentFormula(complexFragmentIon);

            foreach (var child in complexFragmentIon.Children)
            {
                var childBuilder = GetChildBuilder(child.Key);
                result = result.Plus(childBuilder.GetNeutralFormula(child.Value));
            }

            result = SubtractLosses(result, complexFragmentIon.TransitionLosses);
            return(result);
        }
示例#3
0
        public IEnumerable <ComplexFragmentIon> ListSimpleFragmentIons(SrmSettings settings, bool useFilter)
        {
            var transitionGroupDocNode =
                GetTransitionGroupDocNode(settings, IsotopeLabelType.light, Adduct.SINGLY_PROTONATED);

            yield return(ComplexFragmentIon.NewOrphanFragmentIon(transitionGroupDocNode.TransitionGroup, ExplicitMods, Adduct.SINGLY_PROTONATED));

            foreach (var transitionDocNode in transitionGroupDocNode.TransitionGroup.GetTransitions(settings,
                                                                                                    transitionGroupDocNode, ExplicitMods, transitionGroupDocNode.PrecursorMz,
                                                                                                    transitionGroupDocNode.IsotopeDist, null, null, useFilter, false))
            {
                if (transitionDocNode.Transition.MassIndex != 0)
                {
                    continue;
                }
                yield return(new ComplexFragmentIon(transitionDocNode.Transition, transitionDocNode.Losses, CrosslinkStructure));
            }
        }
示例#4
0
        /// <summary>
        /// Returns the chemical formula for this fragment and none of its children.
        /// </summary>
        private MoleculeMassOffset GetSimpleFragmentFormula(ComplexFragmentIon complexFragmentIon)
        {
            if (complexFragmentIon.IsOrphan)
            {
                return(MoleculeMassOffset.EMPTY);
            }

            var key = Tuple.Create(complexFragmentIon.Transition.IonType, complexFragmentIon.Transition.CleavageOffset);
            MoleculeMassOffset moleculeMassOffset;

            if (_fragmentedMolecules.TryGetValue(key, out moleculeMassOffset))
            {
                return(moleculeMassOffset);
            }

            var fragmentedMolecule = GetSimplePrecursorMolecule().ChangeFragmentIon(complexFragmentIon.Transition.IonType, complexFragmentIon.Transition.Ordinal);

            moleculeMassOffset = new MoleculeMassOffset(fragmentedMolecule.FragmentFormula, 0, 0);
            _fragmentedMolecules.Add(key, moleculeMassOffset);
            return(moleculeMassOffset);
        }
示例#5
0
        private IEnumerable <ComplexFragmentIon> PermuteFragmentIon(SrmSettings settings,
                                                                    int maxFragmentationCount,
                                                                    ComplexFragmentIon fragmentIon,
                                                                    ModificationSite modificationSite,
                                                                    IList <ComplexFragmentIon> linkedFragmentIons)
        {
            if (fragmentIon.IsOrphan && !fragmentIon.IsEmptyOrphan ||
                !fragmentIon.IncludesAaIndex(modificationSite.IndexAa))
            {
                yield return(fragmentIon);

                yield break;
            }
            int fragmentCountRemaining = maxFragmentationCount - fragmentIon.GetFragmentationEventCount();

            foreach (var linkedFragmentIon in linkedFragmentIons)
            {
                if (linkedFragmentIon.GetFragmentationEventCount() > fragmentCountRemaining)
                {
                    continue;
                }

                if (fragmentIon.IsOrphan)
                {
                    if (linkedFragmentIon.IncludesAaIndex(IndexAa))
                    {
                        continue;
                    }
                }
                else
                {
                    if (!linkedFragmentIon.IncludesAaIndex(IndexAa))
                    {
                        continue;
                    }
                }

                yield return(fragmentIon.AddChild(modificationSite, linkedFragmentIon));
            }
        }
示例#6
0
        public TransitionDocNode MakeTransitionDocNode(ComplexFragmentIon complexFragmentIon,
                                                       IsotopeDistInfo isotopeDist,
                                                       Annotations annotations,
                                                       TransitionDocNode.TransitionQuantInfo transitionQuantInfo,
                                                       ExplicitTransitionValues explicitTransitionValues,
                                                       Results <TransitionChromInfo> results)
        {
            var neutralFormula = GetNeutralFormula(complexFragmentIon);
            var productMass    = GetFragmentMassFromFormula(Settings, neutralFormula);

            if (complexFragmentIon.Children.Count > 0)
            {
                complexFragmentIon = complexFragmentIon.CloneTransition();
            }

            if (complexFragmentIon.IsMs1 && Settings.TransitionSettings.FullScan.IsHighResPrecursor)
            {
                isotopeDist         = isotopeDist ?? GetPrecursorIsotopeDistInfo(complexFragmentIon.Transition.Adduct, 0);
                productMass         = isotopeDist.GetMassI(complexFragmentIon.Transition.MassIndex, complexFragmentIon.Transition.DecoyMassShift);
                transitionQuantInfo = transitionQuantInfo.ChangeIsotopeDistInfo(new TransitionIsotopeDistInfo(
                                                                                    isotopeDist.GetRankI(complexFragmentIon.Transition.MassIndex), isotopeDist.GetProportionI(complexFragmentIon.Transition.MassIndex)));
            }
            return(new TransitionDocNode(complexFragmentIon, annotations, productMass, transitionQuantInfo, explicitTransitionValues, results));
        }
示例#7
0
 public TransitionDocNode MakeTransitionDocNode(ComplexFragmentIon complexFragmentIon, IsotopeDistInfo isotopeDist = null)
 {
     return(MakeTransitionDocNode(complexFragmentIon, isotopeDist, Annotations.EMPTY,
                                  TransitionDocNode.TransitionQuantInfo.DEFAULT, ExplicitTransitionValues.EMPTY, null));
 }
示例#8
0
        public TypedMass GetFragmentMass(ComplexFragmentIon complexFragmentIon)
        {
            var neutralFormula = GetNeutralFormula(complexFragmentIon);

            return(GetFragmentMassFromFormula(Settings, neutralFormula));
        }