tcplVarMat: Create chemical by assay matrices

View source: R/tcplVarMat.R

tcplVarMatR Documentation

Create chemical by assay matrices

Description

tcplVarMat creates chemical by assay matrices.

Usage

tcplVarMat(
  dsstox_substance_id = NULL,
  aeid = NULL,
  add.vars = NULL,
  flag = TRUE
)

Arguments

dsstox_substance_id

Integer, chemical ID values to subset on

aeid

Integer, assay endpoint ID values to subset on

add.vars

Character, mc4 or mc5 field(s) not included in the standard list to add additional matrices

flag

Integer or Logical of length 1, passed to tcplSubsetChid

Details

The tcplVarMat function is used to create chemical by assay matrices for different parameters. The standard list of matrices returned includes:

  1. "ac50" – The AC50 for the winning model.

  2. "ac50_verbose" – The AC50 for the winning model, with text describing some situations.

  3. "acc" – The ACC for the winning model.

  4. "acc_verbose" – The ACC for the winning model, with text describing some situations.

  5. "mc_hitc" – The hit-call for the winning model in mc testing.

  6. "sc_hitc" – The hit-call in sc testing.

tcplVarMat produces matrices of combined sc-mc output. For the ac50 and acc matrices specifically, values are inserted in place to show complete views of what was tested and what the results were. ac50 and acc values are set to: - 1e6 when the chemical is tested but negative in mc - 1e7 when the chemical is not tested in mc but was screened in sc with a positive hitcall for the same aeid - 1e7 when the chemical is not tested in mc but was screened in sc with a negative hitcall for the same aeid - not changed when chemical is tested in MC and positive, or not tested in either mc or sc

sc and mc data both are currently required to be included for these calculations.

To add additional 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.

The tcplVarMat function calls both tcplSubsetChid. The input for the tcplVarMat 'flag' parameter is passed to the tcplSubsetChid call used to parse down the data to create the matrices.

Value

A list of chemical by assay matrices (data.tables) where the rows are given by the dsstox_substance_id and corresponding chnm (chemical name) columns and the colnames are given by assay endpoint name (aenm).

See Also

tcplSubsetChid

Examples

## Store the current config settings, so they can be reloaded at the end 
## of the examples
conf_store <- tcplConfList()
TCPLlite <- file.path(system.file(package = "tcpl"), "example")
tcplConf(db = TCPLlite, user = NA, host = NA, drvr = "tcplLite")
## Not run: 
## Demonstrate the returned values.
tcplVarMat()

## Other changes can be made
aeids <- c(80)
dtxsid <- c("DTXSID80379721", "DTXSID10379991", "DTXSID7021106", 
"DTXSID1026081", "DTXSID9032589")
tcplVarMat(aeid = aeids, dsstox_substance_id = dtxsid)
tcplVarMat(aeid = aeids, add.vars = c("m4id", "resp_max", "max_med"))

## End(Not run)
## Reset configuration
options(conf_store)


USEPA/CompTox-ToxCast-tcpl documentation built on May 2, 2024, 2:25 p.m.