Learn R Programming

seqgendiff (version 1.1.1)

seqgen_2group: Theoretical sequence simulation in the two-group model.

Description

Generate a matrix of RNA-seq counts from a theoretical negative-binomial model. This is in the special case of the two-group model.

Usage

seqgen_2group(ngene, nsamp, dispvec = rep(0.1, times = ngene),
  prop_null = 1, signal_fun = stats::rnorm, signal_params = list(mean
  = 0, sd = 1), intercept_fun = stats::rnorm,
  intercept_params = list(mean = 4, sd = 2), libvec = rep(1, times =
  nsamp), group_prop = 0.5, design_sv = NULL, coef_sv = NULL)

Arguments

ngene

The number of genes.

nsamp

The number of samples.

dispvec

A numeric vector of dispersions.

prop_null

The proportion of genes that are null.

signal_fun

The signal function for the non-null genes. A function that takes at least the argument n and returns n draws. Additional parameters may be passed through signal_params.

signal_params

Additional arguments to be passed to signal_fun.

intercept_fun

The function for the intercept coefficients. A function that takes at least the argument n and returns n draws. Additional parameters may be passed through intercept_params.

intercept_params

Additional arguments to be passed to intercept_fun.

libvec

A vector of library size multiplicative factors (not on the log2 scale).

group_prop

The proportion of samples to be placed in group 1.

design_sv

Optional numeric design matrix of surrogate variables. The rows index the samples and the columns index the surrogate variables.

coef_sv

Optional numeric matrix of coefficients of the surrogate variables. The rows index the genes and the columns index the surrogate variables.

Value

A list object with some or all of the following elements:

mat

A matrix of RNA-seq counts. The rows index the genes and the columns index the samples.

designmat

The user-provided designmat.

coefmat

The user-provided coefmat.

sv

The user-provided design_sv.

coef_sv

The user-provided coef_sv.

Details

You should be using thin_2group instead of this. If you must simulate from the theoretical model, I would recommend trying out the powsimR package (https://github.com/bvieth/powsimR) from Vieth et al. (2017).

References

  • Vieth, Beate, Christoph Ziegenhain, Swati Parekh, Wolfgang Enard, and Ines Hellmann. "powsimR: power analysis for bulk and single cell RNA-seq experiments." Bioinformatics 33, no. 21 (2017): 3486-3488.

See Also

makeExampleDESeqDataSet

For a very similar function from the DESeq2 package.

seqgen_diff

For the underlying sequence simulation function.