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);
}
}
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;
}
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);
}
Aggregations