DA.lma: Linear regression - Multiplicative zero-correction and...

View source: R/DA.lma.R

DA.lmaR Documentation

Linear regression - Multiplicative zero-correction and additive log-ratio normalization.

Description

Apply linear regression for multiple features with one predictor. Mixed-effect model is used when a paired argument is included, with the paired variable as a random intercept. Note: Last feature in the data is used as reference for the log-ratio transformation.

Usage

DA.lma(
  data,
  predictor,
  paired = NULL,
  covars = NULL,
  out.all = NULL,
  p.adj = "fdr",
  delta = 1,
  coeff = 2,
  allResults = FALSE,
  ...
)

Arguments

data

Either a matrix with counts/abundances, OR a phyloseq object. If a matrix/data.frame is provided rows should be taxa/genes/proteins and columns samples

predictor

The predictor of interest. Either a Factor or Numeric, OR if data is a phyloseq object the name of the variable in sample_data(data) in quotation

paired

For paired/blocked experimental designs. Either a Factor with Subject/Block ID for running paired/blocked analysis, OR if data is a phyloseq object the name of the variable in sample_data(data) in quotation

covars

Either a named list with covariables, OR if data is a phyloseq object a character vector with names of the variables in sample_data(data)

out.all

If TRUE will output results and p-values from anova. If FALSE will output results for 2. level of the predictor. If NULL (default) set as TRUE for multi-class predictor and FALSE otherwise

p.adj

Character. P-value adjustment. Default "fdr". See p.adjust for details

delta

Numeric. Pseudocount for zero-correction. Default 1

coeff

Integer. The p-value and log2FoldChange will be associated with this coefficient. Default 2, i.e. the 2. level of the predictor.

allResults

If TRUE will return raw results from the lm/lme function

...

Additional arguments for the lm/lme functions

Value

A data.frame with with results.

Examples

# Creating random count_table and predictor
set.seed(4)
mat <- matrix(rnbinom(1500, size = 0.1, mu = 500), nrow = 100, ncol = 15)
rownames(mat) <- 1:100
pred <- c(rep("A", 5), rep("B", 5), rep("C", 5))

# Running linear model on each feature
res <- DA.lma(data = mat, predictor = pred)

Russel88/DAtest documentation built on March 24, 2022, 3:50 p.m.