public static double[] GetYSeries(string sequence, PeptideModificationState fixedMods, PeptideModificationState varMods) { double m = MolUtil.YIonMassOffset; if (fixedMods.GetCTermModification() != ushort.MaxValue) { Modification mod = Tables.modificationList[fixedMods.GetCTermModification()]; m += mod.DeltaMass; } if (varMods.GetCTermModification() != ushort.MaxValue) { Modification mod = Tables.modificationList[varMods.GetCTermModification()]; m += mod.DeltaMass; } int n = sequence.Length - 1; double[] masses = new double[n]; for (int i = 0; i < masses.Length; i++) { m += AminoAcid.aaMonoMasses[sequence[n - i]]; if (fixedMods.GetModificationAt(n - i) != ushort.MaxValue) { Modification mod = Tables.modificationList[fixedMods.GetModificationAt(n - i)]; m += mod.DeltaMass; } if (varMods.GetModificationAt(n - i) != ushort.MaxValue) { Modification mod = Tables.modificationList[varMods.GetModificationAt(n - i)]; m += mod.DeltaMass; } masses[i] = m; } return(masses); }
public override bool Equals(object anObject) { if (this == anObject) { return(true); } if (anObject is PeptideModificationState) { PeptideModificationState other = (PeptideModificationState)anObject; if (other.GetNTermModification() != GetNTermModification()) { return(false); } if (other.GetCTermModification() != GetCTermModification()) { return(false); } if (other.Length != Length) { return(false); } for (int i = 0; i < Length; i++) { if (other.GetModificationAt(i) != GetModificationAt(i)) { return(false); } } return(true); } return(false); }