Example #1
0
        private IsotopomerEnvelope ComputeIsotopomerEnvelope(double mass, IsoProfilePredictor isoProfilePredictor = null)
        {
            var numAveragines = mass / AveragineMass;
            var numC          = (int)Math.Round(C * numAveragines);
            var numH          = (int)Math.Round(H * numAveragines);
            var numN          = (int)Math.Round(N * numAveragines);
            var numO          = (int)Math.Round(O * numAveragines);
            var numS          = (int)Math.Round(S * numAveragines);

            if (numH == 0)
            {
                numH = 1;
            }

            isoProfilePredictor = isoProfilePredictor ?? IsoProfilePredictor.Predictor;
            return(isoProfilePredictor.GetIsotopomerEnvelope(numC, numH, numN, numO, numS));
        }
Example #2
0
 static IsoProfilePredictor()
 {
     Predictor = new IsoProfilePredictor();
 }
Example #3
0
        /// <summary>
        /// Get the Isotopomer envelope for the nominal mass <paramref name="nominalMass"/> using <paramref name="isoProfilePredictor"/>
        /// </summary>
        /// <param name="nominalMass"></param>
        /// <param name="isoProfilePredictor"></param>
        /// <returns></returns>
        public IsotopomerEnvelope GetIsotopomerEnvelopeFromNominalMassInst(int nominalMass, IsoProfilePredictor isoProfilePredictor = null)
        {
            var nominalMassFound = IsotopeEnvelopMap.TryGetValue(nominalMass, out var envelope);

            if (nominalMassFound)
            {
                return(envelope);
            }

            var mass = nominalMass / 0.9995;

            envelope = ComputeIsotopomerEnvelope(mass, isoProfilePredictor);
            IsotopeEnvelopMap.AddOrUpdate(nominalMass, envelope, (key, value) => value);

            return(envelope);
        }
Example #4
0
        /// <summary>
        /// Get the Isotopomer envelope for <paramref name="monoIsotopeMass"/> using <paramref name="isoProfilePredictor"/>
        /// </summary>
        /// <param name="monoIsotopeMass"></param>
        /// <param name="isoProfilePredictor"></param>
        /// <returns></returns>
        public IsotopomerEnvelope GetIsotopomerEnvelopeInst(double monoIsotopeMass, IsoProfilePredictor isoProfilePredictor = null)
        {
            var nominalMass = (int)Math.Round(monoIsotopeMass * 0.9995);

            return(GetIsotopomerEnvelopeFromNominalMassInst(nominalMass, isoProfilePredictor));
        }