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); }
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); }