est_params_from_reference: Estimate ZINB parameters from reference data

Description Usage Arguments Value Examples

View source: R/gen_zinb.R

Description

The observations in the reference dataset should be as homogeneous as possible. For example, we should not expect differential expression or differential connectivity of genes within the sample. If the data are heterogeneous, the estimation of the parameters may be unreliable.

Usage

1

Arguments

reference

Either a vector or data.frame of counts from a reference gene expression profile. If a data.frame is provided, each column should correspond to a gene.

verbose

Boolean indicator for message output.

Value

Returns a list containing a matrix of parameter estimates 'size', 'mu', and 'rho' for each gene in the reference, and the reference dataset used. The parameter matrix can be used in gen_zinb.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# The internal reference dataset already contains ZINB parameter estimates,
# so running est_params_from_reference() is not necessary. To simulate 
# ZINB data from a different RNA-seq reference dataset, the data can
# be passed into gen_zinb() directly using the 'reference' argument, and 
# est_params_from_reference() will be used automatically (i.e. the user
# does not need to call this function directly).

# An example using the reference dataset
data(reference) 
# The RNA-seq dataset should have samples as rows and genes as columns:
rnaseq <- reference$rnaseq
# Estimate ZINB params for first ten genes.
params <- est_params_from_reference(rnaseq[, 1:10])$params 
# However, the previous call is not needed for simulated ZINB data.
# The RNA-seq dataset can be passed directly to `gen_zinb()`.
nw <- random_network(10)
x <- gen_zinb(20, nw, reference = rnaseq[, 1:10])$x # Pass in 'rnaseq' directly.

SeqNet documentation built on July 9, 2021, 9:08 a.m.