Search in sources :

Example 1 with TICVisualizerWindow

use of net.sf.mzmine.modules.visualization.tic.TICVisualizerWindow in project mzmine2 by mzmine.

the class MultiSpectraVisualizerWindow method addSpectra.

private JPanel addSpectra(int scan) {
    JPanel panel = new JPanel(new BorderLayout());
    // Split pane for eic plot (top) and spectrum (bottom)
    JSplitPane bottomPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    // Create EIC plot
    // labels for TIC visualizer
    Map<Feature, String> labelsMap = new HashMap<Feature, String>(0);
    Feature peak = row.getPeak(activeRaw);
    // scan selection
    ScanSelection scanSelection = new ScanSelection(activeRaw.getDataRTRange(1), 1);
    // mz range
    Range<Double> mzRange = null;
    mzRange = peak.getRawDataPointsMZRange();
    // optimize output by extending the range
    double upper = mzRange.upperEndpoint();
    double lower = mzRange.lowerEndpoint();
    double fiveppm = (upper * 5E-6);
    mzRange = Range.closed(lower - fiveppm, upper + fiveppm);
    // labels
    labelsMap.put(peak, peak.toString());
    // get EIC window
    TICVisualizerWindow window = new // raw
    TICVisualizerWindow(// raw
    new RawDataFile[] { activeRaw }, // plot type
    TICPlotType.BASEPEAK, // scan selection
    scanSelection, // mz range
    mzRange, // selected features
    new Feature[] { peak }, // labels
    labelsMap);
    // get EIC Plot
    TICPlot ticPlot = window.getTICPlot();
    ticPlot.setPreferredSize(new Dimension(600, 200));
    ticPlot.getChart().getLegend().setVisible(false);
    // add a retention time Marker to the EIC
    ValueMarker marker = new ValueMarker(activeRaw.getScan(scan).getRetentionTime());
    marker.setPaint(Color.RED);
    marker.setStroke(new BasicStroke(3.0f));
    XYPlot plot = (XYPlot) ticPlot.getChart().getPlot();
    plot.addDomainMarker(marker);
    bottomPane.add(ticPlot);
    bottomPane.setResizeWeight(0.5);
    bottomPane.setEnabled(true);
    bottomPane.setDividerSize(5);
    bottomPane.setDividerLocation(200);
    JSplitPane spectrumPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    // get MS/MS spectra window
    SpectraVisualizerWindow spectraWindow = new SpectraVisualizerWindow(activeRaw);
    spectraWindow.loadRawData(activeRaw.getScan(scan));
    // get MS/MS spectra plot
    SpectraPlot spectrumPlot = spectraWindow.getSpectrumPlot();
    spectrumPlot.getChart().getLegend().setVisible(false);
    spectrumPlot.setPreferredSize(new Dimension(600, 400));
    spectrumPane.add(spectrumPlot);
    spectrumPane.add(spectraWindow.getToolBar());
    spectrumPane.setResizeWeight(1);
    spectrumPane.setEnabled(false);
    spectrumPane.setDividerSize(0);
    bottomPane.add(spectrumPane);
    panel.add(bottomPane);
    panel.setBorder(BorderFactory.createLineBorder(Color.black));
    return panel;
}
Also used : BasicStroke(java.awt.BasicStroke) JPanel(javax.swing.JPanel) ScanSelection(net.sf.mzmine.parameters.parametertypes.selectors.ScanSelection) HashMap(java.util.HashMap) Dimension(java.awt.Dimension) Feature(net.sf.mzmine.datamodel.Feature) TICVisualizerWindow(net.sf.mzmine.modules.visualization.tic.TICVisualizerWindow) BorderLayout(java.awt.BorderLayout) XYPlot(org.jfree.chart.plot.XYPlot) JSplitPane(javax.swing.JSplitPane) TICPlot(net.sf.mzmine.modules.visualization.tic.TICPlot) ValueMarker(org.jfree.chart.plot.ValueMarker)

Example 2 with TICVisualizerWindow

use of net.sf.mzmine.modules.visualization.tic.TICVisualizerWindow in project mzmine2 by mzmine.

the class FeatureOverviewWindow method addTicPlot.

private JSplitPane addTicPlot(PeakListRow row) {
    JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    // labels for TIC visualizer
    Map<Feature, String> labelsMap = new HashMap<Feature, String>(0);
    // scan selection
    ScanSelection scanSelection = new ScanSelection(rawFiles[0].getDataRTRange(1), 1);
    // mz range
    Range<Double> mzRange = null;
    mzRange = feature.getRawDataPointsMZRange();
    // optimize output by extending the range
    double upper = mzRange.upperEndpoint();
    double lower = mzRange.lowerEndpoint();
    double fiveppm = (upper * 5E-6);
    mzRange = Range.closed(lower - fiveppm, upper + fiveppm);
    // labels
    labelsMap.put(feature, feature.toString());
    TICVisualizerWindow window = new // raw
    TICVisualizerWindow(// raw
    rawFiles, // plot type
    TICPlotType.BASEPEAK, // scan selection
    scanSelection, // mz range
    mzRange, // selected features
    row.getPeaks(), // labels
    labelsMap);
    pane.add(window.getTICPlot());
    pane.add(window.getToolBar());
    pane.setResizeWeight(1);
    pane.setDividerSize(1);
    pane.setBorder(BorderFactory.createLineBorder(Color.black));
    return pane;
}
Also used : ScanSelection(net.sf.mzmine.parameters.parametertypes.selectors.ScanSelection) TICVisualizerWindow(net.sf.mzmine.modules.visualization.tic.TICVisualizerWindow) HashMap(java.util.HashMap) JSplitPane(javax.swing.JSplitPane) Feature(net.sf.mzmine.datamodel.Feature)

Aggregations

HashMap (java.util.HashMap)2 JSplitPane (javax.swing.JSplitPane)2 Feature (net.sf.mzmine.datamodel.Feature)2 TICVisualizerWindow (net.sf.mzmine.modules.visualization.tic.TICVisualizerWindow)2 ScanSelection (net.sf.mzmine.parameters.parametertypes.selectors.ScanSelection)2 BasicStroke (java.awt.BasicStroke)1 BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 JPanel (javax.swing.JPanel)1 TICPlot (net.sf.mzmine.modules.visualization.tic.TICPlot)1 ValueMarker (org.jfree.chart.plot.ValueMarker)1 XYPlot (org.jfree.chart.plot.XYPlot)1