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.342 0.005 0.346#>#>#> user system elapsed #> 0.093 0.000 0.093#>#>#>#>#>#> user system elapsed #> 0.246 0.004 0.250#>#>#> user system elapsed #> 0.058 0.000 0.058#>#>#>#>#>#> user system elapsed #> 0.217 0.000 0.217#>#>#> user system elapsed #> 0.052 0.000 0.052#>#>#>#>#>#> A Params object of class ZINBParams #> Parameters can be (estimable) or [not estimable], 'Default' or 'NOT DEFAULT' #> Secondary parameters are usually set during simulation #> #> Global: #> (Genes) (CELLS) [Seed] #> 100 20 121054 #> #> 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.459768349311904, 1.6211941766607, -0.223102897001514, 0.0429480000462582,... 4.26299871296772, 4.29178877663662, 4.44953734970852, 3.86260699714574,... 0 x 100 matrix 1.90227701103766, -6.94250263618026, -1.07944947119589, -0.430739492373279,... -0.983739818961789, -1.35075675357218, -1.232854483926, -1.26060100804175,... 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 #>