This class helps creating the Plate object. It is used to store the data and validate the final fields.
layout_as_vectorPrint 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_namesvector of sample names measured during an examination in the same order as in the data. It should not contain any duplicates.
analyte_namesvector of analytes names measured during an examination in the same order as in the data
batch_namename of the batch during which the plate was examined
obtained from the plate info. An optional parameter, by default set to
"" - an empty string.
verboselogical 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_locationsvector 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_dilutionslogical 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
valuesa 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_typeslogical value indicating whether to use names extracted from layout files to extract sample types
valuesa 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
In case there are multiple samples with the same name, it prints a warning and renames the samples, by adding a number.
PlateBuilder$set_sample_names(use_layout_sample_names = TRUE)use_layout_sample_nameslogical 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_datetimea POSIXct datetime object representing the date and time of the examination
set_data()Set the data used during the examination
PlateBuilder$set_data(data)dataa 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_typea 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_infoa 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_patha 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_matrixa matrix containing information about the sample names. dilutions, etc.
build()Create a Plate object from the PlateBuilder object
PlateBuilder$build(validate = TRUE, reorder = TRUE)validatelogical value indicating whether to validate the fields
reorderlogical 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)deepWhether to make a deep clone.