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 initalization. |
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.
data("sc_example_counts") params <- zinbEstimate(sc_example_counts)#>#>#>#>#>#>#>#>#>#>#> user system elapsed #> 8.840 0.506 9.391#>#>#> user system elapsed #> 0.573 0.041 0.617#>#>#>#>#>#> user system elapsed #> 6.414 0.345 6.790#>#>#> user system elapsed #> 0.616 0.025 0.643#>#>#>#>#>#> user system elapsed #> 5.893 0.319 6.260#>#>#> user system elapsed #> 0.616 0.022 0.640#>#>#>#>#>#> user system elapsed #> 4.808 0.251 5.075#>#>#> user system elapsed #> 0.600 0.013 0.615#>#>#>#>#>#> user system elapsed #> 4.661 0.251 4.938#>#>#> user system elapsed #> 0.613 0.021 0.636#>#>#>#>#>#> user system elapsed #> 4.363 0.219 4.594#>#>#> user system elapsed #> 0.520 0.019 0.540#>#>#>#>#>params#> A Params object of class ZINBParams #> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT'. #> #> Global: #> (GENES) (CELLS) [Seed] #> 1973 40 80751 #> #> 1 additional parameters #> #> Model: #> ZinbModel with 1973 features, 40 samples, 0 latent factors and 4027 parameters #> #> Model Design: #> (SAMPLES) (GENES) #> 1, 1, 1, 1,... 1, 1, 1, 1,... #> #> Model Offsets: #> (MU) (PI) #> 40 x 1973 matrix 40 x 1973 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) #> 40 x 0 matrix #> #> Model Coefficients: #> (SAMPLE MU) #> 2.92563256904469, 2.4987993436997, 2.58202880827954, 1.97900548945704,... #> (GENE MU) #> 3.47522026895399, 2.47301357124798, 3.24285373024315, 3.18809031726884,... #> (Latent Mu) #> 0 x 1973 matrix #> (SAMPLE PI) #> -0.71252392787508, -2.22126441075684, -0.171737848601069, -1.44324267217097,... #> (GENE PI) #> -0.0394934045621859, 0.702003614655306, 0.522586914345766, 0.331946546846606,... #> (Latent Pi) #> 0 x 1973 matrix #> #> Model Regularisation: #> (Sample Mu) (GENE MU) (Sample Pi) (GENE PI) #> 1 49.325 1 49.325 #> (LATENT) (Latent coeffs) (ZETA) (Logit) #> 49.325 1 1973 0.001 #>