Skip to contents

This function generates a Levey-Jennings report for a list of plates. The report includes layout plot, levey jennings plot, for each analyte and selected dilutions. The report also includes stacked standard curves plot in both monochromatic and color versions for each analyte. The report is generated using the levey_jennings_report_template.Rmd template.

Usage

generate_levey_jennings_report(
  list_of_plates,
  report_title,
  dilutions = c("1/100", "1/400"),
  filename = NULL,
  output_dir = "reports",
  additional_notes = NULL
)

Arguments

list_of_plates

A list of plate objects.

report_title

(character(1)) The title of the report.

dilutions

(character) A character vector specifying the dilutions to be included in the report. Default is c("1/100", "1/400").

filename

(character(1)) The name of the output HTML report file. If not provided or set to NULL, the filename will be based on the first plate name, formatted as {plate_name}_levey_jennings.html. If the filename does not contain the .html extension, it will be automatically added. Absolute file paths in filename will override output_dir. Existing files at the specified path will be overwritten.

output_dir

(character(1)) The directory where the report will be saved. Defaults to 'reports'. If NULL, the current working directory will be used. Necessary directories will be created if they do not exist.

additional_notes

(character(1)) Additional notes to be included in the report. Markdown formatting is supported. If not provided, the section will be omitted.

Value

A Levey-Jennings report in HTML format.

Examples

output_dir <- tempdir(check = TRUE)

dir_with_luminex_files <- system.file("extdata", "multiplate_reallife_reduced",
  package = "PvSTATEM", mustWork = TRUE
)
list_of_plates <- process_dir(dir_with_luminex_files,
  return_plates = TRUE, format = "xPONENT", output_dir = output_dir
)
#> Reading Luminex data from: /home/runner/work/_temp/Library/PvSTATEM/extdata/multiplate_reallife_reduced/IGG_CO_1_xponent.csv
#> using format xPONENT
#> 
#> New plate object has been created with name: IGG_CO_1_xponent!
#> 
#> Processing plate 'IGG_CO_1_xponent'
#> 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/IGG_CO_1_xponent_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/IGG_CO_1_xponent_nMFI.csv'
#> Reading Luminex data from: /home/runner/work/_temp/Library/PvSTATEM/extdata/multiplate_reallife_reduced/IGG_CO_2_xponent.csv
#> using format xPONENT
#> 
#> New plate object has been created with name: IGG_CO_2_xponent!
#> 
#> Processing plate 'IGG_CO_2_xponent'
#> 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/IGG_CO_2_xponent_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/IGG_CO_2_xponent_nMFI.csv'
#> Reading Luminex data from: /home/runner/work/_temp/Library/PvSTATEM/extdata/multiplate_reallife_reduced/IGG_CO_3_xponent.csv
#> using format xPONENT
#> 
#> New plate object has been created with name: IGG_CO_3_xponent!
#> 
#> Processing plate 'IGG_CO_3_xponent'
#> 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/IGG_CO_3_xponent_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/IGG_CO_3_xponent_nMFI.csv'
note <- "This is a Levey-Jennings report.\n**Author**: Jane Doe \n**Tester**: John Doe"

generate_levey_jennings_report(
  list_of_plates = list_of_plates,
  report_title = "QC Report",
  dilutions = c("1/100", "1/200"),
  output_dir = tempdir(),
  additional_notes = note
)
#> Generating report... For large reports with more than 30 plates, this will take a few minutes.
#> Report successfully generated, saving to: /tmp/RtmpFPTjFr/IGG_CO_1_xponent_levey_jennings.html