getPosteriorFit {limorhyde2} | R Documentation |
Compute posterior fit for linear models for rhythmicity
Description
This is the second step in an analysis using limorhyde2
, the first is to
fit linear models using getModelFit()
. This function obtains posterior
estimates of coefficients using multivariate adaptive shrinkage (mash), which
learns patterns in the data and accounts for noise in the original fits. The
defaults for arguments should work well in most cases, so only change them if
you know what you're doing.
Usage
getPosteriorFit(
fit,
covMethod = c("data-driven", "canonical", "both"),
getSigResArgs = list(),
npc = fit$nKnots,
covEdArgs = list(),
overwrite = FALSE,
...
)
Arguments
fit |
A |
covMethod |
String indicating the type(s) of covariance matrices to use for the mash fit. |
getSigResArgs |
List of arguments passed to
|
npc |
Number of principal components passed to |
covEdArgs |
List of arguments passed to |
overwrite |
Logical for whether to recompute the mash fit if it already exists. |
... |
Additional arguments passed to |
Value
A limorhyde2
object containing everything in fit
with added or
updated elements:
-
mashData
: list ofmash
data objects -
mashFits
: list ofmash
fit objects -
mashCoefficients
: Matrix of posterior mean coefficients, with rows corresponding to features and columns to model terms. -
mashIdx
: Vector indicating which model terms were included in the mash fit.
See Also
getModelFit()
, getRhythmStats()
, getExpectedMeas()
Examples
library('data.table')
# rhythmicity in one condition
y = GSE54650$y
metadata = GSE54650$metadata
fit = getModelFit(y, metadata)
fit = getPosteriorFit(fit)
rhyStats = getRhythmStats(fit, features = c('13170', '13869'))
# rhythmicity and differential rhythmicity in multiple conditions
y = GSE34018$y
metadata = GSE34018$metadata
fit = getModelFit(y, metadata, nKnots = 3L, condColname = 'cond')
fit = getPosteriorFit(fit)
rhyStats = getRhythmStats(fit, features = c('13170', '12686'))
diffRhyStats = getDiffRhythmStats(fit, rhyStats)