public static double[] GetBSeries(string sequence, PeptideModificationState fixedMods, PeptideModificationState varMods) { double m = MolUtil.BIonMassOffset; if (fixedMods.GetNTermModification() != ushort.MaxValue) { Modification mod = Tables.modificationList[fixedMods.GetNTermModification()]; m += mod.DeltaMass; } if (varMods.GetNTermModification() != ushort.MaxValue) { Modification mod = Tables.modificationList[varMods.GetNTermModification()]; m += mod.DeltaMass; } double[] masses = new double[sequence.Length - 1]; for (int i = 0; i < masses.Length; i++) { m += AminoAcid.aaMonoMasses[sequence[i]]; if (fixedMods.GetModificationAt(i) != ushort.MaxValue) { Modification mod = Tables.modificationList[fixedMods.GetModificationAt(i)]; m += mod.DeltaMass; } if (varMods.GetModificationAt(i) != ushort.MaxValue) { Modification mod = Tables.modificationList[varMods.GetModificationAt(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); }