use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.
the class MsMsBottomPanel method getPeaksInThreshold.
/**
* Returns a feature list different peaks depending on the selected option of the "peak Threshold"
* combo box
*/
PeakList getPeaksInThreshold() {
PeakList selectedPeakList = (PeakList) peakListSelector.getSelectedItem();
PeakThresholdMode mode = (PeakThresholdMode) thresholdCombo.getSelectedItem();
switch(mode) {
case ABOVE_INTENSITY_PEAKS:
double threshold = thresholdSettings.getIntensityThreshold();
return getIntensityThresholdPeakList(threshold);
case ALL_PEAKS:
return selectedPeakList;
case TOP_PEAKS:
case TOP_PEAKS_AREA:
int topPeaks = thresholdSettings.getTopPeaksThreshold();
return getTopThresholdPeakList(topPeaks);
}
return null;
}
use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.
the class MsMsBottomPanel method rebuildPeakListSelector.
/**
* Reloads feature lists from the project to the selector combo box
*/
void rebuildPeakListSelector() {
logger.finest("Rebuilding the feature list selector");
PeakList selectedPeakList = (PeakList) peakListSelector.getSelectedItem();
PeakList[] currentPeakLists = MZmineCore.getProjectManager().getCurrentProject().getPeakLists(dataFile);
peakListSelector.removeAllItems();
for (int i = currentPeakLists.length - 1; i >= 0; i--) {
peakListSelector.addItem(currentPeakLists[i]);
}
if (selectedPeakList != null)
peakListSelector.setSelectedItem(selectedPeakList);
}
use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.
the class MsMsBottomPanel method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if (src == thresholdCombo) {
PeakThresholdMode mode = (PeakThresholdMode) this.thresholdCombo.getSelectedItem();
switch(mode) {
case ABOVE_INTENSITY_PEAKS:
peakTextField.setText(String.valueOf(thresholdSettings.getIntensityThreshold()));
peakTextField.setEnabled(true);
break;
case ALL_PEAKS:
peakTextField.setEnabled(false);
break;
case TOP_PEAKS:
case TOP_PEAKS_AREA:
peakTextField.setText(String.valueOf(thresholdSettings.getTopPeaksThreshold()));
peakTextField.setEnabled(true);
break;
}
thresholdSettings.setMode(mode);
}
if (src == peakTextField) {
PeakThresholdMode mode = (PeakThresholdMode) this.thresholdCombo.getSelectedItem();
String value = peakTextField.getText();
switch(mode) {
case ABOVE_INTENSITY_PEAKS:
double topInt = Double.parseDouble(value);
thresholdSettings.setIntensityThreshold(topInt);
break;
case TOP_PEAKS:
case TOP_PEAKS_AREA:
int topPeaks = Integer.parseInt(value);
thresholdSettings.setTopPeaksThreshold(topPeaks);
break;
default:
break;
}
}
PeakList selectedPeakList = getPeaksInThreshold();
if (selectedPeakList != null)
masterFrame.getPlot().loadPeakList(selectedPeakList);
}
use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.
the class CustomDBSearchModule method runModule.
@Override
@Nonnull
public ExitCode runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters, @Nonnull Collection<Task> tasks) {
PeakList[] peakLists = parameters.getParameter(CustomDBSearchParameters.peakLists).getValue().getMatchingPeakLists();
for (PeakList peakList : peakLists) {
Task newTask = new CustomDBSearchTask(peakList, parameters);
tasks.add(newTask);
}
return ExitCode.OK;
}
use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.
the class PeaklistClearAnnotationsModule method runModule.
@Override
@Nonnull
public ExitCode runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters, @Nonnull Collection<Task> tasks) {
final PeakList[] peakLists = parameters.getParameter(PeaklistClearAnnotationsParameters.PEAK_LISTS).getValue().getMatchingPeakLists();
for (PeakList peakList : peakLists) {
Task newTask = new PeaklistClearAnnotationsTask(project, peakList, parameters);
tasks.add(newTask);
}
return ExitCode.OK;
}
Aggregations