scaleBioassaySet | R Documentation |
bioassaySet
object (creates Z-scores)
Converts the numeric activity scores for a bioassaySet
object
into per-assay Z-scores. Untested '0' values are not considered
in computing the value, only actives and inactives. In essence, this
is a special version of the R base scale
function,
which ignores missing entries in a sparse matrix instead of using them
as zeros. A primary purpose of this function is to pass scaled
results to perTargetMatrix
, in order to compute a numeric Z-score
compound vs. target matrix.
scaleBioassaySet(bioassaySet, center=TRUE, scale=TRUE)
bioassaySet |
A |
center |
A logical value. If center is TRUE then centering is done by subtracting the assay means (omitting inconclusive NAs) from their corresponding scores, and if center is FALSE, no centering is done. |
scale |
A logical value. Scaling is done by dividing the (centered) per-assay scores by their standard deviations if center is TRUE, and the root mean square otherwise. If scale is FALSE, no scaling is done. |
A bioassaySet
object with standardized numeric scores, that can be
accessed with scores(bioassaySet)
.
Tyler William H Backman
Functions: getAssays
, perTargetMatrix
## connect to a test database
extdata_dir <- system.file("extdata", package="bioassayR")
sampleDatabasePath <- file.path(extdata_dir, "sampleDatabase.sqlite")
sampleDB <- connectBioassayDB(sampleDatabasePath)
## retrieve three assays
assays <- getAssays(sampleDB, c("347221","53211","624349"))
## disconnect from sample database
disconnectBioassayDB(sampleDB)
## compute and return standardized scores
scaledAssays <- scaleBioassaySet(assays)
## inspect scaled and unscaled scores
scores(assays)
scores(scaledAssays)
## NOTE: this example only returns non-NA Z-scores if tried with
## real data, not the test database used here
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.