CSMSL.Analysis.Quantitation.QuantitationChannelSet.GetMass C# (CSharp) Метод

GetMass() публичный Метод

public GetMass ( QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average ) : double
massType QuantitationChannelSetMassType
Результат double
        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;
            }
        }