Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public QuantitationChannelSet(string name, QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average, bool sequenceDependent = true)
 {
     Name = name;
     MassType = massType;
     MonoisotopicMass = 0;
     _channels = new SortedList<double, IQuantitationChannel>();
     IsSequenceDependent = sequenceDependent;
 }
Ejemplo n.º 3
0
 public QuantitationChannelSet(string name, QuantitationChannelSetMassType massType = QuantitationChannelSetMassType.Average, bool sequenceDependent = true)
 {
     Name                = name;
     MassType            = massType;
     MonoisotopicMass    = 0;
     _channels           = new SortedList <double, IQuantitationChannel>();
     IsSequenceDependent = sequenceDependent;
 }
Ejemplo n.º 4
0
        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;
                    }
            }
        }