DE_timepoints {moanin}R Documentation

Fit weekly differential expression analysis

Description

Fit weekly differential expression analysis

Creates pairwise contrasts for all timepoints

Usage

## S4 method for signature 'Moanin'
DE_timepoints(object, contrasts, use_voom_weights = TRUE)

## S4 method for signature 'Moanin'
create_timepoints_contrasts(object, group1, group2)

Arguments

object

An object of class Moanin, an object containing all related information for time course data and the splines model that will be used (if applicable). See create_moanin_model for more details.

contrasts

Contrasts, either provided as a vector of strings, or a matrix of contrasts coefficients obtained using makeContrasts from the package limma. If given as a character string, will be passed to makeContrasts to be converted into such a matrix.

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 moanin_model$meta.

group2

Second group to consider in making contrasts, character value that must match a value contained in moanin_model$meta.

Details

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.

Value

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.

See Also

makeContrasts

Examples

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)

[Package moanin version 1.0.0 Index]