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); }
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); }
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)); } }
/// <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); }
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)); } }
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)); }
public TransitionDocNode MakeTransitionDocNode(ComplexFragmentIon complexFragmentIon, IsotopeDistInfo isotopeDist = null) { return(MakeTransitionDocNode(complexFragmentIon, isotopeDist, Annotations.EMPTY, TransitionDocNode.TransitionQuantInfo.DEFAULT, ExplicitTransitionValues.EMPTY, null)); }
public TypedMass GetFragmentMass(ComplexFragmentIon complexFragmentIon) { var neutralFormula = GetNeutralFormula(complexFragmentIon); return(GetFragmentMassFromFormula(Settings, neutralFormula)); }