Plot plate layouts
a tibble
(or data.frame
) with the samples assigned to locations.
Alternatively a BatchContainter with samples can be supplied here.
optional dimension variable used for the plate ids
the dimension variable used for the row ids
the dimension variable used for the column ids
the continuous or discrete variable to color by
a continuous variable encoding transparency
a discrete variable encoding tile pattern (needs ggpattern)
string for the plot title
flag to add excluded wells (in bc$exclude) to the plot. A BatchContainer must be provided for this.
whether NA entries in sample table should be renamed to 'empty`.
the ggplot object
nPlate <- 3
nColumn <- 4
nRow <- 6
treatments <- c("CTRL", "TRT1", "TRT2")
timepoints <- c(1, 2, 3)
bc <- BatchContainer$new(
dimensions = list(
plate = nPlate,
column = list(values = letters[1:nColumn]),
row = nRow
)
)
sample_sheet <- tibble::tibble(
sampleID = 1:(nPlate * nColumn * nRow),
Treatment = rep(treatments, each = floor(nPlate * nColumn * nRow) / length(treatments)),
Timepoint = rep(timepoints, floor(nPlate * nColumn * nRow) / length(treatments))
)
# assign samples from the sample sheet
bc <- assign_random(bc, samples = sample_sheet)
plot_plate(bc$get_samples(),
plate = plate, column = column, row = row,
.color = Treatment, .alpha = Timepoint
)
# \donttest{
plot_plate(bc$get_samples(),
plate = plate, column = column, row = row,
.color = Treatment, .pattern = Timepoint
)
# }