Depending on the normalisation_type
argument, the function will compute the RAU or nMFI values for each analyte in the plate.
RAU is the default normalisation type.
The behaviour of the function, in the case of RAU normalisation type, can be summarised as follows:
Adjust blanks if not already done.
Fit a model to each analyte using standard curve samples.
Compute RAU values for each analyte using the corresponding model.
Aggregate computed RAU values into a single data frame.
Save the computed RAU values to a CSV file.
More info about the RAU normalisation can be found in
create_standard_curve_model_analyte
function documentation create_standard_curve_model_analyte or in the Model reference Model.
In case the normalisation type is nMFI, the function will:
Adjust blanks if not already done.
Compute nMFI values for each analyte using the target dilution.
Aggregate computed nMFI values into a single data frame.
Save the computed nMFI values to a CSV file.
More info about the nMFI normalisation can be found in get_nmfi
function documentation get_nmfi.
Usage
process_plate(
plate,
filename = NULL,
output_dir = "normalised_data",
normalisation_type = "RAU",
data_type = "Median",
include_raw_mfi = TRUE,
adjust_blanks = FALSE,
verbose = TRUE,
reference_dilution = 1/400,
...
)
Arguments
- plate
(
Plate()
) a plate object- filename
(
character(1)
) The name of the output CSV file with normalised MFI values. If not provided or equals toNULL
, the output filename will be based on the normalisation type and the plate name, precisely:{plate_name}_{normalisation_type}.csv
. By default theplate_name
is the filename of the input file that contains the plate data. For more details please refer to Plate.If the passed filename does not contain
.csv
extension, the default extension.csv
will be added. Filename can also be a path to a file, e.g.path/to/file.csv
. In this case, theoutput_dir
andfilename
will be joined together. However, if the passed filepath is an absolute path and theoutput_dir
parameter is also provided, theoutput_dir
parameter will be ignored. If a file already exists under a specified filepath, the function will overwrite it.- output_dir
(
character(1)
) The directory where the output CSV file should be saved. Please note that any directory path provided will create all necessary directories (including parent directories) if they do not exist. If it equals toNULL
the current working directory will be used. Default is 'normalised_data'.- normalisation_type
(
character(1)
) type of normalisation to use. Available options are:c(RAU, nMFI)
.- data_type
(
character(1)
) type of data to use for the computation. Median is the default- include_raw_mfi
(
logical(1)
) include raw MFI values in the output. The default isTRUE
. In case this option isTRUE
, the output dataframe contains two columns for each analyte: one for the normalised values and one for the raw MFI values. The normalised columns are named asAnalyteName
andAnalyteName_raw
, respectively.- adjust_blanks
(
logical(1)
) adjust blanks before computing RAU values. The default isFALSE
- verbose
(
logical(1)
) print additional information. The default isTRUE
- reference_dilution
(
numeric(1)
) target dilution to use as reference for the nMFI normalisation. Ignored in case of RAU normalisation. Default is1/400
. It should refer to a dilution of a standard curve sample in the given plate object. This parameter could be either a numeric value or a string. In case it is a character string, it should have the format1/d+
, whered+
is any positive integer.- ...
Additional arguments to be passed to the fit model function (
create_standard_curve_model_analyte
)
Examples
plate_file <- system.file("extdata", "CovidOISExPONTENT_CO_reduced.csv", package = "PvSTATEM")
# a plate file with reduced number of analytes to speed up the computation
layout_file <- system.file("extdata", "CovidOISExPONTENT_CO_layout.xlsx", package = "PvSTATEM")
plate <- read_luminex_data(plate_file, layout_file, verbose = FALSE)
example_dir <- tempdir(check = TRUE) # a temporary directory
# create and save dataframe with computed dilutions
process_plate(plate, output_dir = example_dir)
#> Fitting the models and predicting RAU for each analyte
#> Adding the raw MFI values to the output dataframe
#> Saving the computed RAU values to a CSV file located in: '/tmp/RtmpoF3Jut/CovidOISExPONTENT_CO_reduced_RAU.csv'
#> Spike_6P_IPP ME_NA Spike_6P_IPP_raw ME_NA_raw
#> K086-LM 3292.26101 2128.6098 4658.5 365.5
#> M254-VM 85.38753 5496.4318 209.5 814.0
#> M199-DS 2841.64505 7169.3408 4180.0 993.0
#> M164-LM 125.42694 3560.9584 287.5 572.0
#> M265-MM 396.34769 3783.9004 784.0 602.0
#> K026-DJ 85.13506 1430.5461 209.0 257.0
#> K137-DT 3142.28223 6567.6666 4503.0 931.5
#> M255-VA 38.78304 1103.7202 114.0 205.0
#> M258-PA 52.98592 2174.6786 144.0 372.5
#> M188-VC 1137.87727 1877.6962 1992.5 327.0
#> M270-BF 58.80200 875.6587 156.0 168.5
#> M050-EL 100.64396 2168.0885 239.5 371.5
#> M088-GE 145.30638 2892.0240 325.5 478.5
#> M259-PM 1082.02893 8614.0967 1908.0 1129.0
#> K101-PA 73.84503 1777.7663 186.5 311.5
#> M189-VY 511.61479 2562.3316 985.0 430.5
#> K018-FC 882.55266 2250.6828 1598.0 384.0
#> M142-RA 54.43368 966.1990 147.0 183.0
#> K100-CC 42.98563 984.9380 123.0 186.0
#> K107-RP 32.36841 1138.1493 100.0 210.5
#> M240-HS 31.46594 1028.6766 98.0 193.0
#> K019-FM 83.62164 1589.0900 206.0 282.0
#> M148-PS 61.97864 1216.4977 162.5 223.0
#> M089-HG 4677.61877 7712.7546 5944.0 1046.0
#> K136-DA 20000.00000 17238.7897 14414.0 1706.0
#> M241-HR 5532.92911 1279.2952 6626.0 233.0
#> K020-NA 12680.55047 9631.3814 10465.0 1216.0
#> M239-HJ 40.41069 2654.1971 117.5 444.0
#> M092-LS 164.84476 3102.6112 362.5 508.5
#> M162-PE 4972.48078 5738.5101 6187.5 841.5
#> M260-PM 20000.00000 2370.4746 14657.5 402.0
#> K021-FS 28.78211 635.1388 92.0 130.0
#> M253-VM 80.35078 1235.3249 199.5 226.0
#> M198-CN 60.26598 2056.5039 159.0 354.5
#> M163-PD 3780.09488 6970.3730 5140.5 973.0
#> M264-MA 20000.00000 2197.7678 19919.0 376.0
#> K024-DT 981.88707 2867.6895 1754.0 475.0
# process plate without adjusting blanks and save the output to a file with a custom name
process_plate(plate,
filename = "plate_without_blanks_adjusted.csv",
output_dir = example_dir, adjust_blanks = FALSE
)
#> Fitting the models and predicting RAU for each analyte
#> Adding the raw MFI values to the output dataframe
#> Saving the computed RAU values to a CSV file located in: '/tmp/RtmpoF3Jut/plate_without_blanks_adjusted.csv'
#> Spike_6P_IPP ME_NA Spike_6P_IPP_raw ME_NA_raw
#> K086-LM 3292.26101 2128.6098 4658.5 365.5
#> M254-VM 85.38753 5496.4318 209.5 814.0
#> M199-DS 2841.64505 7169.3408 4180.0 993.0
#> M164-LM 125.42694 3560.9584 287.5 572.0
#> M265-MM 396.34769 3783.9004 784.0 602.0
#> K026-DJ 85.13506 1430.5461 209.0 257.0
#> K137-DT 3142.28223 6567.6666 4503.0 931.5
#> M255-VA 38.78304 1103.7202 114.0 205.0
#> M258-PA 52.98592 2174.6786 144.0 372.5
#> M188-VC 1137.87727 1877.6962 1992.5 327.0
#> M270-BF 58.80200 875.6587 156.0 168.5
#> M050-EL 100.64396 2168.0885 239.5 371.5
#> M088-GE 145.30638 2892.0240 325.5 478.5
#> M259-PM 1082.02893 8614.0967 1908.0 1129.0
#> K101-PA 73.84503 1777.7663 186.5 311.5
#> M189-VY 511.61479 2562.3316 985.0 430.5
#> K018-FC 882.55266 2250.6828 1598.0 384.0
#> M142-RA 54.43368 966.1990 147.0 183.0
#> K100-CC 42.98563 984.9380 123.0 186.0
#> K107-RP 32.36841 1138.1493 100.0 210.5
#> M240-HS 31.46594 1028.6766 98.0 193.0
#> K019-FM 83.62164 1589.0900 206.0 282.0
#> M148-PS 61.97864 1216.4977 162.5 223.0
#> M089-HG 4677.61877 7712.7546 5944.0 1046.0
#> K136-DA 20000.00000 17238.7897 14414.0 1706.0
#> M241-HR 5532.92911 1279.2952 6626.0 233.0
#> K020-NA 12680.55047 9631.3814 10465.0 1216.0
#> M239-HJ 40.41069 2654.1971 117.5 444.0
#> M092-LS 164.84476 3102.6112 362.5 508.5
#> M162-PE 4972.48078 5738.5101 6187.5 841.5
#> M260-PM 20000.00000 2370.4746 14657.5 402.0
#> K021-FS 28.78211 635.1388 92.0 130.0
#> M253-VM 80.35078 1235.3249 199.5 226.0
#> M198-CN 60.26598 2056.5039 159.0 354.5
#> M163-PD 3780.09488 6970.3730 5140.5 973.0
#> M264-MA 20000.00000 2197.7678 19919.0 376.0
#> K024-DT 981.88707 2867.6895 1754.0 475.0
# nMFI normalisation
process_plate(plate,
output_dir = example_dir,
normalisation_type = "nMFI", reference_dilution = 1 / 400
)
#> Computing nMFI values for each analyte
#> Adding the raw MFI values to the output dataframe
#> Saving the computed nMFI values to a CSV file located in: '/tmp/RtmpoF3Jut/CovidOISExPONTENT_CO_reduced_nMFI.csv'
#> Spike_6P_IPP ME_NA Spike_6P_IPP_raw ME_NA_raw
#> K086-LM 1.32720798 0.9407979 4658.5 365.5
#> M254-VM 0.05968661 2.0952381 209.5 814.0
#> M199-DS 1.19088319 2.5559846 4180.0 993.0
#> M164-LM 0.08190883 1.4723295 287.5 572.0
#> M265-MM 0.22336182 1.5495495 784.0 602.0
#> K026-DJ 0.05954416 0.6615187 209.0 257.0
#> K137-DT 1.28290598 2.3976834 4503.0 931.5
#> M255-VA 0.03247863 0.5276705 114.0 205.0
#> M258-PA 0.04102564 0.9588160 144.0 372.5
#> M188-VC 0.56766382 0.8416988 1992.5 327.0
#> M270-BF 0.04444444 0.4337194 156.0 168.5
#> M050-EL 0.06823362 0.9562420 239.5 371.5
#> M088-GE 0.09273504 1.2316602 325.5 478.5
#> M259-PM 0.54358974 2.9060489 1908.0 1129.0
#> K101-PA 0.05313390 0.8018018 186.5 311.5
#> M189-VY 0.28062678 1.1081081 985.0 430.5
#> K018-FC 0.45527066 0.9884170 1598.0 384.0
#> M142-RA 0.04188034 0.4710425 147.0 183.0
#> K100-CC 0.03504274 0.4787645 123.0 186.0
#> K107-RP 0.02849003 0.5418275 100.0 210.5
#> M240-HS 0.02792023 0.4967825 98.0 193.0
#> K019-FM 0.05868946 0.7258687 206.0 282.0
#> M148-PS 0.04629630 0.5740026 162.5 223.0
#> M089-HG 1.69344729 2.6924067 5944.0 1046.0
#> K136-DA 4.10655271 4.3912484 14414.0 1706.0
#> M241-HR 1.88774929 0.5997426 6626.0 233.0
#> K020-NA 2.98148148 3.1299871 10465.0 1216.0
#> M239-HJ 0.03347578 1.1428571 117.5 444.0
#> M092-LS 0.10327635 1.3088803 362.5 508.5
#> M162-PE 1.76282051 2.1660232 6187.5 841.5
#> M260-PM 4.17592593 1.0347490 14657.5 402.0
#> K021-FS 0.02621083 0.3346203 92.0 130.0
#> M253-VM 0.05683761 0.5817246 199.5 226.0
#> M198-CN 0.04529915 0.9124839 159.0 354.5
#> M163-PD 1.46452991 2.5045045 5140.5 973.0
#> M264-MA 5.67492877 0.9678250 19919.0 376.0
#> K024-DT 0.49971510 1.2226512 1754.0 475.0