The tcplVarMat
function is used to create chemical by assay matrices
for different paramters. The standard list of matrices returned includes:
- "modl_ga" -- The logAC50 (in the gain direction) for the winning
model.
- "hitc" -- The hit-call for the winning model.
- "m4id" -- The m4id, listing the concentration series selected by
tcplSubsetChid
.
- "zscore" -- The z-score based on the output from
tcplCytoPt
.
The formula used for calculating the z-score is
$-(\mathit{modl\_ga} - \mathit{cyto\_pt})/\mathit{global\_mad}$
- "tested" -- 1 or 0, 1 indicating the chemical/assay pair
was tested in either the single- or multiple-concentration format
- "tested_sc" -- 1 or 0, 1 indicating the chemical/assay pair
was tested in the single-concentration format
- "tested_mc" -- 1 or 0, 1 indicating the chemical/assay pair
was tested in the multiple-concentration format
- "ac50" -- a modified AC50 table (in non-log units) where
assay/chemical pairs that were not tested, or tested and had a hitcall of 0
or -1 have the value 1e6.
- "neglogac50" -- -log(AC50/1e6) where assay/chemical pairs that were
not tested, or tested and had a hitcall of 0 or -1 have the value 0.
To add addtitional matrices, the 'add.vars' parameter can be used to specify
the fields from the mc4 or mc5 tables to create matrices for.
When more than one sample is included for a chemical/assay pair,
tcplVarMat
aggregates multiple samples to a chemical level call
utilizing tcplSubsetChid
.
By setting odir
the function will write out a csv with, naming the
file with the convention: "var_Matrix_date.csv" where 'var' is the name
of the matrix. A prefix can be added to the output files using the
'file.prefix' paramter.
When a concentration series has a sample id not listed in the tcpl
database, and 'include.na.chid' is TRUE, the rowname for that series will
be the concatenation of "SPID_" and the spid. Note, if the user gives a
subset of chid values to the 'chid' parameter, 'include.na.chid' will be
set to FALSE with a warning.
The tcplVarMat function calls both tcplSubsetChid
and
tcplCytoPt
(which separately calls tcplSubsetChid
). The input
for the tcplVarMat
'flag' parameter is passed to the
tcplSubsetChid
call used to parse down the data to create the
matrices. The tcplSubsetChid
called within tcplCytoPt
(to
parse down the cytotoxicity data used to define the "zscore" matrix) can
be modified by passing a separate 'flag' element in the list defined by the
'cyto.pars' parameter.