format_caco2 | R Documentation |
This function formats data describing mass spectrometry (MS) peak areas from samples collected as part of in vitro measurements of membrane permeability using Caco-2 cells \insertCitehubatsch2007determinationinvitroTKstats. The input data frame is organized into a standard set of columns and is written to a tab-separated text file.
format_caco2(
FILENAME = "MYDATA",
data.in,
sample.col = "Lab.Sample.Name",
lab.compound.col = "Lab.Compound.Name",
dtxsid.col = "DTXSID",
date = NULL,
date.col = "Date",
compound.col = "Compound.Name",
area.col = "Area",
istd.col = "ISTD.Area",
type.col = "Type",
direction.col = "Direction",
membrane.area = NULL,
membrane.area.col = "Membrane.Area",
receiver.vol.col = "Vol.Receiver",
donor.vol.col = "Vol.Donor",
test.conc = NULL,
test.conc.col = "Test.Compound.Conc",
cal = NULL,
cal.col = "Cal",
dilution = NULL,
dilution.col = "Dilution.Factor",
time = NULL,
time.col = "Time",
istd.name = NULL,
istd.name.col = "ISTD.Name",
istd.conc = NULL,
istd.conc.col = "ISTD.Conc",
test.nominal.conc = NULL,
test.nominal.conc.col = "Test.Target.Conc",
biological.replicates = NULL,
biological.replicates.col = "Biological.Replicates",
technical.replicates = NULL,
technical.replicates.col = "Technical.Replicates",
analysis.method = NULL,
analysis.method.col = "Analysis.Method",
analysis.instrument = NULL,
analysis.instrument.col = "Analysis.Instrument",
analysis.parameters = NULL,
analysis.parameters.col = "Analysis.Parameters",
note.col = "Note",
level0.file = NULL,
level0.file.col = "Level0.File",
level0.sheet = NULL,
level0.sheet.col = "Level0.Sheet",
output.res = FALSE,
save.bad.types = FALSE,
sig.figs = 5,
INPUT.DIR = NULL,
OUTPUT.DIR = NULL,
verbose = TRUE
)
FILENAME |
(Character) A string used to identify the output level-1 file. "<FILENAME>-Caco-2-Level1.tsv", and/or used to identify the input level-0 file, "<FILENAME>-Caco-2-Level0.tsv" if importing from a .tsv file. (Defaults to "MYDATA".) |
data.in |
(Data Frame) A level-0 data frame containing mass-spectrometry peak areas, indication of chemical identity, and measurement type. The data frame should contain columns with names specified by the following arguments: |
sample.col |
(Character) Column name of |
lab.compound.col |
(Character) Column name of |
dtxsid.col |
(Character) Column name of |
date |
(Character) The laboratory measurement date, format "MMDDYY" where
"MM" = 2 digit month, "DD" = 2 digit day, and "YY" = 2 digit year. (Defaults to |
date.col |
(Character) Column name containing |
compound.col |
(Character) Column name of |
area.col |
(Character) Column name of |
istd.col |
(Character) Column name of |
type.col |
(Character) Column name of |
direction.col |
(Character) Column name of |
membrane.area |
(Numeric) The area of the Caco-2 monolayer (in cm^2).
(Defaults to |
membrane.area.col |
(Character) Column name containing |
receiver.vol.col |
(Character) Column name of |
donor.vol.col |
(Character) Column name of |
test.conc |
(Numeric) The standard test chemical concentration for the
Caco-2 assay. (Defaults to |
test.conc.col |
(Character) Column name containing |
cal |
(Character) MS calibration the samples were based on. Typically, this uses
indices or dates to represent if the analyses were done on different machines on
the same day or on different days with the same MS analyzer. (Defaults to |
cal.col |
(Character) Column name containing |
dilution |
(Numeric) Number of times the sample was diluted before MS
analysis. (Defaults to |
dilution.col |
(Character) Column name containing |
time |
(Numeric) The amount of time (in hours) before the receiver and donor
compartments are measured. (Defaults to |
time.col |
(Character) Column name containing |
istd.name |
(Character) The identity of the internal standard. (Defaults to |
istd.name.col |
(Character) Column name containing |
istd.conc |
(Numeric) The concentration for the internal standard. (Defaults to |
istd.conc.col |
(Character) Column name containing |
test.nominal.conc |
(Numeric) The nominal concentration added to the donor
compartment at time 0. (Defaults to |
test.nominal.conc.col |
(Character) Column name containing |
biological.replicates |
(Character) Replicates with the same analyte. Typically, this uses
numbers or letters to index. (Defaults to |
biological.replicates.col |
(Character) Column name of |
technical.replicates |
(Character) Repeated measurements from one sample. Typically, this uses
numbers or letters to index. (Defaults to |
technical.replicates.col |
(Character) Column name of |
analysis.method |
(Character) The analytical chemistry analysis method,
typically "LCMS" or "GCMS", liquid chromatography or gas chromatography–mass
spectrometry, respectively. (Defaults to |
analysis.method.col |
(Character) Column name containing |
analysis.instrument |
(Character) The instrument used for chemical analysis,
for example "Agilent 6890 GC with model 5973 MS". (Defaults to |
analysis.instrument.col |
(Character) Column name containing |
analysis.parameters |
(Character) The parameters used to identify the
compound on the chemical analysis instrument, for example
"Negative Mode, 221.6/161.6, -DPb=26, FPc=-200, EPd=-10, CEe=-20, CXPf=-25.0". (Defaults to |
analysis.parameters.col |
(Character) Column name containing |
note.col |
(Character) Column name of |
level0.file |
(Character) The level-0 file from which the |
level0.file.col |
(Character) Column name containing |
level0.sheet |
(Character) The specific sheet name of level-0 file from which the
|
level0.sheet.col |
(Character) Column name containing |
output.res |
(Logical) When set to |
save.bad.types |
(Logical) When set to |
sig.figs |
(Numeric) The number of significant figures to round the exported result table (level-1).
(Defaults to |
INPUT.DIR |
(Character) Path to the directory where the input level-0 file exists.
If |
OUTPUT.DIR |
(Character) Path to the directory to save the output file.
If |
verbose |
(logical) Indicate whether printed statements should be shown. (Default is TRUE.) |
In this experiment an in vitro well is separated into two by a membrane composed of a monolayer of Caco-2 cells. A test chemical is added to either the apical or basolateral side of of the monolayer at time 0, and after a set time samples are taken from both the "donor" (side where the test chemical was added) and the "receiver" side. Depending on the direction of the test the donor side can be either apical or basolateral.
The data frame of observations should be annotated according to direction (either apical to basolateral – "AtoB" – or basolateral to apical – "BtoA") and type of concentration measured:
Blank with no chemical added | Blank |
Target concentration added to donor compartment at time 0 (C0) | D0 |
Donor compartment at end of experiment | D2 |
Receiver compartment at end of experiment | R2 |
Chemical concentration is calculated qualitatively as a response and returned as a column in the output data frame:
Response <- AREA / ISTD.AREA * ISTD.CONC
If the output level-1 result table is chosen to be exported and an output
directory is not specified, it will be exported to the user's R session
temporary directory. This temporary directory is a per-session directory
whose path can be found with the following code: tempdir()
. For more
details, see https://www.collinberke.com/til/posts/2023-10-24-temp-directories/.
As a best practice, INPUT.DIR
and/or OUTPUT.DIR
should be
specified to simplify the process of importing and exporting files. This
practice ensures that the exported files can easily be found and will not be
exported to a temporary directory.
A level-1 data frame with a standardized format containing a standardized set of columns and column names with membrane permeability data from a Caco-2 assay.
John Wambaugh
hubatsch2007determinationinvitroTKstats
## Load example level-0 data and do not export the result table
level0 <- invitroTKstats::caco2_L0
level1 <- format_caco2(data.in = level0,
sample.col = "Sample",
lab.compound.col = "Lab.Compound.ID",
compound.col = "Compound",
area.col = "Peak.Area",
istd.col = "ISTD.Peak.Area",
membrane.area = 0.11,
test.conc.col = "Compound.Conc",
cal = 1,
time = 2,
istd.conc = 1,
test.nominal.conc = 10,
biological.replicates = 1,
technical.replicates = 1,
analysis.method.col = "Analysis.Params",
analysis.instrument = "Agilent.GCMS",
analysis.parameters = "Unknown",
note.col = NULL,
output.res = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.