README.md

R package: GLMMMiRKAT

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

Reference

Troubleshooting Tips

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).

Installation

GLMMMiRKAT

library(devtools)
install_github("hk1785/GLMM-MiRKAT", force=T)

Please make suere if you have the most recent software version.

library(GLMMMiRKAT)
sessionInfo()

Prerequites

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")

Data format

library(phyloseq)
URL: https://joey711.github.io/phyloseq/

Manual

This R package includes two core functions, Kernels and GLMMMiRKAT. Please find the details below.

:mag: Kernels

Description

This function creates kernel matrices based on ecological distance measures.

Usage

Kernels(otu.tab, tree)

Arguments

References

Example

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)

:mag: GLMMMiRKAT

Description

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.

Usage

GLMMMiRKAT(y, cov = NULL, id, time.pt = NULL, Ks, model, slope = FALSE, n.perm = 5000)

Arguments

Values

$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

References

Example 1. Continuous (e.g., body mass index) traits

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")

Example 2. Binary (e.g., disease status, treatment/placebo) traits

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")

Example 3. Poisson (e.g., number of tumors/treatments) traits

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")


hk1785/GLMM-MiRKAT documentation built on Feb. 29, 2020, 6:06 p.m.