DE_timepoints {moanin} | R Documentation |
Fit weekly differential expression analysis
Creates pairwise contrasts for all timepoints
## S4 method for signature 'Moanin' DE_timepoints(object, contrasts, use_voom_weights = TRUE) ## S4 method for signature 'Moanin' create_timepoints_contrasts(object, group1, group2)
object |
An object of class |
contrasts |
Contrasts, either provided as a vector of strings, or a
matrix of contrasts coefficients obtained using
|
use_voom_weights |
boolean, optional, default: TRUE. Whether to use voom weights. See details. |
group1 |
First group to consider in making contrasts, character value
that must match a value contained in |
group2 |
Second group to consider in making contrasts, character value
that must match a value contained in |
If use_voom_weights=TRUE
, the data is given directly to limma
via assay(object)
. The specific series of
calls is:
y <- edgeR::DGEList(counts=assay(object)) y <- edgeR::calcNormFactors(y, method="upperquartile") v <- limma::voom(y, design, plot=FALSE) v <- limma::lmFit(v)
If the user set log_transform=TRUE
in the creation of the
Moanin
object, this will not have an impact in the analysis if
use_voom_weights=TRUE
. Only if use_voom_weights=FALSE
will
this matter, in which case the log of the input data will be given to a
regular call to limma
:
y<-get_log_data(object) v <- limma::lmFit(y, design)
create_timepoints_contrasts
creates the needed contrasts for
comparing two groups for every timepoint in the format needed for
DE_timepoints
(i.e. makeContrasts
, to which the
contrasts are ultimately passed). The time points are determined by the
meta data in the moanin_object
provided by the user.
A data.frame
with three columns for each of the contrasts
given in contrasts
, corresponding to the raw p-value of the contrast
for that gene (_pval
), the adjusted p-value (_qval
), and the
estimate of log-fold-change (_lfc
). 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.
create_timepoints_contrasts
: a character vector with each
element of the vector corresponding to a contrast to be compared.
data(exampleData) moanin <- create_moanin_model(data=testData, meta=testMeta) contrasts <- create_timepoints_contrasts(moanin,"C", "K") head(contrasts) deTimepoints=DE_timepoints(moanin, contrasts=contrasts, use_voom_weights=FALSE) head(deTimepoints)