Map<DataPoint, String> msmsAnnotations = new Hashtable<DataPoint, String>();
msmsCycle : for (DataPoint dp : msmsIons) {
// Check if this is an isotope
Range isotopeCheckRange = new Range(dp.getMZ() - 1.4,
dp.getMZ() - 0.6);
for (DataPoint dpCheck : msmsIons) {
// If we have any MS/MS peak with 1 neutron mass smaller m/z
// and higher intensity, it means the current peak is an
// isotope and we should ignore it
if (isotopeCheckRange.contains(dpCheck.getMZ())
&& (dpCheck.getIntensity() > dp.getIntensity())) {
continue msmsCycle;
}
}
// We don't know the charge of the fragment, so we will simply
// assume 1
double neutralLoss = msmsScan.getPrecursorMZ()
* msmsScan.getPrecursorCharge() - dp.getMZ();
// Ignore negative neutral losses and parent ion, <5 may be a
// good threshold
if (neutralLoss < 5)
continue;
Range msmsTargetRange = msmsTolerance
.getToleranceRange(neutralLoss);
FormulaGenerator msmsEngine = new FormulaGenerator(msmsTargetRange,
msmsElementRules);