PlateBuilder | R Documentation |
This class helps creating the Plate object. It is used to store the data and validate the final fields.
layout_as_vector
Print the layout associated with the plate as a flattened vector of values.
new()
Initialize the PlateBuilder object
PlateBuilder$new(sample_names, analyte_names, batch_name = "", verbose = TRUE)
sample_names
vector of sample names measured during an examination in the same order as in the data
analyte_names
vector of analytes names measured during an examination in the same order as in the data
batch_name
name of the batch during which the plate was examined
obtained from the plate info. An optional parameter, by default set to
""
- an empty string.
verbose
logical value indicating whether to print additional information. This parameter is stored as a private attribute of the object and reused in other methods
set_sample_locations()
Set the sample types used during the examination
PlateBuilder$set_sample_locations(sample_locations)
sample_locations
vector of sample locations pretty name ie. A1, B2
set_dilutions()
Extract and set the dilutions from layout, sample names or use a provided vector of values. The provided vector should be the same length as the number of samples and should contain dilution factors saved as strings
PlateBuilder$set_dilutions(use_layout_dilutions = TRUE, values = NULL)
use_layout_dilutions
logical value indicating whether to use names
extracted from layout files to extract dilutions. If set to FALSE
the
function uses the sample names as a source for dilution
values
a vector of dilutions to overwrite the extraction process
Set and extract sample types from the sample names. Optionally use the layout file to extract the sample types
set_sample_types()
PlateBuilder$set_sample_types(use_layout_types = TRUE, values = NULL)
use_layout_types
logical value indicating whether to use names extracted from layout files to extract sample types
values
a vector of sample types to overwrite the extraction process
set_sample_names()
Set the sample names used during the examination. If the layout is provided, extract the sample names from the layout file. Otherwise, uses the original sample names from the Luminex file
PlateBuilder$set_sample_names(use_layout_sample_names = TRUE)
use_layout_sample_names
logical value indicating whether to use names extracted from layout files. If set to false, this function only checks if the sample names are provided in the plate
set_plate_datetime()
Set the plate datetime for the plate
PlateBuilder$set_plate_datetime(plate_datetime)
plate_datetime
a POSIXct datetime object representing the date and time of the examination
set_data()
Set the data used during the examination
PlateBuilder$set_data(data)
data
a named list of data frames containing information about
the samples and analytes. The list is named by the type of the data
e.g. Median
, Net MFI
, etc.
The data frames contain information about the samples and analytes
The rows are different measures, whereas the columns represent
different analytes
Example of how data$Median
looks like:
Sample | Analyte1 | Analyte2 | Analyte3 |
Sample1 | 1.2 | 2.3 | 3.4 |
Sample2 | 4.5 | 5.6 | 6.7 |
... | ... | ... | ... |
Sample96 | 7.8 | 8.9 | 9.0 |
set_default_data_type()
Set the data type used for calculations
PlateBuilder$set_default_data_type(data_type = "Median")
data_type
a character value representing the type of data that is currently used for calculations. By default, it is set to Median
set_batch_info()
Set the batch info for the plate
PlateBuilder$set_batch_info(batch_info)
batch_info
a raw list containing metadata about the plate read from the Luminex file
set_plate_name()
Set the plate name for the plate. The plate name is extracted from the filepath
PlateBuilder$set_plate_name(file_path)
file_path
a character value representing the path to the file
set_layout()
Set the layout matrix for the plate. This function performs basic validation
verifies if the plate is a matrix of shape 8x12 with 96 wells
PlateBuilder$set_layout(layout_matrix)
layout_matrix
a matrix containing information about the sample names. dilutions, etc.
build()
Create a Plate object from the PlateBuilder object
PlateBuilder$build(validate = TRUE, reorder = TRUE)
validate
logical value indicating whether to validate the fields
reorder
logical value indicating whether to reorder the data according to the locations on the plate.
If FALSE
, the samples will be ordered in the same manner as in the CSV plate file.
clone()
The objects of this class are cloneable with this method.
PlateBuilder$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.