HTSSIP_sim: Simulate a HTS-SIP dataset

Description Usage Arguments Value Examples

View source: R/HTSSIP_sim.R

Description

This is a simple method for simulating high thoughput sequencing stable isotope probing datasets and is mainly used for package testing purposes. See SIPSim for more detailed and simulation pipeline.

Usage

1
2
3
HTSSIP_sim(locs, params, responseModel = "gaussian",
  countModel = "poisson", meta = NULL, sim_tree = FALSE,
  parallel = FALSE, ...)

Arguments

locs

Buoyant densities of each gradient fraction

params

A matrix of parameters for coenocliner::coenocline(). See that function's documentation for more details.

responseModel

See coenocliner::coenocline()

countModel

See coenocliner::coenocline()

meta

Data.frame object of metadata to add to sample_data table. The data.frame object must have a 'Gradient' column, which is used for joining with dplyr::left_join().

sim_tree

Simulate a tree?

parallel

Parallel processing. See .parallel option in dplyr::mdply() for more details.

...

Other parameters passed to coenocliner::coenocline()

Value

A phyloseq object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# setting parameters for tests
set.seed(2)
M = 10                                  # number of species
ming = 1.67                             # gradient minimum...
maxg = 1.78                                # ...and maximum
nfrac = 24                                 # number of gradient fractions
locs = seq(ming, maxg, length=nfrac)       # gradient locations
tol  = rep(0.005, M)                       # species tolerances
h    = ceiling(rlnorm(M, meanlog=11))    # max abundances
## creating parameter matrices for each density gradient
opt1 = rnorm(M, mean=1.7, sd=0.005)      # species optima
params1 = cbind(opt=opt1, tol=tol, h=h)  # put in a matrix
opt2 = rnorm(M, mean=1.7, sd=0.005)      # species optima
params2 = cbind(opt=opt2, tol=tol, h=h)  # put in a matrix
param_l = list(
  '12C-Con_rep1' = params1,
  '13C-Cel_rep1' = params2
)
## Not run: 
# simulating phyloseq object
physeq = HTSSIP_sim(locs, param_l)
physeq

## End(Not run)

HTSSIP documentation built on Sept. 14, 2019, 1:02 a.m.