This helper functions performs the differential expression analysis with the voom
method from the limma
package (via limma::voom()
, limma::lmFit()
and limma::eBayes()
)
for given counts in a AnyHermesData object and a corresponding design
matrix.
Arguments
- object
(
AnyHermesData
)
input.- design
(
matrix
)
design matrix.- ...
additional arguments internally passed to
limma::eBayes()
(robust
,trend
,proportion
,winsor.tail.p
,stdev.coef.lim
).
Value
A data frame with columns log2_fc
(estimated log2 fold change),
stat
(moderated t-statistic), p_val
(raw p-value), adj_p_pval
(Benjamini-Hochberg adjusted p-value).
Examples
object <- hermes_data
# Create the design matrix corresponding to the factor of interest.
design <- model.matrix(~SEX, colData(object))
# Then perform the differential expression analysis.
result <- h_diff_expr_voom(object, design)
head(result)
#> log2_fc stat p_val adj_p_val
#> GeneID:8000 -2.3200712 -4.239244 0.0004209192 0.9118348
#> GeneID:51227 -1.0467295 -4.032550 0.0006788432 0.9118348
#> GeneID:344558 1.6896266 3.824046 0.0010993677 0.9118348
#> GeneID:51575 -0.7760844 -3.746293 0.0013155805 0.9118348
#> GeneID:151242 -3.4358998 -3.570103 0.0019741997 0.9118348
#> GeneID:8904 -0.6100354 -3.542864 0.0021017199 0.9118348
# Sometimes we might want to specify method details.
result2 <- h_diff_expr_voom(object, design, trend = TRUE, robust = TRUE)
head(result2)
#> log2_fc stat p_val adj_p_val
#> GeneID:8000 -2.3200712 -3.848050 0.0008857274 0.8995289
#> GeneID:51227 -1.0467295 -3.724654 0.0011933484 0.8995289
#> GeneID:344558 1.6896266 3.684191 0.0013155791 0.8995289
#> GeneID:51575 -0.7760844 -3.498308 0.0020551283 0.8995289
#> GeneID:151242 -3.4358998 -3.441687 0.0023525055 0.8995289
#> GeneID:123036 2.9002547 3.431263 0.0024329189 0.8995289