* Returns a peak list with the top peaks defined by the parameter
* "threshold"
*/
PeakList getTopThresholdPeakList(int threshold) {
PeakList selectedPeakList = (PeakList) peakListSelector
.getSelectedItem();
if (selectedPeakList == null)
return null;
SimplePeakList newList = new SimplePeakList(selectedPeakList.getName(),
selectedPeakList.getRawDataFiles());
Vector<PeakListRow> peakRows = new Vector<PeakListRow>();
Range mzRange = selectedPeakList.getRowsMZRange();
Range rtRange = selectedPeakList.getRowsRTRange();
PeakThresholdMode selectedPeakOption = (PeakThresholdMode) thresholdCombo
.getSelectedItem();
if (selectedPeakOption == PeakThresholdMode.TOP_PEAKS_AREA) {
mzRange = masterFrame.getPlot().getXYPlot().getAxisRange();
rtRange = masterFrame.getPlot().getXYPlot().getDomainRange();
}
for (PeakListRow peakRow : selectedPeakList.getRows()) {
if (mzRange.contains(peakRow.getAverageMZ())
&& rtRange.contains(peakRow.getAverageRT())) {
peakRows.add(peakRow);
}
}