A class to represent the luminex plate. It contains information about the samples and analytes that were examined on the plate as well as some additional metadata and batch info
plate_name
(character(1)
)
Name of the plate. Set to the name of the file from which the plate was read.
analyte_names
(character()
)
Names of the analytes that were examined on the plate.
sample_names
(character()
)
Names of the samples that were examined on the plate. The order of the
samples in this vector is identical with order in the CSV source file.
batch_name
(character(1)
)
Name of the batch to which the plate belongs.
plate_datetime
(POSIXct()
)
A date and time when the plate was created by the machine
sample_locations
(character()
)
Locations of the samples on the plate. This vector is in the same order
as the sample_names
vector.
sample_types
(character()
)
Types of the samples that were examined on the plate.
The possible values are
c(ALL, BLANK, TEST, NEGATIVE CONTROL, STANDARD CURVE, POSITIVE CONTROL)
.
This vector is in the same order as the sample_names
vector.
dilutions
(character()
)
A list containing names of the samples as keys and string representing dilutions as values.
The dilutions are represented as strings. This vector is in the same order as the sample_names
vector.
dilution_values
(numeric()
)
A list containing names of the samples as keys and numeric values representing dilutions as values.
It is in the same order as the sample_names
vector.
default_data_type
(character(1)
)
The default data type that will be returned by the get_data
method.
By default is set to Median
.
data
(list()
)
A list containing dataframes with the data for each sample and analyte.
The possible data types - the keys of the list are:
c(Median, Net MFI, Count, Avg Net MFI, Mean, Peak)
.
In each dataframe, the rows represent samples and the columns represent analytes.
batch_info
(list()
)
A list containing additional, technical information about the batch.
layout
(character()
)
A list containing information about the layout of the plate.
The layout is read from the separate file and usually provides additional
information about the dilutions, sample names, and the sample layout
on the actual plate.
blank_adjusted
(logical
)
A flag indicating whether the blank values have been adjusted.
new()
Method to initialize the Plate object
Plate$new(
plate_name,
sample_names,
analyte_names,
batch_name = "",
plate_datetime = NULL,
sample_locations = NULL,
sample_types = NULL,
dilutions = NULL,
dilution_values = NULL,
default_data_type = NULL,
data = NULL,
batch_info = NULL,
layout = NULL
)
plate_name
(character(1)
)
Name of the plate.
By default is set to an empty string,
during the reading process it is set to the name
of the file from which the plate was read.
sample_names
(character()
)
Names of the samples that were examined on the plate.
analyte_names
(character()
)
Names of the analytes that were examined on the plate.
batch_name
(character(1)
)
Name of the batch to which the plate belongs.
By default is set to an empty string, during the reading process it is set to
the batch
field of the plate
plate_datetime
(POSIXct()
)
Datetime object representing the date and time when the plate was created by the machine.
sample_locations
(character()
)
Locations of the samples on the plate.
sample_types
(character()
)
Types of the samples that were examined on the plate.
The possible values are
c(ALL, BLANK, TEST, NEGATIVE CONTROL, STANDARD CURVE, POSITIVE CONTROL)
.
dilutions
(character()
)
A list containing names of the samples as keys and string representing dilutions as values.
The dilutions are represented as strings.
dilution_values
(numeric()
)
A list containing names of the samples as keys and numeric values representing dilutions as values.
default_data_type
(character(1)
)
The default data type that will be returned by the get_data
method.
By default is set to Median
.
data
(list()
)
A list containing dataframes with the data for each sample and analyte.
The possible data types - the keys of the list are
c(Median, Net MFI, Count, Avg Net MFI, Mean, Peak)
.
In each dataframe, the rows represent samples and the columns represent analytes.
batch_info
(list()
)
A list containing additional, technical information about the batch.
layout
(character()
)
A list containing information about the layout of the plate.
The layout is read from the separate file and usually provides additional
information about the dilutions, sample names, and the sample layout
on the actual plate.
print()
Function prints the basic information about the plate such as the number of samples and analytes
Plate$print(...)
...
Additional parameters to be passed to the print function Print the summary of the plate
summary()
Function outputs basic information about the plate, such as examination date, batch name, and sample types.
Plate$summary(..., include_names = FALSE)
...
Additional parameters to be passed to the print function Get data for a specific analyte and sample type
include_names
If include_names
parameter is TRUE
, a
part from count of control samples, provides also their names.
By default FALSE
get_data()
Function returns data for a specific analyte and sample.
Plate$get_data(
analyte,
sample_type = "ALL",
data_type = self$default_data_type
)
analyte
An analyte name or its id of which data we want to extract. If set to 'ALL' returns data for all analytes.
sample_type
is a type of the sample we want to extract data from.
The possible values are
c(ALL, BLANK, TEST, NEGATIVE CONTROL, STANDARD CURVE, POSITIVE CONTROL)
. Default value is ALL
.
data_type
The parameter specifying which data type should be returned.
This parameter has to take one of values:
c(Median, Net MFI, Count, Avg Net MFI, Mean, Peak)
.
What's more, the data_type
has to be present in the plate's data
Default value is plate's default_data_type
, which is usually Median
.
Dataframe containing information about a given sample type and analyte Get the string representation of dilutions
get_dilution()
Function returns the dilution represented as strings for a specific sample type.
Plate$get_dilution(sample_type)
sample_type
type of the samples that we want to obtain the dilution for.
The possible values are
c(ALL, BLANK, TEST, NEGATIVE CONTROL, STANDARD CURVE, POSITIVE CONTROL)
Default value is ALL
.
A list containing names of the samples as keys and string representing dilutions as values. Get the numeric representation of dilutions
get_dilution_values()
Function returns the dilution values for a specific sample type.
Plate$get_dilution_values(sample_type)
sample_type
type of the samples that we want to obtain the dilution values for.
The possible values are
c(ALL, BLANK, TEST, NEGATIVE CONTROL, STANDARD CURVE, POSITIVE CONTROL)
Default value is ALL
.
A list containing names of the samples as keys and numeric values representing dilutions as values.
Adjust the MFI values by subtracting the background
blank_adjustment()
Function adjusts the values of samples (all samples excluding the blanks) by clamping the
values to the aggregated value of the BLANK
samples for each analyte separately.
The purpose of this operation is to unify the data by clamping values below the background noise. how this method works was inspired by the paper https://doi.org/10.1038/s41598-020-57876-0 which covers the quality control in the MBA.
In short, this operation firstly calculates the aggregate of MFI in the BLANK
samples
(available methods are: min
, max
, mean
, median
)
and then replaces all values below this threshold with the threshold value.
Method does not modifies the data of type Count
.
This operation is recommended to be performed before any further analysis, but is optional. Skipping it before further analysis is allowed, but will result in a warning.
Plate$blank_adjustment(threshold = "max", in_place = TRUE)
threshold
The method used to calculate the background value for each analyte.
Every value below this threshold will be clamped to the threshold value.
By default max
. Available methods are: min
, max
, mean
, median
.
in_place
Whether the method should produce new plate with adjusted
values or not, By default TRUE
- operates on the current plate.
clone()
The objects of this class are cloneable with this method.
Plate$clone(deep = FALSE)
deep
Whether to make a deep clone.