plot2D | R Documentation |
Generate 2 or 3 dimensional feature distribution plots to
illustrate localistation clusters. Rows/features containing
NA
values are removed prior to dimension reduction except
for the "nipals"
method. For this method, it is advised to
set the method argument 'ncomp' to a low number of dimensions to
avoid computing all components when analysing large datasets.
plot2D(
object,
fcol = "markers",
fpch,
unknown = "unknown",
dims = 1:2,
score = 1,
method = "PCA",
methargs,
axsSwitch = FALSE,
mirrorX = FALSE,
mirrorY = FALSE,
col,
pch,
cex,
index = FALSE,
idx.cex = 0.75,
addLegend,
identify = FALSE,
plot = TRUE,
grid = TRUE,
...
)
## S4 method for signature 'MSnSet'
plot3D(
object,
fcol = "markers",
dims = c(1, 2, 3),
radius1 = 0.1,
radius2 = radius1 * 2,
plot = TRUE,
...
)
object |
An instance of class |
fcol |
Feature meta-data label (fData column name) defining
the groups to be differentiated using different
colours. Default is |
fpch |
Featre meta-data label (fData column name) desining the groups to be differentiated using different point symbols. |
unknown |
A |
dims |
A |
score |
A numeric specifying the minimum organelle assignment score to consider features to be assigned an organelle. (not yet implemented). |
method |
A
If none is used, the data is plotted as is, i.e. without any
transformation. In this case, Available methods are listed in |
methargs |
A |
axsSwitch |
A |
mirrorX |
A |
mirrorY |
A |
col |
A |
pch |
A |
cex |
Character expansion. |
index |
A |
idx.cex |
A |
addLegend |
A character indicating where to add the
legend. See |
identify |
A logical (default is |
plot |
A |
grid |
A |
... |
Additional parameters passed to |
radius1 |
A |
radius2 |
A |
plot3D
relies on the ##' rgl
package, that will be
loaded automatically.
Note that plot2D
has been update in version 1.3.6 to
support more organelle classes than colours defined in
getStockcol
. In such cases, the default
colours are recycled using the default plotting characters
defined in getStockpch
. See the example for
an illustration. The alpha
argument is also
depreciated in version 1.3.6. Use setStockcol
to set
colours with transparency instead. See example below.
Version 1.11.3: to plot data as is, i.e. without any
transformation, method
can be set to "none" (as
opposed to passing pre-computed values to method
as a
matrix
, in previous versions). If object
is an
MSnSet
, the untransformed values in the assay data
will be plotted. If object
is a matrix
with
coordinates, then a matching MSnSet
must be passed to
methargs
.
Used for its side effects of generating a plot. Invisibly returns the 2 or 3 dimensions that are plotted.
Laurent Gatto <lg390@cam.ac.uk>
addLegend
to add a legend to plot2D
figures (the legend is added by default on plot3D
) and
plotDist
for alternative graphical
representation of quantitative organelle proteomics
data. plot2Ds
to overlay 2 data sets on the same
PCA plot. The plotEllipse
function can be used
to visualise TAGM models on PCA plots with ellipses.
library("pRolocdata")
data(dunkley2006)
plot2D(dunkley2006, fcol = NULL)
plot2D(dunkley2006, fcol = NULL, col = "black")
plot2D(dunkley2006, fcol = "markers")
addLegend(dunkley2006,
fcol = "markers",
where = "topright",
cex = 0.5, bty = "n", ncol = 3)
title(main = "plot2D example")
## available methods
plot2Dmethods
plot2D(dunkley2006, fcol = NULL, method = "kpca", col = "black")
plot2D(dunkley2006, fcol = NULL, method = "kpca", col = "black",
methargs = list(kpar = list(sigma = 1)))
plot2D(dunkley2006, method = "lda")
plot2D(dunkley2006, method = "hexbin")
## Using transparent colours
setStockcol(paste0(getStockcol(), "80"))
plot2D(dunkley2006, fcol = "markers")
## New behavious in 1.3.6 when not enough colours
setStockcol(c("blue", "red", "green"))
getStockcol() ## only 3 colours to be recycled
getMarkers(dunkley2006)
plot2D(dunkley2006)
## reset colours
setStockcol(NULL)
plot2D(dunkley2006, method = "none") ## plotting along 2 first fractions
plot2D(dunkley2006, dims = c(3, 5), method = "none") ## plotting along fractions 3 and 5
## pre-calculate PC1 and PC2 coordinates
pca <- plot2D(dunkley2006, plot=FALSE)
head(pca)
plot2D(pca, method = "none", methargs = list(dunkley2006))
## plotting in 3 dimenstions
plot3D(dunkley2006)
plot3D(dunkley2006, radius2 = 0.3)
plot3D(dunkley2006, dims = c(2, 4, 6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.