process_dir {SerolyzeR} | R Documentation |
Process a Directory of Luminex Data Files
Description
This function processes all Luminex plate files within a specified directory.
Each plate file is processed using process_file()
, and the resulting normalised data is saved.
Optionally, quality control reports can be generated, and results from multiple plates can be merged into a single file.
Workflow
Identify all Luminex plate files in the
input_dir
, applying recursive search ifrecurse = TRUE
.Detect the format of each file based on the
format
parameter or the filename.Locate the corresponding layout file using the filename or use the common layout passed with the
layout_filepath
parameter.Determine the appropriate output directory using
get_output_dir()
.Process each plate file using
process_file()
.If
merge_outputs = TRUE
, merge normalised data from multiple plates into a single CSV file.
Naming Conventions for Input Files
-
If
format
is specified:Each plate file should be named as
{plate_name}.csv
.The corresponding layout file should be named as
{plate_name}_layout.csv
or{plate_name}_layout.xlsx
.Alternatively, if
layout_filepath
is provided, it serves as a unified layout file for all plates.
-
If
format
equalsNULL
(automatic detection):Each plate file should be named as
{plate_name}_{format}.csv
, where{format}
is eitherxPONENT
orINTELLIFLEX
.The corresponding layout file should be named using the same convention as above, i.i.
{plate_name}_{format}_layout.csv
or{plate_name}_{format}_layout.xlsx
.
Output File Structure
The
output_dir
parameter specifies where the processed files are saved.If
output_dir
isNULL
, output files are saved in the same directory as the input files.By default, the output directory structure follows the input directory, unless
flatten_output_dir = TRUE
, which saves all outputs directly intooutput_dir
.Output filenames follow the convention used in
process_file()
.For a plate named
{plate_name}
, the normalised output files are named as:-
{plate_name}_RAU.csv
for RAU normalisation. -
{plate_name}_nMFI.csv
for nMFI normalisation. -
{plate_name}_MFI.csv
for MFI normalisation.
-
If
generate_reports = TRUE
, a quality control report for every plate is saved as{plate_name}_report.pdf
.If
merge_outputs = TRUE
, merged normalised files are named as:-
merged_RAU_{timestamp}.csv
-
merged_nMFI_{timestamp}.csv
-
merged_MFI_{timestamp}.csv
-
If
generate_multiplate_reports = TRUE
, a multiplate quality control report is saved asmultiplate_report_{timestamp}.pdf
.
Usage
process_dir(
input_dir,
output_dir = NULL,
recurse = FALSE,
flatten_output_dir = FALSE,
layout_filepath = NULL,
format = "xPONENT",
normalisation_types = c("MFI", "RAU", "nMFI"),
generate_reports = FALSE,
generate_multiplate_reports = FALSE,
merge_outputs = TRUE,
column_collision_strategy = "intersection",
return_plates = FALSE,
dry_run = FALSE,
verbose = TRUE,
...
)
Arguments
input_dir |
( |
output_dir |
( |
recurse |
(
|
flatten_output_dir |
(
|
layout_filepath |
( |
format |
( |
normalisation_types |
(
|
generate_reports |
(
|
generate_multiplate_reports |
(
|
merge_outputs |
(
|
column_collision_strategy |
(
|
return_plates |
(
|
dry_run |
(
|
verbose |
(
|
... |
Additional arguments passed to |
Value
If return_plates = TRUE
, returns a sorted list of Plate objects. Otherwise, returns NULL
.
Examples
# Process all plate files in a directory
input_dir <- system.file("extdata", "multiplate_lite", package = "SerolyzeR", mustWork = TRUE)
output_dir <- tempdir(check = TRUE)
plates <- process_dir(input_dir, return_plates = TRUE, output_dir = output_dir)