PlotSpectra {MSclassifR} | R Documentation |
Plot mass spectra with detected peaks
Description
This function performs a plot of a AbstractMassObject
object (see the MALDIquant
R package). It can be used to highlight peaks in a mass spectrum.
Usage
PlotSpectra(SpectralData, absx="ALL", Peaks=NULL, Peaks2=NULL, col_spec=1,
col_peak=2, shape_peak=3, col_peak2=2, shape_peak2=2)
Arguments
SpectralData |
|
absx |
|
Peaks |
|
Peaks2 |
numeric |
col_spec |
color of the mass spectrum. |
col_peak |
color of the peak points corresponding to |
shape_peak |
shape of the peak points corresponding to |
col_peak2 |
color of the peak points corresponding to |
shape_peak2 |
Shape of the peak points corresponding to |
Value
A ggplot
object (see ggplot2
R package). Mass-over-charge values are in x-axis and intensities in y-axis.
Examples
library("MSclassifR")
# Load mass spectra
data("CitrobacterRKIspectra", package = "MSclassifR")
# Plot raw mass spectrum
PlotSpectra(SpectralData = CitrobacterRKIspectra[[1]])
# standard pre-processing of mass spectra
spectra <- SignalProcessing(CitrobacterRKIspectra)
# Plot pre-processed mass spectrum
PlotSpectra(SpectralData=spectra[[1]])
# detection of peaks in pre-processed mass spectra
peaks <- PeakDetection(x = spectra, averageMassSpec=FALSE)
# Plot peaks on pre-processed mass spectrum
PlotSpectra(SpectralData=spectra[[1]],Peaks=peaks[[1]],col_spec="blue",col_peak="black")