This package reads ASCII sample files ("S-files"), calibration files ("C-files"), and raw data ("R-files") exported from BCS XP coagulation analyzers, and returns a tidy row-wise dataframe. It can also read the subassays for each assay, and return a list column containing the results.
Currently, the package is not able to read data exported in XML format. Data for the tests are not included in the repo due to rights issues.
# install.packages("devtools")
devtools::install_github("colindouglas/bcsxp")
read_bcsxp(path, filetype = "guess")
attempts to guess the type of file based on it's header and path and reads it with the appropriate method. By default, it does not attempt to parse the subassays for each assay in an S-file.
read_bcsxp(path, filetype = "S", include_subassays = FALSE)
reads an exported ASCII file containing data on samples and controls, typically named "Syyyymmddn.BCSXp". It returns a tibble with the following columns:
datetime
: The date and time the assay finishedsample_name
: The name of the sample on the instrument. For controls, it is the control lot numbersample_type
: Either "Sample" or "Control"assay_number
: The number uniquely identifying the assay performed. Manufacturer assays < 1000.assay_name
: The short name identifying the assayreagent_lots
: The lot numbers of the reagents used to perform the assay, separated by spacesraw_unit
: The measurement units for the assay, often "secs" for clotting assays or "mE/min" from chromogenic assaysresult_unit
: The units of the assay output. Often "secs" or "%d.N." for factor assaysraw
: The raw measurement, in units ofraw_unit
. If the assay is calibrated, this is the measurement before intepretation through the curvecalibration_curve
: The calibration curve through which the raw measurement is interpretedresult
: The output of the assay, in units ofresult_unit
. If the assay is calibrated, this is theraw
interpreted throughcalibration_curve
flags
: These are warning or error flags raised during the assayinstrument
: The name of the instrument and the instrument serial number, separated by a spacefilename
: The path to the file from which the data originatedsubassays
: If the function is called withinclude_subassays = TRUE
, this is a list column containing the details of the assays-within-the-assay. This column is excluded by default
read_bcsxp(path, filetype = "C")
reads an exported ASCII file containing data on calibration curves, typically named "Cyyyymmddn.BCSXp". It returns a tibble with the following columns:
datetime
: The date and time the calibration curve measurement finishedcurve_name
: The name of the calibration curve.assay_number
: The number uniquely identifying the assay performed. Manufacturer assays < 1000.assay_name
: The short name identifying the assayreagent_lots
: The lot numbers of the reagents used to perform the assay, separated by spacesraw_unit
: The measurement units for the assay, often "secs" for clotting assays or "mE/min" from chromogenic assaysconcentration_unit
: The units of the assay output. Often "secs" or "%d.N." for factor assaysreagent_lots
: The lot numbers of the reagents used to perform the assay, separated by spacesflags
: These are warning or error flags that were raised during the calibrationmeasurements
: The number of supporting points for the calibration curveinstrument
: The name of the instrument and the instrument serial number, separated by a spacefilename
: The path to the file from which the data originatedpoints
: A list column that contains results for the individual points in the calibration curve
read_bcsxp(path, filetype = "R")
reads an exported ASCII file containing raw absorbance vs. time data for each assay, typically named "Ryyyymmddn.BCSXp". It returns a tibble with the following columns:
datetime
: The date and time the calibration curve measurement finishedid
: Unique identifier for each assaysample_name
: The name of the sample on the instrument. For controls, it is the control lot numbersample_type
: Either "Sample" or "Control"assay_number
: The number uniquely identifying the assay performed. Manufacturer assays < 1000.assay_name
: The short name identifying the assayreagent_lots
: The lot numbers of the reagents used to perform the assay, separated by spacescuvette
: The cuvette position in which the reaction occuredflags
: These are warning or error flags raised during the assaydetection method
: The method the software uses to infer the raw result. For clot-based assays, this is the endpoint detection methodraw
: The raw measurement, in units ofraw_unit
. If the assay is calibrated, this is the measurement before intepretation through the curveraw_unit
: The measurement units for the assay, often "secs" for clotting assays or "mE/min" from chromogenic assaysinstrument
: The name of the instrument and the instrument serial number, separated by a spacefilename
: The path to the file from which the data originatedwave
: A list column with two columns,time
in seconds, and opticalabs
orbance in mA