plotPlate(x,nrow = 8, ncol = 12, col=c("red", "blue"),
ind = 1:(ncol*nrow), xrange=function(y) range(y, na.rm=TRUE), na.action = "zero",
main, char, desc = character(2), add=FALSE, gridFun="default",
funArgs=NULL,...)ncol*nrow or matrix with
ncol*nrow rows (except if argument ind is specified).
If of class matrix, the use of argument gridFun is expected.colorRampPalette.x. It
indicates the position of the respective value of
x on the plate. Can be used to adress the problem of missing
values. Each well that is not allocated a value of x by
ind will not be plotted.x that is mapped into the color scale. Alternatively, this
can be a function which takes the values of x as input and
creates such a vector."zero" "omit" or
"xout".
How should the wells for which x is NA be treated?
For "zero", they are plotted as if the value were 0.
For "omit", they are omitted.
For "xout", they are crossed out.
When x is a matrix, na.action is only applied to rows
containing nothing but NAs. Further special treatment of NA
values in matrices need to be implemented in gridFun.x
(except if argument ind is specified) to be used for well
annotation. Each element of the
vector may contain a string to be superimposed on
the respective well or NA for no plotting.TRUE add plate plot to current plot. May
be used when plotting in grid layout panels..drawCircle
and .drawPie
which is a vector with
the indices of those elements in x that were plotted (see argument
na.action). The element coord is a length(which) by 4
matrix in which each row specifies the corners of a rectangle that contains a
well. It is intended to be used as an argument to a subsequent call to
imageMap. Elements width and
height may be used to open a graphic devices that can hold the plate
plot with the correct aspect ratio.data as first argument. plotPlate passes all data
values for the respective well to the plotting function. Any further
arguments may be passed on using argument funArgs. See
.drawCircle and .drawPie for examples of valid plotting
functions and the vignette for detailed information. Note that
using funCall overrides some of the default functionalities,
e.g. plotting of legends and alters the treatment of NA values.Argument ind allows the user to indicate the position (well
number) for each element of vector x on the plate. This can be
used either to change the order in which elements of x are to be
plotted or to deal with the problem of missing data for some of the
wells on a plate.
To further increase the amount of information of the platePlot one may
decorate wells with short annotations using argument char. Each
element of char != NA will be superimposed on the respective
well (see examples).
imageMapplotPlate(runif(96), main="example 1", col=c("#0000e0", "#e00000"), desc=c("act", "inh"))
plotPlate(runif(384), nrow=16, ncol=24, main="example 2", col=c("#0000e0", "white", "#e00000"))
plotPlate(runif(48), main="example 3", col=c("#0000e0", "#e00000"), ind=c(1:24, 73:96))
x <- runif(96)
x[sample(96, 10)] <- NA
plotPlate(x, main="example 4", col=c("#0000e0", "#e00000"),
char=c(rep(NA, 72), LETTERS[1:24]), na.action="xout")
plotPlate(runif(96, min=0.1, max=0.5), gridFun=".drawCircle")
plotPlate(matrix(runif(288), ncol=3), gridFun=".drawPie",
funArgs=as.data.frame(matrix(2:4, ncol=3, nrow=96, byrow=TRUE)))
Run the code above in your browser using DataLab