Title: A distance-based kernel association test based on the generalized linear mixed model
Version: 1.2
Date: 2020-02-27
Author: Hyunwook Koh
Maintainer: Hyunwook Koh hkoh7@jhu.edu
Description: This sofware package provides facilities for GLMM-MiRKAT/aGLMM-MiRKAT which tests the association betweem microbial community composition and a host trait of interest for correlated (e.g., family-based or longitudinal) microbiome studies. For the host trait of interest, continuous (e.g., body mass index), binary (e.g., disease status, treatment/placebo) or Poisson (e.g., number of tumors/treatments) traits can be handled.
NeedsCompilation: No
Depends: R(>= 3.4.1)
Imports: CompQuadForm, dirmult, ecodist, GUniFrac, lme4, MASS, Matrix, permute, phyloseq
License: GPL-2
URL: https://github.com/hk1785/GLMM-MiRKAT
If you have any problems for using this R package, please report in Issues (https://github.com/hk1785/GLMM-MiRKAT/issues) or email Hyunwook Koh (hkoh@jhu.edu).
GLMMMiRKAT
library(devtools)
install_github("hk1785/GLMM-MiRKAT", force=T)
Please make suere if you have the most recent software version.
library(GLMMMiRKAT)
sessionInfo()
phyloseq
source("https://bioconductor.org/biocLite.R")
biocLite("phyloseq")
CompQuadForm
install.packages("CompQuadForm")
devtools
install.packages("devtools")
ecodist
install.packages("ecodist")
GUniFrac
install.packages("GUniFrac")
lme4
install.packages("lme4")
MASS
install.packages("MASS")
Matrix
install.packages("Matrix")
permute
install.packages("permute")
library(phyloseq)
URL: https://joey711.github.io/phyloseq/
This R package includes two core functions, Kernels and GLMMMiRKAT. Please find the details below.
This function creates kernel matrices based on ecological distance measures.
Kernels(otu.tab, tree)
Import requisite R packages
library(GLMMMiRKAT)
library(CompQuadForm)
library(dirmult)
library(ecodist)
library(GUniFrac)
library(lme4)
library(MASS)
library(Matrix)
library(permute)
library(phyloseq)
Import example microbiome data
data(nor.phy)
Rarefy the microbiome data using phyloseq::rarefy_even_depth to control differing total reads per sample (recommended).
set.seed(100)
nor.phy <- rarefy_even_depth(nor.phy, rngseed=TRUE)
otu.tab <- otu_table(nor.phy)
tree <- phy_tree(nor.phy)
Create kernel matrices
Kernels(otu.tab, tree)
This function tests the association betweem microbial community composition and a host trait of interest based on correlated (e.g., family-based or longitudinal) microbiome studies. For the host trait of interest, continuous (e.g., body mass index), binary (e.g., disease status, treatment/placebo) or Poisson (e.g., number of tumors/treatments) traits can be handled.
GLMMMiRKAT(y, cov = NULL, id, time.pt = NULL, Ks, model, slope = FALSE, n.perm = 5000)
$ItembyItem - A vector of the estimated p-values for the item-by-item GLMM-MiRKAT analyses
$aGLMMMiRKAT - The estimated p-value for the adaptive GLMM-MiRKAT (aGLMM-MiRKAT) analysis
Import requisite R packages
library(GLMMMiRKAT)
library(CompQuadForm)
library(dirmult)
library(ecodist)
library(GUniFrac)
library(lme4)
library(MASS)
library(Matrix)
library(permute)
library(phyloseq)
Import example microbiome data with continuous traits
data(nor.phy)
Rarefy the microbiome data using phyloseq::rarefy_even_depth to control differing total reads per sample (recommended).
set.seed(100)
nor.phy <- rarefy_even_depth(nor.phy, rngseed=TRUE)
Extract microbiome and meta information
otu.tab <- otu_table(nor.phy)
tree <- phy_tree(nor.phy)
meta <- sample_data(nor.phy)
y <- meta$y
id <- meta$id
x1 <- meta$x1
x2 <- meta$x2
covs <- as.data.frame(cbind(x1,x2))
covs[,2] <- as.factor(covs[,2])
# 'as.factor()' is needed for categorical covariates.
Create kernel matrices
Ks <- Kernels(otu.tab, tree)
Run GLMM-MiRKAT
GLMMMiRKAT(y, cov=covs, id=id, Ks=Ks, model="gaussian")
Import requisite R packages
library(GLMMMiRKAT)
library(CompQuadForm)
library(dirmult)
library(ecodist)
library(GUniFrac)
library(lme4)
library(MASS)
library(Matrix)
library(permute)
library(phyloseq)
Import example microbiome data with binary traits
data(bin.phy)
Rarefy the microbiome data using phyloseq::rarefy_even_depth to control differing total reads per sample (recommended).
set.seed(100)
bin.phy <- rarefy_even_depth(bin.phy, rngseed=TRUE)
Extract microbiome and meta information
otu.tab <- otu_table(bin.phy)
tree <- phy_tree(bin.phy)
meta <- sample_data(bin.phy)
y <- meta$y
id <- meta$id
x1 <- meta$x1
x2 <- meta$x2
covs <- as.data.frame(cbind(x1,x2))
covs[,2] <- as.factor(covs[,2])
# 'as.factor()' is needed for categorical covariates.
Create kernel matrices
Ks <- Kernels(otu.tab, tree)
Run GLMM-MiRKAT
GLMMMiRKAT(y, cov=covs, id=id, Ks=Ks, model="binomial")
Import requisite R packages
library(GLMMMiRKAT)
library(CompQuadForm)
library(dirmult)
library(ecodist)
library(GUniFrac)
library(lme4)
library(MASS)
library(Matrix)
library(permute)
library(phyloseq)
Import example microbiome data with Poisson traits
data(pos.phy)
Rarefy the microbiome data using phyloseq::rarefy_even_depth to control differing total reads per sample (recommended).
set.seed(100)
pos.phy <- rarefy_even_depth(pos.phy, rngseed=TRUE)
Extract microbiome and meta information
otu.tab <- otu_table(pos.phy)
tree <- phy_tree(pos.phy)
meta <- sample_data(pos.phy)
y <- meta$y
id <- meta$id
x1 <- meta$x1
x2 <- meta$x2
covs <- as.data.frame(cbind(x1,x2))
covs[,2] <- as.factor(covs[,2])
# 'as.factor()' is needed for categorical covariates.
Create kernel matrices
Ks <- Kernels(otu.tab, tree)
Run GLMM-MiRKAT
GLMMMiRKAT(y, cov=covs, id=id, Ks=Ks, model="poisson")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.