Wells
A Well
represents the coordinates of a well in a plate
of a given format (by default, 384). Given these coordinates, the
functions Row()
and Column()
extract the row
and column coordinates as letters and numbers respectively. Note that
plate formats names are characters, not numbers.
well <- Well("C14")
well |> Row()
#> [1] "C"
Column(well)
#> [1] "14"
Column(Well("C04"))
#> [1] "04"
Because the well coordinates come with a plate format, it is possible to determine where is the “next” well.
Plates
A plate object represents a physical mutliwell plate that may be filled with liquids. In addition to its format, it has a dead volume property that is used to calculate when it is not possible anymore to draw liquid from a well, and a maximal volume property that is used to to calculate when it is not possible anymore to add liquid to a well. These properties can be left unspecified when the plate representation is for theoretical purposes only. All volumes are expressed in nanoliters.
(plate <- Plate("96", deadVolume = 1e4, maxVolume = 1e5))
#> A Plate with data about 96 wells (dead volume: 10000; max volume: 1e+05).
Plate("384")
#> A Plate with data about 384 wells (dead volume: unspecified; max volume: unspecified).
The function PlateTypeToWellNames
enumerates the names
of the wells of a plate.
PlateTypeToWellNames("96") |> head(13)
#> [1] "A01" "A02" "A03" "A04" "A05" "A06" "A07" "A08" "A09" "A10" "A11" "A12"
#> [13] "B01"
A filter function, setWell
, is provided to add contents
to a plate.
The contents of a plate can be extracted by converting Plate
objects to their base class, DataFrame. The head()
function does this automagically.
plate |> DataFrame() |> head()
#> DataFrame with 6 rows and 2 columns
#> dNTP DMSO
#> <numeric> <numeric>
#> A01 1e+05 NA
#> A02 NA 1e+05
#> A03 NA NA
#> A04 NA NA
#> A05 NA NA
#> A06 NA NA
head(plate)
#> DataFrame with 6 rows and 2 columns
#> dNTP DMSO
#> <numeric> <numeric>
#> A01 1e+05 NA
#> A02 NA 1e+05
#> A03 NA NA
#> A04 NA NA
#> A05 NA NA
#> A06 NA NA
Note that setting again the same reagent overrides the volume, and that setting another reagent does not reset the previous one.
plate |> setWell(Well("A01"), "dNTP", 1e4) |> head(3)
#> DataFrame with 3 rows and 2 columns
#> dNTP DMSO
#> <numeric> <numeric>
#> A01 10000 NA
#> A02 NA 1e+05
#> A03 NA NA
plate |> setWell(Well("A01"), "DMSO", 1e4) |> head(3)
#> DataFrame with 3 rows and 2 columns
#> dNTP DMSO
#> <numeric> <numeric>
#> A01 1e+05 1e+04
#> A02 NA 1e+05
#> A03 NA NA
The sourceReagent
function reports what reagents are
found in the whole plate or one of its wells.
sourceReagent(plate)
#> [1] "dNTP" "DMSO"
sourceReagent(plate, Well("A02"))
#> [1] "DMSO"
Conversely, plateWellVolume
reports the volume of a well
or of one of its reagents.
plate <- plate |>
setWell(Well("A03"), "DMSO", 1e4) |>
setWell(Well("A03"), "H2O", 1e4)
plateWellVolume(plate, Well("A03"))
#> [1] 20000
plateWellVolume(plate, Well("A03"), "DMSO")
#> [1] 10000
Finally, starting from A01
or an arbitrary location, it
is possible to find where is the next well containing a given
reagent.
seekReagent(plate, "H2O")
#> A03 (96-well format)