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.tablewith columnsfeature,base,rhyFunc,amp,period, andphase, where every row corresponds to a gene. IfbyCondGroupisTRUE, then must also have columnscondandgroup.- times
Numeric vector of the times at which to calculate expected abundance for each row in
featureMetadata.- sampleMetadata
data.tablewith columnssample,cond, andtime. EithertimesorsampleMetadatamust be provided, and the former takes precedence.- byCondGroup
Logical for whether to speed up the calculation by grouping by the columns
condandgroup. 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)