Description Usage Arguments Details Examples
Generic plot method for rMSIproc peak matrix.
1 2 |
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. |
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:
mz: produce an ion map using the 'values' argument as the target m/z channel to display (this is the default behaviour).
values: produce an image using the values given in the 'values' argument as pixel intensities. This method is useful to display the results of user's calculation directly over the image.
clusters: the 'values' argument contains a vector of integers indicating at which cluster belong each pixel in the image. This method produce an image automatically coloured according the clusters vector. The colours codes are returned to be reused in further graphics.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.