Description Usage Arguments Details Value See Also Examples
Run spline models and test for DE of contrasts.
1 2 3 4 5 6 7 8 | ## S4 method for signature 'Moanin'
DE_timecourse(
object,
contrasts,
center = FALSE,
statistic = c("ftest", "lrt"),
use_voom_weights = TRUE
)
|
object |
An object of class |
contrasts |
Contrasts, either provided as a vector of strings, or a
matrix of contrasts coefficients obtained using
|
center |
boolean, whether to center the data matrix |
statistic |
Which test statistic to use, a likelihood ratio statistic or a F-test. |
use_voom_weights |
boolean, optional, default: TRUE. Whether to use voom weights. See details. |
The implementation of the spline fit and the calculation of p-values
was based on code from edge
, and expanded to enable
handling of comparisons of groups via contrasts. The code assumes that the Moanin
object was created via either a formula or a basis where a different spline was fit for each group_variable
and thus the contrasts are comparisons of those spline fits. If the Moanin
object was created via user-provided basis matrix or formula, then the user should take a great deal of caution in using this code, as the degrees of freedom for the tests of significance cannot be verified to be correct.
If use_voom_weights=TRUE
, then before fitting splines to each gene,
voom weights are calculated from assay(object)
:
1 2 3 4 |
The design matrix for the voom weights is based on the formula
~Group + Timepoint +0
where Group and Timepoint are replaced with the user-defined values where appropriate.
These weights are given to the lm.fit
which fits the spline coefficients.
This workflow assumes that the input to the Moanin
object were counts.
If the user set log_transform=TRUE
in the creation of the
Moanin
object, the splines will be fit to the log of the input data,
and not directly to the input data. This is independent of whether the user
chooses use_voom_weights
.
A data.frame
with two columns for each of the contrasts given
in contrasts
, corresponding to the raw p-value of the contrast for
that gene (_pval
) and the adjusted p-value (_qval
). The
adjusted p-values are FDR-adjusted based on the Benjamini-Hochberg method,
as implemented in p.adjust
. The adjustment is done
across all p-values for all contrasts calculated.
makeContrasts
, create_moanin_model
,
DE_timepoints
, edge
1 2 3 4 5 | data(exampleData)
moanin <- create_moanin_model(data=testData, meta=testMeta)
deTimecourse=DE_timecourse(moanin,
contrasts="K-C", use_voom_weights=FALSE)
head(deTimecourse)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.