scDesign3Py.scDesign3.extract_para

scDesign3.extract_para(data: pandas.DataFrame = 'dat', new_covariate: pandas.DataFrame | None = 'newCovariate', marginal_dict: rpy2.robjects.vectors.ListVector | rpy2.rlike.container.OrdDict | dict = 'default', family_use: Literal['binomial', 'poisson', 'nb', 'zip', 'zinb', 'gaussian'] | list[str] = 'default', n_cores: int = 'default', parallelization: Literal['mcmapply', 'bpmapply', 'pbmcmapply'] = 'default', bpparam: rpy2.robjects.methods.RS4 | None = 'default', return_py: bool = 'default') rpy2.robjects.vectors.ListVector[source]

Extract the parameters of each cell’s distribution

This function generates parameter matricies which determine each cell’s distribution

Details:

The function takes the new covariate (if use) from @construct_data and marginal models from @fit_marginal.

Arguments:

data: pandas.DataFrame (default: ‘dat’)

The data used for fitting the gene marginal models. Default is ‘dat’, use the @construct_data_res, ‘dat’ output.

new_covariate: pandas.DataFrame or None (default: ‘newCovariate’)

The new covariates to simulate new gene expression data using the gene marginal models. Default is ‘newCovariate’, use the @construct_data_res, ‘newCovariate’ output.

marginal_dict: rpy2.robject.vectors.ListVector or rpy2.rlike.container.OrdDict or dict (default: ‘default’)

The result of @fit_marginal. Default is ‘default’, using the class property @fit_marginal_res.

family_use: str or list[str] (default: ‘default’)

A string or a list of strings of the marginal distribution. Must be one of ‘binomial’, ‘poisson’, ‘nb’, ‘zip’, ‘zinb’ or ‘gaussian’. Default is ‘default’, use the class property @family_use.

n_cores: int (default: ‘default’)

The number of cores to use. Default is ‘default’, use the setting when initializing.

parallelization: str (default: ‘default’)

The specific parallelization function to use. If ‘bpmapply’, first call method @get_bpparam. Default is ‘default’, use the setting when initializing.

bpparam: rpy2.robject.methods.RS4 (default: ‘default’)

If @parallelization is ‘bpmapply’, first call function @get_bpparam to get the robject. If @parallelization is ‘mcmapply’ or ‘pbmcmapply’, it should be None. Default is ‘default’, use the setting when initializing.

return_py: bool (default: ‘default’)

If True, functions will return a result easy for manipulation in python. Default is ‘default’, use the setting when initializing.

Output:

A dict like object.

mean_mat: pandas.DataFrame

A matrix of the mean parameter.

The row corresponds to the observations and the column corresponds to the genes.

sigma_mat: pandas.DataFrame

A matrix of the sigma parameter (for Gaussian, the variance; for NB, the dispersion.).

The row corresponds to the observations and the column corresponds to the genes.

zero_mat: pandas.DataFrame

A matrix of the zero-inflation parameter (only non-zero for ZIP and ZINB).

The row corresponds to the observations and the column corresponds to the genes.