private static void AssignSrmFileItemTo(SrmFileItem source, MzItem target) { target.ObjectName = source.PairedProductIon.ObjectName; target.PrecursurFormula = source.PairedProductIon.PrecursorFormula; target.PrecursurCharge = source.PairedProductIon.PrecursorCharge; target.LightMz = source.PairedPeptide.LightPrecursorMZ; target.HeavyMz = source.PairedPeptide.HeavyPrecursorMZ; }
private bool IsSameCompound(MzItem a, SrmFileItem b) { if (a.HasName()) { return(a.NameChargeEquals(b)); } else { return(a.MzEquals(b.PrecursorMz, MzTolerance)); } }
public bool NameChargeEquals(MzItem another) { return(string.Equals(this.ObjectName, another.ObjectName) && string.Equals(this.PrecursurFormula, another.PrecursurFormula) && this.PrecursurCharge == another.PrecursurCharge); }
public bool MzEquals(MzItem another, double mzTolerance) { return((Math.Abs(this.LightMz - another.LightMz) <= mzTolerance) && (Math.Abs(this.HeavyMz - another.HeavyMz) <= mzTolerance)); }