Search in sources :

Example 16 with PeakList

use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.

the class ADAP3AlignerTask method findPeakListRow.

/**
 * Find the existing {@link PeakListRow} for a given feature list ID and row ID.
 *
 * @param peakListID number of a feature list in the array of {@link PeakList}. The numeration starts with 0.
 * @param rowID integer that is returned by method getId() of {@link PeakListRow}.
 * @return an instance of {@link PeakListRow} if an existing row is found. Otherwise it returns null.
 */
@Nullable
private PeakListRow findPeakListRow(final int peakListID, final int rowID) {
    // Find feature list
    PeakList peakList = findPeakList(peakListID);
    if (peakList == null)
        return null;
    // Find row
    PeakListRow row = null;
    for (final PeakListRow r : peakList.getRows()) if (rowID == r.getID()) {
        row = r;
        break;
    }
    return row;
}
Also used : PeakListRow(net.sf.mzmine.datamodel.PeakListRow) PeakList(net.sf.mzmine.datamodel.PeakList) Nullable(javax.annotation.Nullable)

Example 17 with PeakList

use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.

the class SmoothingModule method runModule.

@Override
@Nonnull
public ExitCode runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters, @Nonnull Collection<Task> tasks) {
    PeakList[] peakLists = parameters.getParameter(SmoothingParameters.peakLists).getValue().getMatchingPeakLists();
    for (final PeakList peakList : peakLists) {
        Task newTask = new SmoothingTask(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)

Example 18 with PeakList

use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.

the class ProjectOpeningTask method loadPeakList.

private void loadPeakList(InputStream is, String peakListName) throws IOException, ParserConfigurationException, SAXException, InstantiationException, IllegalAccessException {
    logger.info("Loading feature list " + peakListName);
    currentLoadedObjectName = peakListName;
    PeakList newPeakList = peakListOpenHandler.readPeakList(is);
    newProject.addPeakList(newPeakList);
    // Add quality parameters to peaks
    QualityParameters.calculateQualityParameters(newPeakList);
}
Also used : PeakList(net.sf.mzmine.datamodel.PeakList)

Example 19 with PeakList

use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.

the class PeakResolverSetupDialog method addDialogComponents.

/**
 * This function add all the additional components for this dialog over the original
 * ParameterSetupDialog.
 */
@Override
protected void addDialogComponents() {
    super.addDialogComponents();
    final PeakList[] peakLists = MZmineCore.getProjectManager().getCurrentProject().getPeakLists();
    // Elements of panel.
    preview = new JCheckBox("Show preview");
    preview.addActionListener(this);
    preview.setHorizontalAlignment(SwingConstants.CENTER);
    preview.setEnabled(peakLists.length > 0);
    // Preview panel.
    final JPanel previewPanel = new JPanel(new BorderLayout());
    previewPanel.add(new JSeparator(), BorderLayout.NORTH);
    previewPanel.add(preview, BorderLayout.CENTER);
    previewPanel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
    // Feature list combo-box.
    comboPeakList = new JComboBox<PeakList>();
    comboPeakList.setFont(COMBO_FONT);
    for (final PeakList peakList : peakLists) {
        if (peakList.getNumberOfRawDataFiles() == 1) {
            comboPeakList.addItem(peakList);
        }
    }
    comboPeakList.addActionListener(this);
    // Peaks combo box.
    comboPeak = new JComboBox<PeakListRow>();
    comboPeak.setFont(COMBO_FONT);
    comboPeak.setRenderer(new PeakPreviewComboRenderer());
    comboPeak.setPreferredSize(new Dimension(PREFERRED_PEAK_COMBO_WIDTH, comboPeak.getPreferredSize().height));
    pnlLabelsFields = GUIUtils.makeTablePanel(2, 2, new JComponent[] { new JLabel("Feature list"), comboPeakList, new JLabel("Chromatogram"), comboPeak });
    // Put all together.
    pnlVisible = new JPanel(new BorderLayout());
    pnlVisible.add(previewPanel, BorderLayout.NORTH);
    // TIC plot.
    ticPlot = new TICPlot(this);
    ticPlot.setMinimumSize(MINIMUM_TIC_DIMENSIONS);
    // Tool bar.
    final TICToolBar toolBar = new TICToolBar(ticPlot);
    toolBar.getComponentAtIndex(0).setVisible(false);
    // Panel for XYPlot.
    pnlPlotXY = new JPanel(new BorderLayout());
    pnlPlotXY.setBackground(Color.white);
    pnlPlotXY.add(ticPlot, BorderLayout.CENTER);
    pnlPlotXY.add(toolBar, BorderLayout.EAST);
    GUIUtils.addMarginAndBorder(pnlPlotXY, 10);
    mainPanel.add(pnlVisible, 0, getNumberOfParameters() + 3, 2, 1, 0, 0, GridBagConstraints.HORIZONTAL);
    // Layout and position.
    updateBounds();
}
Also used : JPanel(javax.swing.JPanel) TICToolBar(net.sf.mzmine.modules.visualization.tic.TICToolBar) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JSeparator(javax.swing.JSeparator) JCheckBox(javax.swing.JCheckBox) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) BorderLayout(java.awt.BorderLayout) PeakList(net.sf.mzmine.datamodel.PeakList) TICPlot(net.sf.mzmine.modules.visualization.tic.TICPlot)

Example 20 with PeakList

use of net.sf.mzmine.datamodel.PeakList in project mzmine2 by mzmine.

the class ScatterPlotVisualizerModule method runModule.

@Override
@Nonnull
public ExitCode runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters, @Nonnull Collection<Task> tasks) {
    PeakList[] peakLists = parameters.getParameter(ScatterPlotParameters.peakLists).getValue().getMatchingPeakLists();
    if ((peakLists == null) || (peakLists.length != 1)) {
        MZmineCore.getDesktop().displayErrorMessage(MZmineCore.getDesktop().getMainWindow(), "Please select a single aligned feature list");
        return ExitCode.ERROR;
    }
    PeakList peakList = peakLists[0];
    if (peakList.getNumberOfRawDataFiles() < 2) {
        MZmineCore.getDesktop().displayErrorMessage(MZmineCore.getDesktop().getMainWindow(), "There is only one raw data file in the selected " + "feature list, it is necessary at least two for comparison");
        return ExitCode.ERROR;
    }
    ScatterPlotWindow newWindow = new ScatterPlotWindow(peakList);
    newWindow.setVisible(true);
    return ExitCode.OK;
}
Also used : 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