Skip to contents

Perform process_plate and generate_plate_report for a given plate file. In more detail, this function reads the plate file and calls the process_plate on the processed plate objects across all the normalisation types, including the raw MFI values. If the user has specified the generate_report flag, it will also call the generate_plate_report function generating the quality control report.

Usage

process_file(
  plate_filepath,
  layout_filepath,
  output_dir = "normalised_data",
  format = "xPONENT",
  generate_report = FALSE,
  process_plate = TRUE,
  normalisation_types = c("RAU", "nMFI"),
  verbose = TRUE,
  ...
)

Arguments

plate_filepath

(character(1)) The path to the plate file.

layout_filepath

(character(1)) The path to the layout file.

output_dir

(character(1)) The directory where the output files should be saved. The default is "normalised_data".

format

(character(1)) The format of the Luminex data. The default is "xPONENT". Available options are "xPONENT" and "INTELLIFLEX".

generate_report

(logical(1)) If TRUE, generate a quality control report. The default is FALSE.

process_plate

(logical(1)) If TRUE, process the plate. The default is TRUE. If the value is set to FALSE the function will only read the plate file and return the plate object.

normalisation_types

(character()) A vector of normalisation types to use. The default is c("RAU", "nMFI").

verbose

(logical(1)) Print additional information. The default is TRUE.

...

Additional arguments to for the read_luminex_data function.

Examples


# Select an input csv file for processing and corresponding layout file
plate_file <- system.file("extdata", "CovidOISExPONTENT_CO_reduced.csv", package = "PvSTATEM")
layout_file <- system.file("extdata", "CovidOISExPONTENT_CO_layout.xlsx", package = "PvSTATEM")

example_dir <- tempdir(check = TRUE) # a temporary directory
# create and save dataframe with computed dilutions for all suported noramlization types
process_file(plate_file, layout_file, output_dir = example_dir)
#> Reading Luminex data from: /home/runner/work/_temp/Library/PvSTATEM/extdata/CovidOISExPONTENT_CO_reduced.csv
#> using format xPONENT
#> 
#> New plate object has been created with name: CovidOISExPONTENT_CO_reduced!
#> 
#> Processing plate 'CovidOISExPONTENT_CO_reduced'
#> 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/RtmpFPTjFr/CovidOISExPONTENT_CO_reduced_RAU.csv'
#> 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/RtmpFPTjFr/CovidOISExPONTENT_CO_reduced_nMFI.csv'
#> Plate with 49 samples and 2 analytes

example_dir2 <- tempdir(check = TRUE) # a temporary directory
# process the plate for a specific normalization type
process_file(plate_file, layout_file, output_dir = example_dir2, normalisation_types = c("RAU"))
#> Reading Luminex data from: /home/runner/work/_temp/Library/PvSTATEM/extdata/CovidOISExPONTENT_CO_reduced.csv
#> using format xPONENT
#> 
#> New plate object has been created with name: CovidOISExPONTENT_CO_reduced!
#> 
#> Processing plate 'CovidOISExPONTENT_CO_reduced'
#> Warning: The specified file /tmp/RtmpFPTjFr/CovidOISExPONTENT_CO_reduced_RAU.csv already exists. Overwriting it.
#> 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/RtmpFPTjFr/CovidOISExPONTENT_CO_reduced_RAU.csv'
#> Plate with 49 samples and 2 analytes