Estimate simulation parameters for the ZINB-WaVE simulation from a real dataset.
zinbEstimate(counts, design.samples = NULL, design.genes = NULL, common.disp = TRUE, iter.init = 2, iter.opt = 25, stop.opt = 1e-04, params = newZINBParams(), verbose = TRUE, BPPARAM = SerialParam(), ...) # S3 method for SingleCellExperiment zinbEstimate(counts, design.samples = NULL, design.genes = NULL, common.disp = TRUE, iter.init = 2, iter.opt = 25, stop.opt = 1e-04, params = newZINBParams(), verbose = TRUE, BPPARAM = SerialParam(), ...) # S3 method for matrix zinbEstimate(counts, design.samples = NULL, design.genes = NULL, common.disp = TRUE, iter.init = 2, iter.opt = 25, stop.opt = 1e-04, params = newZINBParams(), verbose = TRUE, BPPARAM = SerialParam(), ...)
counts | either a counts matrix or a SingleCellExperiment object containing count data to estimate parameters from. |
---|---|
design.samples | design matrix of sample-level covariates. |
design.genes | design matrix of gene-level covariates. |
common.disp | logical. Whether or not a single dispersion for all features is estimated. |
iter.init | number of iterations to use for initialization. |
iter.opt | number of iterations to use for optimization. |
stop.opt | stopping criterion for optimization. |
params | ZINBParams object to store estimated values in. |
verbose | logical. Whether to print progress messages. |
BPPARAM | A |
... | additional arguments passes to |
ZINBParams object containing the estimated parameters.
The function is a wrapper around zinbFit
that takes
the fitted model and inserts it into a ZINBParams
object. See
ZINBParams
for more details on the parameters and
zinbFit
for details of the estimation procedure.
if (requireNamespace("zinbwave", quietly = TRUE)) { library(scater) set.seed(1) sce <- mockSCE(ncells = 20, ngenes = 100) params <- zinbEstimate(sce) params }#>#>#>#>#>#>#>#>#>#>#> user system elapsed #> 0.304 0.010 0.319#>#>#> user system elapsed #> 0.044 0.001 0.045#>#>#>#>#>#> user system elapsed #> 0.214 0.007 0.225#>#>#> user system elapsed #> 0.070 0.008 0.078#>#>#>#>#>#> user system elapsed #> 0.157 0.002 0.161#>#>#> user system elapsed #> 0.041 0.002 0.043#>#>#>#>#>#> A Params object of class ZINBParams #> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> #> Global: #> (GENES) (CELLS) [Seed] #> 100 20 848036 #> #> 1 additional parameters #> #> Model: #> ZinbModel with 100 features, 20 samples, 0 latent factors and 241 parameters #> #> Parameters of the ZinbModel #> #> Model Design: #> (SAMPLES) (Genes) #> 1, 1, 1, 1,... 1, 1, 1, 1,... #> #> Model Offsets: #> (MU) (PI) #> 20 x 100 matrix 20 x 100 matrix #> #> Model Indices: #> (Sample Mu) (Gene Mu) (Sample Pi) (Gene Pi) #> 1 1 1 1 #> #> Model Intercepts: #> (Sample Mu) (Gene Mu) (Sample Pi) (Gene Pi) #> TRUE TRUE TRUE TRUE #> #> Model Latent factors: #> (W) #> 20 x 0 matrix #> #> Model Coefficients: #> (SAMPLE MU) (GENE MU) (Latent Mu) (SAMPLE PI) (GENE PI) (Latent Pi) #> -0.459768269108686, 1.62119422809804, -0.223102757788152, 0.0429479357333727,... 4.26299872242102, 4.29178871361806, 4.44953744138558, 3.86260697728158,... 0 x 100 matrix 1.90228646100659, -6.94249109253294, -1.07943871883735, -0.430729773518204,... -0.983749678057473, -1.35076635474983, -1.23286376482938, -1.26061065393089,... 0 x 100 matrix #> #> Model Regularisation: #> (Sample Mu) (GENE MU) (Sample Pi) (GENE PI) #> 1 5 1 5 #> (LATENT) (Latent coeffs) (Zeta) (Logit) #> 5 1 100 0.001 #>