// Set raw data point ranges, height, rt and representative scan
height = Double.MIN_VALUE;
for (int i = 0; i < scanNumbers.length; i++) {
DataPoint dp = chromatogram.getDataPoint(scanNumbers[i]);
if (dp == null) {
String error = "Cannot create a resolved peak in a region with missing data points: chromatogram "
+ chromatogram
+ " scans "
+ chromatogramScanNumbers[regionStart]
+ "-"
+ chromatogramScanNumbers[regionEnd]
+ ", missing data point in scan " + scanNumbers[i];
throw new IllegalArgumentException(error);
}
dataPointMZValues[i] = dp.getMZ();
dataPointIntensityValues[i] = dp.getIntensity();
if (rawDataPointsIntensityRange == null) {
rawDataPointsIntensityRange = new Range(dp.getIntensity());
rawDataPointsRTRange = new Range(dataFile.getScan(
scanNumbers[i]).getRetentionTime());
rawDataPointsMZRange = new Range(dp.getMZ());
} else {
rawDataPointsRTRange.extendRange(dataFile.getScan(
scanNumbers[i]).getRetentionTime());
rawDataPointsIntensityRange.extendRange(dp.getIntensity());
rawDataPointsMZRange.extendRange(dp.getMZ());
}
if (height < dp.getIntensity()) {
height = dp.getIntensity();
rt = dataFile.getScan(scanNumbers[i]).getRetentionTime();
representativeScan = scanNumbers[i];
}
}