micro_MiRKAT: A function to run MiRKAT within the tidy_micro format

Description Usage Arguments Details Value References Examples

View source: R/micro_MiRKAT.R

Description

Test for association between microbiome composition and a continuous or dichotomous outcome by incorporating phylogenetic or nonphylogenetic distance between different microbiomes

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
micro_MiRKAT(
  micro_set,
  outcome,
  ...,
  KS,
  out_type,
  p_method = "davies",
  nperm = 9999,
  seed = NULL
)

Arguments

micro_set

A tidy_micro data set

outcome

The outcome of interset

...

Covariates you'd like to include. This is optional

KS

Your phylogenetic or nonphylogenetic distance matrices of interest. Can be either a single matrix or a list of matrices

out_type

An indicator of the outcome type. "C" for the continuous outcome and "D" for the dichotomous outcome

p_method

A method to compute the kernel specific p-value (Default= "davies"). "davies" represents an exact method that computes the p-value by inverting the characteristic function of the mixture chisq. We adopt an exact variance component tests because most of the studies concerning microbiome compositions have modest sample size. "moment" represents an approximation method that matches the first two moments. "permutation" represents a permutation approach for p-value calculation

nperm

The number of permutations if method = "permutation" or when multiple kernels are considered. If method = "davies" or "moment", nperm is ignored

Details

The original MiRKAT function requires numerical matrices or vectors for both your outcome and covariates. This will be done automatically by micro_MiRKAT for your supplied outcome and covariates.

Ks should be a list of n by n matrices or a single matrix. If you have distance metric from metagenomic data, each kernel can be constructed through function D2K. Each kernel can also be constructed through other mathematical approaches. Missing data is not permitted. Please remove all individuals with missing y, X, Ks prior to analysis.

Parameter "method" only concerns with how kernel specific p-values are generated. When Ks is a list of multiple kernels, omnibus p-value is computed through permutation from each individual p-values, which are calculated through method of choice

Value

p-value from each candidate kernel and/or omnibus p-value by considering multiple candidate kernels

References

MiRKAT

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(phy); data(cla); data(ord); data(fam); data(met)

otu_tabs <- list(Phylum = phy, Class = cla, Order = ord, Family = fam)
set <- tidy_micro(otu_tabs = otu_tabs, meta = met) \
filter(day == 7) ## Only including first week

## Bray-Curtis beta diversity
bray <- set \

## Single dissimilarity matrix
set \

## Morisita-Horn beta diversity
horn <- set \

## Omnibus test
set \

CharlieCarpenter/tidy.micro documentation built on Jan. 19, 2020, 6:28 p.m.