Exemplo n.º 1
0
        private static IsotopomerEnvelope ComputeIsotopomerEnvelope(double mass)
        {
            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;
            }
            return(IsoProfilePredictor.GetIsotopomerEnvelop(numC, numH, numN, numO, numS));
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
0
 static IsoProfilePredictor()
 {
     Predictor = new IsoProfilePredictor();
 }
Exemplo n.º 4
0
        /// <summary>
        /// Get the theoretical Isotope profile for <paramref name="monoIsotopeMass"/> at charge <paramref name="charge"/> using <paramref name="isoProfilePredictor"/>
        /// </summary>
        /// <param name="monoIsotopeMass"></param>
        /// <param name="charge"></param>
        /// <param name="relativeIntensityThreshold"></param>
        /// <param name="isoProfilePredictor"></param>
        /// <returns></returns>
        public List <Peak> GetTheoreticalIsotopeProfileInst(double monoIsotopeMass, int charge, double relativeIntensityThreshold = 0.1, IsoProfilePredictor isoProfilePredictor = null)
        {
            var peakList = new List <Peak>();
            var envelope = GetIsotopomerEnvelopeInst(monoIsotopeMass, isoProfilePredictor);

            for (var isotopeIndex = 0; isotopeIndex < envelope.Envelope.Length; isotopeIndex++)
            {
                var intensity = envelope.Envelope[isotopeIndex];
                if (intensity < relativeIntensityThreshold)
                {
                    continue;
                }
                var mz = Ion.GetIsotopeMz(monoIsotopeMass, charge, isotopeIndex);
                peakList.Add(new Peak(mz, intensity));
            }
            return(peakList);
        }
Exemplo n.º 5
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 * Constants.RescalingConstant);

            return(GetIsotopomerEnvelopeFromNominalMassInst(nominalMass, isoProfilePredictor));
        }
Exemplo n.º 6
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 / Constants.RescalingConstant;

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

            return(envelope);
        }