public double GetMass(QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average) { if (Count <= 1) { return(MonoisotopicMass); } switch (massType) { default: case QuantitationChannelSetMassType.Average: return(MonoisotopicMass / Count); case QuantitationChannelSetMassType.Lightest: return(LightestChannel.MonoisotopicMass); case QuantitationChannelSetMassType.Heaviest: return(HeaviestChannel.MonoisotopicMass); case QuantitationChannelSetMassType.Median: if (Count % 2 == 0) { return((_channels.Values[(Count / 2) - 1].MonoisotopicMass + _channels.Values[Count / 2].MonoisotopicMass) / 2.0); } return(_channels.Values[Count / 2].MonoisotopicMass); } }
public QuantitationChannelSet(string name, QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average, bool sequenceDependent = true) { Name = name; MassType = massType; MonoisotopicMass = 0; _channels = new SortedList<double, IQuantitationChannel>(); IsSequenceDependent = sequenceDependent; }
public QuantitationChannelSet(string name, QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average, bool sequenceDependent = true) { Name = name; MassType = massType; MonoisotopicMass = 0; _channels = new SortedList <double, IQuantitationChannel>(); IsSequenceDependent = sequenceDependent; }
public double GetMass(QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average) { if (Count <= 1) { return MonoisotopicMass; } switch (massType) { default: case QuantitationChannelSetMassType.Average: return MonoisotopicMass / Count; case QuantitationChannelSetMassType.Lightest: return LightestChannel.MonoisotopicMass; case QuantitationChannelSetMassType.Heaviest: return HeaviestChannel.MonoisotopicMass; case QuantitationChannelSetMassType.Median: if (Count % 2 == 0) { return (_channels.Values[(Count / 2) - 1].MonoisotopicMass + _channels.Values[Count / 2].MonoisotopicMass) / 2.0; } else { return _channels.Values[Count / 2].MonoisotopicMass; } } }