Pretty display of values for samples arranged in a 384-well plate (in R).
Entering edit mode
6.4 years ago
Charles Plessy ★ 2.8k

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

qPCR 384-well plate 96-well plate plot R • 4.2k views
Entering edit mode
6.4 years ago
dario.garvan ▴ 490

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.

Entering edit mode

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)


Entering edit mode
6.1 years ago
S.Warchal ▴ 30

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).

Entering edit mode

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


Login before adding your answer.

Traffic: 862 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6