Exemple #1
0
        private static Modification MakeModification(string unmodifiedSequence, ExplicitMod explicitMod)
        {
            var staticMod = explicitMod.Modification;
            int i         = explicitMod.IndexAA;
            var monoMass  = staticMod.MonoisotopicMass ??
                            SrmSettings.MonoisotopicMassCalc.GetAAModMass(unmodifiedSequence[i], i,
                                                                          unmodifiedSequence.Length);
            var avgMass = staticMod.AverageMass ??
                          SrmSettings.AverageMassCalc.GetAAModMass(unmodifiedSequence[i], i,
                                                                   unmodifiedSequence.Length);

            if (monoMass == 0 && avgMass == 0)
            {
                char aa = unmodifiedSequence[i];
                if ((staticMod.LabelAtoms & LabelAtoms.LabelsAA) != LabelAtoms.None && AminoAcid.IsAA(aa))
                {
                    string heavyFormula = SequenceMassCalc.GetHeavyFormula(aa, staticMod.LabelAtoms);
                    monoMass = SequenceMassCalc.FormulaMass(BioMassCalc.MONOISOTOPIC, heavyFormula,
                                                            SequenceMassCalc.MassPrecision);
                    avgMass = SequenceMassCalc.FormulaMass(BioMassCalc.AVERAGE, heavyFormula,
                                                           SequenceMassCalc.MassPrecision);
                }
            }
            return(new Modification(explicitMod, monoMass, avgMass));
        }
Exemple #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ExplicitMod.GetHashCode();
         hashCode = (hashCode * 397) ^ MonoisotopicMass.GetHashCode();
         hashCode = (hashCode * 397) ^ AverageMass.GetHashCode();
         return(hashCode);
     }
 }
Exemple #3
0
        public static Modification ResolveModification(SrmSettings settings, IsotopeLabelType labelType, string unmodifiedSequence,
                                                       ExplicitMod explicitMod)
        {
            var modification = MakeModification(unmodifiedSequence, explicitMod);

            if (explicitMod?.LinkedPeptide?.Peptide == null)
            {
                return(modification);
            }

            return(modification.ChangeLinkedPeptideSequence(GetModifiedSequence(settings,
                                                                                explicitMod.LinkedPeptide.Peptide.Sequence, explicitMod.LinkedPeptide.ExplicitMods, labelType)));
        }
Exemple #4
0
        public void TestCrosslinkPrecursorMz()
        {
            var srmSettings = SrmSettingsList.GetDefault();

            srmSettings = srmSettings.ChangePeptideSettings(
                srmSettings.PeptideSettings.ChangeModifications(
                    srmSettings.PeptideSettings.Modifications.ChangeStaticModifications(new StaticMod[0])));
            var mainPeptide   = new Peptide("WQEGNVFSCSVMHEALHNHYTQK");
            var otherPeptide  = new Peptide("NQVSLTCLVK");
            var linkedPeptide = new LinkedPeptide(otherPeptide, 6, ExplicitMods.EMPTY);
            var crosslinkMod  = new StaticMod("disulfide", "C", null, "-H2").ChangeCrosslinkerSettings(CrosslinkerSettings.EMPTY);

            var transitionGroup = new TransitionGroup(mainPeptide, Adduct.DOUBLY_PROTONATED, IsotopeLabelType.light);
            var explicitMod     = new ExplicitMod(8, crosslinkMod).ChangeLinkedPeptide(linkedPeptide);
            var explicitMods    = new ExplicitMods(mainPeptide, new[] { explicitMod }, new List <TypedExplicitModifications>());

            var transitionGroupDocNode = new TransitionGroupDocNode(transitionGroup, Annotations.EMPTY, srmSettings, explicitMods, null, ExplicitTransitionGroupValues.EMPTY, null, null, false);

            Assert.AreEqual(1923.9111, transitionGroupDocNode.PrecursorMz, .001);
        }
Exemple #5
0
        public void TestLooplink()
        {
            var peptide          = new Peptide("PEPTIDE");
            var srmSettings      = SrmSettingsList.GetDefault();
            var transitionFilter = srmSettings.TransitionSettings.Filter;

            transitionFilter = transitionFilter
                               .ChangeFragmentRangeFirstName(TransitionFilter.StartFragmentFinder.ION_1.Name)
                               .ChangeFragmentRangeLastName(@"last ion")
                               .ChangePeptideIonTypes(new[] { IonType.precursor, IonType.y, IonType.b });
            srmSettings = srmSettings.ChangeTransitionSettings(
                srmSettings.TransitionSettings.ChangeFilter(transitionFilter));

            var transitionGroup           = new TransitionGroup(peptide, Adduct.SINGLY_PROTONATED, IsotopeLabelType.light);
            var crosslinkerDef            = new StaticMod("dss", null, null, "C8H10O2");
            var linkedPeptide             = new LinkedPeptide(null, 5, null);
            var crosslinkMod              = new ExplicitMod(2, crosslinkerDef).ChangeLinkedPeptide(linkedPeptide);
            var explicitModsWithCrosslink = new ExplicitMods(peptide, new[] { crosslinkMod }, new TypedExplicitModifications[0]);
            var transitionGroupDocNode    = new TransitionGroupDocNode(transitionGroup, Annotations.EMPTY, srmSettings,
                                                                       explicitModsWithCrosslink, null, ExplicitTransitionGroupValues.EMPTY, null, null, false);
            var modifiedSequence = ModifiedSequence.GetModifiedSequence(srmSettings, peptide.Sequence,
                                                                        explicitModsWithCrosslink, IsotopeLabelType.light);

            Assert.AreEqual("PEPTIDE-[dss@3-6]", modifiedSequence.FullNames);

            var choices = transitionGroupDocNode.GetPrecursorChoices(srmSettings, explicitModsWithCrosslink, true)
                          .Cast <TransitionDocNode>().ToArray();
            var complexFragmentIons = choices.Select(transition => transition.ComplexFragmentIon.GetName()).ToArray();
            // Make sure none of the transitions involve a cleavage in between the two ends of the looplink
            // PEpTIdE
            var yOrdinals = complexFragmentIons.Where(ion => ion.IonType == IonType.y).Select(ion => ion.Ordinal)
                            .Distinct().ToList();
            var bOrdinals = complexFragmentIons.Where(ion => ion.IonType == IonType.b).Select(ion => ion.Ordinal)
                            .Distinct().ToList();

            CollectionAssert.AreEquivalent(new[] { 6, 5, 1 }, yOrdinals);
            CollectionAssert.AreEquivalent(new[] { 1, 2, 6 }, bOrdinals);
        }
Exemple #6
0
 protected bool Equals(Modification other)
 {
     return(ExplicitMod.Equals(other.ExplicitMod) && MonoisotopicMass.Equals(other.MonoisotopicMass) &&
            AverageMass.Equals(other.AverageMass));
 }
Exemple #7
0
 public Modification(ExplicitMod explicitMod, double monoMass, double avgMass)
 {
     ExplicitMod      = explicitMod;
     MonoisotopicMass = monoMass;
     AverageMass      = avgMass;
 }