process_file: Process a File to Generate Normalised Data and Reports

View source: R/process-file.R

process_fileR Documentation

Process a File to Generate Normalised Data and Reports

Description

This function reads a Luminex plate file by calling read_luminex_data() and then processes it by calling process_plate(). It optionally generates also a quality control report using generate_plate_report(). It reads the specified plate file, processes the plate object using all specified normalisation types (including raw MFI values), and saves the results. If generate_report = TRUE, a quality control report is also generated.

Workflow

  1. Read the plate file and layout file.

  2. Process the plate data using the specified normalisation types (MFI, RAU, nMFI).

  3. Save the processed data to CSV files in the specified output_dir. The files are named as ⁠{plate_name}_{normalisation_type}.csv⁠.

  4. Optionally, generate a quality control report. The report is saved as an HTML file in the output_dir, under the name ⁠{plate_name}_report.html⁠.

Usage

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

Arguments

plate_filepath

(character(1)) Path to the Luminex plate file.

layout_filepath

(character(1)) Path to the corresponding layout file.

output_dir

(character(1), default = 'normalised_data')

  • Directory where the output files will be saved.

  • If it does not exist, it will be created.

format

(character(1), default = 'xPONENT')

  • Format of the Luminex data.

  • Available options: 'xPONENT', 'INTELLIFLEX'.

generate_report

(logical(1), default = FALSE)

  • If TRUE, generates a quality control report using generate_plate_report().

process_plate

(logical(1), default = TRUE)

  • If TRUE, processes the plate data using process_plate().

  • If FALSE, only reads the plate file and returns the plate object without processing.

normalisation_types

(character(), default = c("MFI", "RAU", "nMFI"))

  • List of normalisation types to apply.

  • Supported values: c("MFI", "RAU", "nMFI").

blank_adjustment

(logical(1), default = FALSE)

  • If TRUE, performs blank adjustment before processing.

verbose

(logical(1), default = TRUE)

  • If TRUE, prints additional information during execution.

...

Additional arguments passed to read_luminex_data() and generate_plate_report().

Value

A Plate object containing the processed data.

Examples

# Example 1: Process a plate file with default settings (all normalisation types)
plate_file <- system.file("extdata", "CovidOISExPONTENT_CO_reduced.csv", package = "SerolyzeR")
layout_file <- system.file("extdata", "CovidOISExPONTENT_CO_layout.xlsx", package = "SerolyzeR")
example_dir <- tempdir(check = TRUE)
process_file(plate_file, layout_file, output_dir = example_dir)

# Example 2: Process the plate for only RAU normalisation
process_file(plate_file, layout_file, output_dir = example_dir, normalisation_types = c("RAU"))

# Example 3: Process the plate and generate a quality control report
process_file(plate_file, layout_file, output_dir = example_dir, generate_report = TRUE)


SerolyzeR documentation built on April 12, 2025, 2:11 a.m.