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

Public fields

plate_name

(character(1))
Name of the plate.

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.

batch_name

(character(1))
Name of the batch to which the plate belongs.

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.

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.

default_data_type

(character(1))
The default data type that will be returned by the get_data method. By default is set to Median.

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.

Methods


Method new()

Method to initialize the Plate object

Usage

Plate$new(
  plate_name,
  sample_names,
  analyte_names,
  batch_name = "",
  dilutions = NULL,
  dilution_values = NULL,
  sample_types = NULL,
  data = NULL,
  sample_locations = NULL,
  default_data_type = NULL,
  batch_info = NULL,
  layout = NULL
)

Arguments

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

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.

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).

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.

sample_locations

(character())
Locations of the samples on the plate.

default_data_type

(character(1))
The default data type that will be returned by the get_data method. By default is set to Median.

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.


Method print()

Function prints the basic information about the plate such as the number of samples and analytes

Usage

Plate$print(...)

Arguments

...

Additional parameters to be passed to the print function Print the summary of the plate


Method summary()

Function outputs basic information about the plate, such as examination date, batch name, and sample types.

Usage

Plate$summary(..., include_names = FALSE)

Arguments

...

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


Method get_data()

Function returns data for a specific analyte and sample.

Usage

Plate$get_data(
  analyte,
  sample_type = "ALL",
  data_type = self$default_data_type
)

Arguments

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.

Returns

Dataframe containing information about a given sample type and analyte Get the string representation of dilutions


Method get_dilution()

Function returns the dilution represented as strings for a specific sample type.

Usage

Plate$get_dilution(sample_type)

Arguments

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.

Returns

A list containing names of the samples as keys and string representing dilutions as values. Get the numeric representation of dilutions


Method get_dilution_values()

Function returns the dilution values for a specific sample type.

Usage

Plate$get_dilution_values(sample_type)

Arguments

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.

Returns

A list containing names of the samples as keys and numeric values representing dilutions as values.

Adjust the MFI values by subtracting the background


Method 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.

Usage

Plate$blank_adjustment(threshold = "max", in_place = TRUE)

Arguments

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.

inplace

Whether the method should produce new plate with adjusted values or not, By default TRUE - operates on the current plate.


Method clone()

The objects of this class are cloneable with this method.

Usage

Plate$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.