private void FragmentCheck(FragmentIon sourceFragmentIon) { if (!_fragmentList.Where(ion => ion.MZ == sourceFragmentIon.MonoIsotopicMass).Any()) { Core.Domain.FragmentIon fragmentIon = new Core.Domain.FragmentIon(); fragmentIon.ChargeState = sourceFragmentIon.ChargeState; fragmentIon.Peptide = _peptide; fragmentIon.IonSeriesNumber = sourceFragmentIon.SeriesNumber; switch (sourceFragmentIon.FragmentIonType) { case "b": fragmentIon.FragmentIonType = Core.FragmentIonType.BFragment; break; case "y": fragmentIon.FragmentIonType = Core.FragmentIonType.YFragment; break; case "parent": fragmentIon.FragmentIonType = Core.FragmentIonType.Parent; break; default: fragmentIon.FragmentIonType = Core.FragmentIonType.Undefined; break; } fragmentIon.Sequence = sourceFragmentIon.Sequence; fragmentIon.MZ = sourceFragmentIon.MonoIsotopicMass; fragmentIon.PeaksInCalculation = 2; fragmentIon.Id = Guid.NewGuid(); _fragmentList.Add(fragmentIon); } }
public override int GetHashCode() { unchecked { int result = (PeptideModSeq != null ? PeptideModSeq.GetHashCode() : 0); result = (result * 397) ^ OptType.GetHashCode(); result = (result * 397) ^ PrecursorAdduct.GetHashCode(); if (FragmentIon != null) { result = (result * 397) ^ FragmentIon.GetHashCode(); } result = (result * 397) ^ ProductAdduct.GetHashCode(); return(result); } }
private void FragmentUnchecked(FragmentIon sourceFragmentIon) { Core.Domain.FragmentIon fragmentIon = _fragmentList.Where(ion => ion.MZ == sourceFragmentIon.MonoIsotopicMass).FirstOrDefault(); if (fragmentIon != null) { _fragmentList.Remove(fragmentIon); } }