linda | R Documentation |
The function implements a simple, robust and highly scalable approach to tackle the compositional effects in differential abundance analysis. It fits linear regression models on the centered log2-ratio transformed data, identifies a bias term due to the transformation and compositional effect, and corrects the bias using the mode of the regression coefficients. It could fit mixed-effect models.
linda(
otu.tab,
meta,
formula,
type = "count",
adaptive = TRUE,
imputation = FALSE,
pseudo.cnt = 0.5,
corr.cut = 0.1,
p.adj.method = "BH",
alpha = 0.05,
prev.cut = 0,
lib.cut = 1,
winsor.quan = NULL,
n.cores = 1
)
otu.tab |
data frame or matrix representing observed OTU table. Row: taxa; column: samples.
NAs are not expected in OTU tables so are not allowed in function |
meta |
data frame of covariates. The rows of |
formula |
character. For example: |
type |
character; the type of |
adaptive |
TRUE or FALSE. The default is TRUE. If TRUE, the parameter |
imputation |
TRUE or FALSE. The default is FALSE. If TRUE, then we use the imputation approach, i.e., zeros in |
pseudo.cnt |
a positive real value. The default is 0.5. If |
corr.cut |
a real value between 0 and 1; significance level of correlations between the sequencing depth and explanatory variables. The default is 0.1. |
p.adj.method |
character; p-value adjusting approach. See R function |
alpha |
a real value between 0 and 1; significance level of differential abundance. The default is 0.05. |
prev.cut |
a real value between 0 and 1; taxa with prevalence (percentage of nonzeros) less than prev.cut are excluded. The default is 0 (no taxa will be excluded). |
lib.cut |
a non-negative real value; samples with less than |
winsor.quan |
a real value between 0 and 1; winsorization cutoff (quantile) for |
n.cores |
a positive integer. If |
A list with the elements
variables |
A vector of variable names of all fixed effects in |
bias |
numeric vector; each element corresponds to one variable in |
output |
a list of data frames with columns 'baseMean', 'log2FoldChange', 'lfcSE', 'stat', 'pvalue', 'padj', 'reject',
'df';
|
covariance |
a list of data frames; the data frame records the covariances between a certain regression coefficient and other coefficients;
|
otu.tab.use |
the OTU table used in the abundance analysis (the |
meta.use |
the meta data used in the abundance analysis (only variables in |
wald |
a list for use in Wald test. If the fitting model is a linear model, then it includes
If the fitting model is a linear mixed-effect model, then it includes
|
Huijuan Zhou huijuanzhou2019@gmail.com Jun Chen Chen.Jun2@mayo.edu Xianyang Zhang zhangxiany@stat.tamu.edu
Huijuan Zhou, Kejun He, Jun Chen, and Xianyang Zhang. LinDA: Linear Models for Differential Abundance Analysis of Microbiome Compositional Data.
#install package "phyloseq" for importing "smokers" dataset
ind <- smokers$meta$AIRWAYSITE == 'Throat'
otu.tab <- as.data.frame(smokers$otu[, ind])
meta <- cbind.data.frame(Smoke = factor(smokers$meta$SMOKER[ind]),
Sex = factor(smokers$meta$SEX[ind]),
Site = factor(smokers$meta$SIDEOFBODY[ind]),
SubjectID = factor(smokers$meta$HOST_SUBJECT_ID[ind]))
ind1 <- which(meta$Site == 'Left')
res.left <- linda(otu.tab[, ind1], meta[ind1, ], formula = '~Smoke+Sex', alpha = 0.1,
prev.cut = 0.1, lib.cut = 1000, winsor.quan = 0.97)
ind2 <- which(meta$Site == 'Right')
res.right <- linda(otu.tab[, ind2], meta[ind2, ], formula = '~Smoke+Sex', alpha = 0.1,
prev.cut = 0.1, lib.cut = 1000, winsor.quan = 0.97)
rownames(res.left$output[[1]])[which(res.left$output[[1]]$reject)]
rownames(res.right$output[[1]])[which(res.right$output[[1]]$reject)]
linda.obj <- linda(otu.tab, meta, formula = '~Smoke+Sex+(1|SubjectID)', alpha = 0.1,
prev.cut = 0.1, lib.cut = 1000, winsor.quan = 0.97)
linda.plot(linda.obj, c('Smokey', 'Sexmale'),
titles = c('Smoke: n v.s. y', 'Sex: female v.s. male'), alpha = 0.1, lfc.cut = 1,
legend = TRUE, directory = NULL, width = 11, height = 8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.