Esempio n. 1
0
        public IsotopeDistribution estimateForFragmentFromWeightsAndSulfur(double monoPeptideMass, double monoFragmentMass,
                                                                           int minIsotope, int maxIsotope, int precursorSulfur, int fragmentSulfur)
        {
            IsotopeDistribution fragment     = estimateFromPeptideWeightAndSulfur(monoFragmentMass, maxIsotope, precursorSulfur);
            IsotopeDistribution compFragment = estimateFromPeptideWeightAndSulfur(monoPeptideMass - monoFragmentMass, maxIsotope, fragmentSulfur);

            return(calcFragmentIsotopeDistribution(fragment, compFragment, minIsotope, maxIsotope));
        }
Esempio n. 2
0
        private IsotopeDistribution calcFragmentIsotopeDistribution(IsotopeDistribution fragment, IsotopeDistribution compFragment,
                                                                    int minIsotope, int maxIsotope)
        {
            IsotopeDistribution result = new IsotopeDistribution(maxIsotope);

            for (int i = 0; i < fragment.size(); ++i)
            {
                for (int isotope = minIsotope; isotope <= maxIsotope; ++isotope)
                {
                    if (isotope >= i && (isotope - i) < compFragment.size())
                    {
                        result.setIntensity(i, (float)(result.getIntensity(i) + compFragment.getIntensity(isotope - i)));
                    }
                }
                result.setIntensity(i, (float)(result.getIntensity(i) * fragment.getIntensity(i)));
                result.setMass(i, fragment.getMass(0) + (i * C13C12_MASSDIFF_U));
            }

            return(result);
        }
Esempio n. 3
0
        IsotopeDistribution estimateFromPeptideWeightAndSulfur(double monoMass, int maxIsotope, int numSulfur)
        {
            IsotopeDistribution result;

            if (inModelBounds(monoMass, maxIsotope, numSulfur))
            {
                result = new IsotopeDistribution(maxIsotope);
                for (int isotope = 0; isotope <= maxIsotope; ++isotope)
                {
                    //double probability = numSulfur2models_.get(numSulfur).get(isotope).eval(monoMass);
                    double probability = numSulfur2models_[numSulfur][isotope].eval(monoMass);
                    result.setMass(isotope, monoMass + (isotope * C13C12_MASSDIFF_U));
                    result.setIntensity(isotope, (float)probability);
                }
            }
            else
            {
                throw new Exception("Request out of range.");
            }

            return(result);
        }