plot.rMSIprocPeakMatrix: Generic plot method for rMSIproc peak matrix.

Description Usage Arguments Details Examples

View source: R/api.R

Description

Generic plot method for rMSIproc peak matrix.

Usage

1
2
## S3 method for class 'rMSIprocPeakMatrix'
plot(x, values, method = "mz", use_ggplot = FALSE)

Arguments

x

rMSIproc peak matrix object.

values

the values used by the plot. The behaviour of this parameter is controlled by the 'method' argument.

method

a method used by the plot. Available options are: "mz", "values" and "clusters".

use_ggplot

a boolean specifing if a ggplot2 backed must be used for plotting.

Details

This generic plot method allows to create different graphics from an rMSIproc peak matrix. The plot type is controlled by the 'method' argument with the following option:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#For the following example we will load an rMSIproc peak matrix in the pks variable:
pks <- rMSIproc::LoadPeakMatrix("/path/to/my/peak/matrix.zip")

#Plot the m/z 848.7 distribution:
plot(pks, 848.7)

#Plot the TIC value of each pixel using the 'values' method:
plot(pks, values = pks$normalizations$TIC, method = "values")

#Cluster the peak matrix using kmeans and display each cluster on the image:
clus <- kmeans(pks$intensity/pks$normalizations$TIC, centers = 5)
plot(pks, clus$cluster, method = "clusters")

prafols/rMSIproc documentation built on Dec. 12, 2021, 7:31 p.m.