Search in sources :

Example 1 with PeakListDataSet

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet in project mzmine2 by mzmine.

the class SpectraPlot method switchPickedPeaksVisible.

void switchPickedPeaksVisible() {
    peaksVisible = !peaksVisible;
    for (int i = 0; i < plot.getDatasetCount(); i++) {
        XYDataset dataSet = plot.getDataset(i);
        if (!(dataSet instanceof PeakListDataSet))
            continue;
        XYItemRenderer renderer = plot.getRenderer(i);
        renderer.setDefaultSeriesVisible(peaksVisible);
    }
}
Also used : PeakListDataSet(net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet) XYDataset(org.jfree.data.xy.XYDataset) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer)

Example 2 with PeakListDataSet

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet in project mzmine2 by mzmine.

the class SpectraToolTipGenerator method generateToolTip.

/**
 * @see org.jfree.chart.labels.XYToolTipGenerator#generateToolTip(org.jfree.data.xy.XYDataset,
 *      int, int)
 */
public String generateToolTip(XYDataset dataset, int series, int item) {
    double intValue = dataset.getYValue(series, item);
    double mzValue = dataset.getXValue(series, item);
    if (dataset instanceof PeakListDataSet) {
        PeakListDataSet peakListDataSet = (PeakListDataSet) dataset;
        Feature peak = peakListDataSet.getPeak(series, item);
        PeakList peakList = peakListDataSet.getPeakList();
        PeakListRow row = peakList.getPeakRow(peak);
        String tooltip = "Peak: " + peak + "\nStatus: " + peak.getFeatureStatus() + "\nFeature list row: " + row + "\nData point m/z: " + mzFormat.format(mzValue) + "\nData point intensity: " + intensityFormat.format(intValue);
        return tooltip;
    }
    if (dataset instanceof IsotopesDataSet) {
        IsotopesDataSet isotopeDataSet = (IsotopesDataSet) dataset;
        IsotopePattern pattern = isotopeDataSet.getIsotopePattern();
        double relativeIntensity = intValue / pattern.getHighestDataPoint().getIntensity() * 100;
        String tooltip = "Isotope pattern: " + pattern.getDescription() + "\nStatus: " + pattern.getStatus() + "\nData point m/z: " + mzFormat.format(mzValue) + "\nData point intensity: " + intensityFormat.format(intValue) + "\nRelative intensity: " + percentFormat.format(relativeIntensity) + "%";
        return tooltip;
    }
    if (dataset instanceof ExtendedIsotopePatternDataSet) {
        return "Isotope pattern: " + ((ExtendedIsotopePatternDataSet) dataset).getIsotopePattern().getDescription() + "\nm/z: " + mzFormat.format(mzValue) + "\nIdentity: " + ((ExtendedIsotopePatternDataSet) dataset).getItemDescription(series, item) + "\nRelative intensity: " + percentFormat.format((dataset.getY(series, item).doubleValue() * 100)) + "%";
    }
    String tooltip = "m/z: " + mzFormat.format(mzValue) + "\nIntensity: " + intensityFormat.format(intValue);
    return tooltip;
}
Also used : ExtendedIsotopePatternDataSet(net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.ExtendedIsotopePatternDataSet) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) PeakListDataSet(net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet) IsotopePattern(net.sf.mzmine.datamodel.IsotopePattern) IsotopesDataSet(net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.IsotopesDataSet) PeakList(net.sf.mzmine.datamodel.PeakList) Feature(net.sf.mzmine.datamodel.Feature)

Example 3 with PeakListDataSet

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet in project mzmine2 by mzmine.

the class SpectraVisualizerWindow method loadPeaks.

public void loadPeaks(PeakList selectedPeakList) {
    spectrumPlot.removePeakListDataSets();
    if (selectedPeakList == null) {
        return;
    }
    logger.finest("Loading a feature list " + selectedPeakList + " to a spectrum window " + getTitle());
    PeakListDataSet peaksDataSet = new PeakListDataSet(dataFile, currentScan.getScanNumber(), selectedPeakList);
    // Set plot data sets
    spectrumPlot.addDataSet(peaksDataSet, peaksColor, true);
}
Also used : PeakListDataSet(net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet)

Aggregations

PeakListDataSet (net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.PeakListDataSet)3 Feature (net.sf.mzmine.datamodel.Feature)1 IsotopePattern (net.sf.mzmine.datamodel.IsotopePattern)1 PeakList (net.sf.mzmine.datamodel.PeakList)1 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)1 ExtendedIsotopePatternDataSet (net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.ExtendedIsotopePatternDataSet)1 IsotopesDataSet (net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.IsotopesDataSet)1 XYItemRenderer (org.jfree.chart.renderer.xy.XYItemRenderer)1 XYDataset (org.jfree.data.xy.XYDataset)1