create_read_numbers: Generate a simulated data set based on known model parameters

Description Usage Arguments Value Author(s) Examples

View source: R/create_read_numbers.R

Description

Generate a simulated data set based on known model parameters

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
create_read_numbers(
  mu,
  fit,
  p0,
  m = NULL,
  n = NULL,
  mod = NULL,
  beta = NULL,
  seed = NULL
)

Arguments

mu

Baseline mean expression for negative binomial model

fit

Fitted relationship between log mean and log size

p0

A vector of the probabilities a count is zero

m

Number of genes/transcripts to simulate (not necessary if mod, beta are specified)

n

Number of samples to simulate (not necessary if mod, beta are specified)

mod

Model matrix you would like to simulate from without an intercept

beta

set of coefficients for the model matrix (must have same number of columns as mod)

seed

optional seed to set (for reproducibility)

Value

counts Data matrix with counts for genes in rows and samples in columns

Author(s)

Jeff Leek

Examples

1
2
3
4
5
6
7
8
  library(ballgown)
  data(bg)
  countmat = fpkm_to_counts(bg, mean_rps=400000)
  params = get_params(countmat)
  Ntranscripts = 50
  Nsamples = 10
  custom_readmat = create_read_numbers(mu=params$mu, fit=params$fit,
    p0=params$p0, m=Ntranscripts, n=Nsamples, seed=103)

alyssafrazee/polyester documentation built on Sept. 17, 2021, 8:54 a.m.