Make a gp object
gp.Rd
Make a gp object
Arguments
- rows
Numeric. The number of rows the plate should have.
- cols
Numeric. The number of columns the plate should have.
- data
An optional data.frame of well data the same dimensions as the plate to be described
- wells
Numeric. The number of wells the plate has. If this is specified, rows and cols must be null - they are inferred from common form factors of plates.
- tidy
Are the data supplied tidy?
Details
A gp
object has the following components:
nrow
/ncol
: Number of plate rows/cols. This is static and will not be changed by adding layers.well_data
: Somewhat transient data used to define plotting coordinates for layers. See below for more information.nrow_sec
/ncols_sec
: The number of rows/cols of the current section. When creating a plate, that number is the number of rows/cols of the plate (the plate is the section). Can take on a 'mar' suffix, which specifies the number including margins (if any)nrow_sec_par
/ncol_sec_par
: The number of rows/cols of the parent section. When creating a plate, it has no parent, so defaults to being its own parent. Can take on a 'mar' suffix. See above.
well_data
consists of many columns. The variable names can be broken down
as follows:
row
/col
:row
is always the y axis,col
is always the x axis. By convention, plates start at 1, 1 in the top left corner.sec
: Short for 'section'. A section is a rectangular field of wells.sec
alone refers to the number of the section itself.sec
combined withrow
orcol
(egrow_sec
) refers to the coordinates of a given well relative to it's section corners, with the top left corner of a given section always being (1, 1).par
: Short for 'parent'. These columns are all the data from the previous layer.index
: These specify (usually) multiwell strips only defined in one dimension. Together,index_row
andindex_col
form checkerboard-like patterns, where each intersection is a section. This is a bit more complicated whenwrap = TRUE
, so the simile does not hold for all cases.
Examples
# If you specify wells, rows and columns are derived
# from a standard plate sizes:
gp(wells = 96)
#>
#> 12
#> ________________________
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> 8 | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>
#>
#> Start corner: tl
#> Plate dimensions: 8 x 12
# As such, you cannot use the wells argument
# if you want to create more exotic plates:
try(gp(wells = 102))
#> Error in gp(wells = 102) :
#> wells is not of a known format (6, 12, 24, 48, 96, 384, 1536, or 3456)
# For that, you'll need to specify wells and cols:
gp(rows = 6, cols = 17)
#>
#> 17
#> __________________________________
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> 6 | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>
#>
#> Start corner: tl
#> Plate dimensions: 6 x 17