mpralm: Linear models for differential analysis of MPRA data

View source: R/fit.R

mpralmR Documentation

Linear models for differential analysis of MPRA data

Description

Fits weighted linear models to test for differential activity in MPRA data.

Usage

mpralm(object, design, aggregate = c("mean", "sum", "none"),
       normalize = TRUE, normalizeSize = 10e6,
       block = NULL, model_type = c("indep_groups", "corr_groups"),
       plot = TRUE, endomorphic = FALSE, ...)

Arguments

object

An object of class MPRASet.

design

Design matrix specifying comparisons of interest. The number of rows of this matrix should equal the number of columns in object. The number of columns in this design matrix has no constraints and should correspond to the experimental design.

aggregate

Aggregation method over barcodes: "mean" to use the average of barcode-specific log ratios, "sum" to use the log ratio of summed RNA and DNA counts, "none" to perform no aggregation (counts have already been summarized over barcodes).

normalize

If TRUE, perform total count normalization before model fitting.

normalizeSize

If normalizing, the target library size (default is 10e6).

block

A vector giving the sample designations of the columns of object. The default, NULL, indicates that all columns are separate samples.

model_type

Indicates whether an unpaired model fit ("indep_groups") or a paired mixed-model fit (("corr_groups")) should be used.

plot

If TRUE, plot the mean-variance relationship.

endomorphic

If TRUE, return the same class as the input, i.e. an object of class MPRASet.

...

Further arguments to be passed to lmFit for obtaining residual standard deviations used in estimating the mean-variance relationship.

Details

Using method_type = "corr_groups" use the duplicateCorrelation function from the limma package to estimate the intra-replicate correlation of log-ratio values.

Value

An object of class MArrayLM resulting from the eBayes function.

If endomorphic = TRUE, then an MPRASet is returned, with the output of topTable added to the rowData, and the MArrayLM results added as an attribute "MArrayLM".

References

Myint, Leslie, Dimitrios G. Avramopoulos, Loyal A. Goff, and Kasper D. Hansen. Linear models enable powerful differential activity analysis in massively parallel reporter assays. BMC Genomics 2019, 209. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/s12864-019-5556-x")}.

Law, Charity W., Yunshun Chen, Wei Shi, and Gordon K. Smyth. Voom: Precision Weights Unlock Linear Model Analysis Tools for RNA-Seq Read Counts. Genome Biology 2014, 15:R29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/gb-2014-15-2-r29")}.

Smyth, Gordon K., Joelle Michaud, and Hamish S. Scott. Use of within-Array Replicate Spots for Assessing Differential Expression in Microarray Experiments. Bioinformatics 2005, 21 (9): 2067-75. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/bti270")}.

Examples

data(mpraSetAggExample)
design <- data.frame(intcpt = 1,
                     episomal = grepl("MT", colnames(mpraSetAggExample)))
mpralm_fit <- mpralm(object = mpraSetAggExample, design = design,
                     aggregate = "none", normalize = TRUE, 
                     model_type = "indep_groups", plot = FALSE)
toptab <- topTable(mpralm_fit, coef = 2, number = Inf)
head(toptab)

hansenlab/mpra documentation built on Sept. 15, 2024, 4:11 p.m.