MIDASim.setup {MIDASim}R Documentation

Fitting MIDAS model to microbiome data

Description

Midas.setup estimates parameters from a template microbiome count dataset for downstream data simulation.

Usage

MIDASim.setup(otu.tab, n.break.ties = 100, mode = "nonparametric")

Arguments

otu.tab

Numeric matrix of template microbiome count dataset. Rows are samples, columns are taxa.

n.break.ties

Number of replicates to break ties when ranking relative abundances. Defaults to 100.

mode

A character indicating the modeling approach for relative abundances. If 'parametric', a parametric model involving fitting a generalized gamma distribution is used. If 'nonparametric', the nonparametric approach involving quantile matching is applied. Note that a parametric model is required if library sizes or characteristics of taxa will be modified. Defaults to 'nonparametric'.

Value

Returns a list that has components:

mat01

Presence-absence matrix of the template data.

lib.size

Observed library sizes of the template data.

n.taxa

Number of taxa in the template data.

n.sample

Sample size in the template data.

ids

Taxa ids present in all samples in the template.

tetra.corr

Estimated tetrachoric correlation of the presence-absence matrix of the template.

corr.rel.corrected

Estimated Pearson correlation of relative abundances, transformed from Spearman's rank correlation.

sample.1.prop

Proportion of non-zero cells for each subject.

taxa.1.prop

Proportion of non-zeros for each taxon.

mean.rel.abund

Observed mean relative abundances of each taxon.

rel.abund.1

Observed non-zero relative abundances of each taxon.

taxa.names

Names of taxa in the template.

Author(s)

Mengyu He

Examples


data("throat.otu.tab")
  otu.tab = throat.otu.tab[,colSums(throat.otu.tab>0)>1]

  # use nonparametric model
  fitted = MIDASim.setup(otu.tab)

  # use parametric model
  fitted = MIDASim.setup(otu.tab, mode = 'parametric')



[Package MIDASim version 2.0 Index]