SimulateOTU: SimulateOTU

View source: R/SimulateOTU.R

SimulateOTUR Documentation

SimulateOTU

Description

We generate the OTUs count table simulated based on the Dirichlet-multinomial model according to real data.

Usage

SimulateOTU(data, nSam, parameters, mu, size)

Arguments

data

Real data.

nSam

Sample size.

parameters

The estimated parameter based on a real microbiome data, including OTU proportions and overdispersion parameter.

mu

The mean of the negative binomial distribution.

size

The size of the negative binomial distribution.

Value

OTU: OTU counts table simulated based on real data.

Examples

#Simulated OTUs
library(dirmult)
data("throat.otu.tab", package = "MiSPU")
nOTU = 100
otu_sum <- apply(throat.otu.tab, 2, sum)
throat.otu.tab.100 <- throat.otu.tab[, order(otu_sum, decreasing = TRUE)[1:nOTU]]
parameters <- dirmult(throat.otu.tab.100)
otu.tab <- SimulateOTU(throat.otu.tab.100, nSam = 50, parameters=parameters, mu = 1000, size = 25)


xpjiang-ccnu/GEEMiHC documentation built on May 15, 2023, 7:01 a.m.