knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)

Travis-CI Build Status CRAN_Status_Badge lifecycle

'rdrsimulate' simulates microbial communities with a mixture of metabolic states and ribosomal amplification levels, and computes rRNA:rDNA ratios.

Installing the package

'rdrsimulate' can be installed from GitHub with the 'devtools' package:

devtools::install_github("wilkox/rdrsimulate")

Generating a simulated community

library(rdrsimulate)
comm <- generate_community(n = 1000)
comm

The generate_community function follows the approach described in Steven et al. (2017), with some modifications.

rDNA abundances (i.e. cell counts) for each OTU are drawn from a log-normal distribution with parameters μ = 0, σ = 1.

The community is randomly divided into metabolic states of dead, dormant, stationary or growing, with the proportion of each state drawn at random from a uniform distribution. The metabolic state of each OTU is independent of the OTU's rDNA abundance.

Each OTU is assigned a ribosomal amplification value, representing the number of ribosomes per cell. This value is determined by the cell's metabolic state:

The rRNA:rDNA ratio is calculated for each OTU.

Note that there are some key differences to the approach described in Steven et al. 2017:

  1. Only integer rDNA abundance are permitted (Steven et al. allowed fractional abundances)
  2. The ribosome amplification value for each metabolic state is drawn from a uniform distribution (Steven et al. selected at random one of three discrete values representing low, medium and high amplification)

Simulating a sequencing-based sampling experiment

comm <- generate_community(1000)
sample_community(comm, nDNA = 500, nRNA = 500)

sample_community simulates a sequencing-based sampling experiment on a microbial community. The number of 'reads' for both rDNA genes and rRNA transcripts are required arguments. The resulting tibble will include all OTUs in the input community, even those that did not yield a sequence, and will mark 'phantom' OTUs i.e. those that yielded a rRNA sequence but not an rDNA sequence. This allows the effects of partial sampling to be explored.

References

Steven, B., Hesse, C., Soghigian, J., Gallegos-Graves, L. V. & Dunbar, J. Simulated rRNA/DNA Ratios Show Potential To Misclassify Active Populations as Dormant. Appl Env Microbiol 83, e00696–17–11 (2017).



wilkox/rdrsimulate documentation built on May 13, 2019, 12:40 p.m.