spectrumRecalibrator.estimateErrors(fileName, identification, annotationPreferences, waitingHandler);
// Debug part
if (debug) {
RunMzDeviation runMzDeviation = spectrumRecalibrator.getRunMzDeviations(fileName);
File debugFile = new File(folder, "debug" + getRecalibratedFileName(fileName) + "_precursors.txt");
BufferedWriter debugWriter = new BufferedWriter(new FileWriter(debugFile));
debugWriter.write("rt\tgrade\toffset");
debugWriter.newLine();
for (double key : runMzDeviation.getPrecursorRTList()) {
if (waitingHandler != null && waitingHandler.isRunCanceled()) {
break;
}
debugWriter.write(key + "\t");
debugWriter.write(runMzDeviation.getSlope(key) + "\t");
debugWriter.write(runMzDeviation.getOffset(key) + "\t");
debugWriter.newLine();
}
debugWriter.flush();
debugWriter.close();
debugFile = new File(folder, getRecalibratedFileName(fileName) + "_fragments.txt");
debugWriter = new BufferedWriter(new FileWriter(debugFile));
for (double rtKey : runMzDeviation.getPrecursorRTList()) {
debugWriter.write(rtKey + "\nm/z");
for (double mzKey : runMzDeviation.getFragmentMZList(rtKey)) {
debugWriter.write("\t" + mzKey);
}
debugWriter.newLine();
debugWriter.write("Error");
for (double mzKey : runMzDeviation.getFragmentMZList(rtKey)) {
debugWriter.write("\t" + runMzDeviation.getFragmentMzError(rtKey, mzKey));
}
debugWriter.newLine();
}