tcplLoadData: Load tcpl data

View source: R/tcplLoadData.R

tcplLoadDataR Documentation

Load tcpl data

Description

tcplLoadData queries the tcpl databases and returns a data.table with data for the given level and data type.

Usage

tcplLoadData(lvl, fld = NULL, val = NULL, type = "mc", add.fld = TRUE)

Arguments

lvl

Integer of length 1, the level of data to load

fld

Character, the field(s) to query on

val

List, vectors of values for each field to query on. Must be in the same order as 'fld'.

type

Character of length 1, the data type, "sc" or "mc"

add.fld

Boolean if true we want to return the additional parameters fit with tcplfit2

Details

The data type can be either 'mc' for mutliple concentration data, or 'sc' for single concentration data. Multiple concentration data will be loaded into the 'mc' tables, whereas the single concentration will be loaded into the 'sc' tables.

Setting 'lvl' to "agg" will return an aggregate table containing the m4id with the concentration-response data and m3id to map back to well-level information.

If tcplConf() was set with "API" as the driver, then tcplLoadData will return data from the CCTE Bioactivity API. API data is available for type = 'mc' and lvl = c(3,4,5,6) and 'agg'. Only fields relating to the requested level are returned, but not all fields that usually return from invitrodb are available from the API. To have all fields available from the API return, regardless of what lvl is set to, set add.fld to TRUE. API query-able fields include "aeid", "spid", "m4id", and "dtxsid".

Leaving fld NULL will return all data.

Valid fld inputs are based on the data level and type:

type lvl Queried tables
sc 0 sc0
sc 1 sc0, sc1
sc agg sc1, sc2_agg
sc 2 sc2
mc 0 mc0
mc 1 mc0, mc1
mc 2 mc0, mc1, mc2
mc 3 mc0, mc1, mc3
mc agg mc3, mc4_agg
mc 4 mc4
mc 5 mc4, mc5
mc 6 mc4, mc6
mc 7 mc4, mc7

Value

A data.table containing data for the given fields.

See Also

tcplQuery, data.table

Examples

## Not run: 
## Load all of level 0 for multiple-concentration data, note 'mc' is the
## default value for type
tcplLoadData(lvl = 0)

## Load all of level 1 for single-concentration
tcplLoadData(lvl = 1, type = "sc")

## List the fields available for level 1, coming from tables mc0 and mc1
tcplListFlds(tbl = "mc0")
tcplListFlds(tbl = "mc1")

## Load level 0 data where the well type is "t" and the concentration
## index is 3 or 4
tcplLoadData(lvl = 1, fld = c("wllt", "cndx"), val = list("t", c(3:4)))

## End(Not run)

tcpl documentation built on Oct. 10, 2024, 1:07 a.m.