Calculate expected abundance for multiple features at multiple timepoints in multiple conditions.
Usage
getExpectedAbund(
featureMetadata,
times = NULL,
sampleMetadata = NULL,
byCondGroup = is.null(times)
)
Arguments
- featureMetadata
data.table
with columnsfeature
,base
,rhyFunc
,amp
,period
, andphase
, where every row corresponds to a gene. IfbyCondGroup
isTRUE
, then must also have columnscond
andgroup
.- times
Numeric vector of the times at which to calculate expected abundance for each row in
featureMetadata
.- sampleMetadata
data.table
with columnssample
,cond
, andtime
. Eithertimes
orsampleMetadata
must be provided, and the former takes precedence.- byCondGroup
Logical for whether to speed up the calculation by grouping by the columns
cond
andgroup
. Primarily for internal use.
Value
data.table
derived from featureMetadata
(but with more rows),
with additional columns time
and mu
and possibly others. If sampling
will use the negative binomial family, mu
corresponds to log2 counts.
Examples
library('data.table')
featureMetadata = data.table(feature = c('feature_1', 'feature_2'),
base = function(x) 0,
amp = c(function(x) 0, function(x) 1),
period = 24,
phase = 0, rhyFunc = sin)
abundDt = getExpectedAbund(featureMetadata, times = 6:17)