Search in sources :

Example 21 with PeakList

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;
}
Also used : SimplePeakList(net.sf.mzmine.datamodel.impl.SimplePeakList) PeakList(net.sf.mzmine.datamodel.PeakList)

Example 22 with PeakList

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);
}
Also used : SimplePeakList(net.sf.mzmine.datamodel.impl.SimplePeakList) PeakList(net.sf.mzmine.datamodel.PeakList)

Example 23 with PeakList

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);
}
Also used : SimplePeakList(net.sf.mzmine.datamodel.impl.SimplePeakList) PeakList(net.sf.mzmine.datamodel.PeakList)

Example 24 with PeakList

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;
}
Also used : Task(net.sf.mzmine.taskcontrol.Task) PeakList(net.sf.mzmine.datamodel.PeakList) Nonnull(javax.annotation.Nonnull)

Example 25 with PeakList

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;
}
Also used : Task(net.sf.mzmine.taskcontrol.Task) PeakList(net.sf.mzmine.datamodel.PeakList) Nonnull(javax.annotation.Nonnull)

Aggregations

PeakList (net.sf.mzmine.datamodel.PeakList)120 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)41 Nonnull (javax.annotation.Nonnull)40 Task (net.sf.mzmine.taskcontrol.Task)37 RawDataFile (net.sf.mzmine.datamodel.RawDataFile)36 SimplePeakList (net.sf.mzmine.datamodel.impl.SimplePeakList)26 Feature (net.sf.mzmine.datamodel.Feature)19 ArrayList (java.util.ArrayList)15 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)11 SimplePeakListAppliedMethod (net.sf.mzmine.datamodel.impl.SimplePeakListAppliedMethod)11 SimplePeakListRow (net.sf.mzmine.datamodel.impl.SimplePeakListRow)10 File (java.io.File)9 FileWriter (java.io.FileWriter)8 ParameterSet (net.sf.mzmine.parameters.ParameterSet)8 IOException (java.io.IOException)7 DataPoint (net.sf.mzmine.datamodel.DataPoint)7 Vector (java.util.Vector)6 IsotopePattern (net.sf.mzmine.datamodel.IsotopePattern)6 MZmineProject (net.sf.mzmine.datamodel.MZmineProject)6 PeakIdentity (net.sf.mzmine.datamodel.PeakIdentity)6