Question: Pretty display of values for samples arranged in a 384-well plate (in R).
gravatar for Charles Plessy
4.2 years ago by
Charles Plessy2.7k
Charles Plessy2.7k wrote:

There are many experiments where samples are stored in 384-well plates (or 96-well plates etc.) and a measurement is made on each sample. Typical technical biases may affect spatial regions of the plate, for instance the borders (evaporation, ...), or large bands when the thermocycling (in PCR) is preformed by separate independent controllers, etc. In some more complicated experiments, each well may contain a NGS library, for which multiple quality control scores can be computed.

I searched for R functions for pretty printing of values arranged in the geometry of a multiwell plate and I was surprised that I did not find anything obvious. Perhaps because the solution is too trivial ? Still, I would be happy to use a well-thought packaged function instead of a quick-and-dirty ad-hoc home-made wheel reinvention.

Here is an example below. The problems with this script are that 1) it requires flipping some levels that should stay as they are otherwise and 2) SVG or PDF version had a very ugly appearance as each square was strongly smoothed...

My question is whether there are good packaged tools (in R) to do such plots and more operations on representations of multiwell plates.

plate <- data.frame( Row = rep(LETTERS[1:16], 24)
                   , Col = unlist(lapply(1:24, rep, 16)))

plate$Row <-  factor(plate$Row, levels=rev(levels(plate$Row)))

plate[001:096, "val"] <- rpois(96,10)
plate[097:384, "val"] <- rpois(96, 6)

png("plate.png", h=400,w=600)
  ggplot2::ggplot(plate, ggplot2::aes(Col, Row, fill=val)) + ggplot2::geom_raster()

384-well plate with random values

ADD COMMENTlink modified 3.9 years ago by S.Warchal30 • written 4.2 years ago by Charles Plessy2.7k
gravatar for dario.garvan
4.2 years ago by
dario.garvan460 wrote:

HTqPCR has a function named plotCtArray and another named plotCtCard. They are not so stylish, but you can avoid having to create a new function.

ADD COMMENTlink written 4.2 years ago by dario.garvan460

To complete this answer, a script could be

# plate needs to be sorted as follows: A1, A2, ..., P23, P24
plate$position <- paste0(plate$Row, plate$Col)
plate$position <- sub("^(.)(.)$", "\\10\\2", plate$position, perl=T)
plate <- plate[order(plate$position),]

mat <- matrix(plate$val, nrow = nrow(plate))
raw <- new("qPCRset", exprs = mat, featureCategory ="OK", nrow(plate))))
sampleNames(raw) <- "sampleName"
featureNames(raw) <- paste0("feature", 1:nrow(plate))

png("plate.png", h=400,w=600)
HTqPCR::plotCtCard(raw, col.range = c(0, 16), well.size = 2.6)


ADD REPLYlink modified 4.1 years ago • written 4.1 years ago by Simon Besson-Girard10
gravatar for S.Warchal
3.9 years ago by
S.Warchal30 wrote:

I made an R package for plotting platemaps with a few utility functions. Mainly just a wrapper round some ggplot2 code, with a few functions for converting between formats (matrix <-> Well_ID+value).

ADD COMMENTlink written 3.9 years ago by S.Warchal30

Thanks, I started to use it ! Here the same data as above, but plotted with platetools.

384-well plate with random values, plotted with platetools

ADD REPLYlink written 3.8 years ago by Charles Plessy2.7k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2045 users visited in the last hour