pegasus.run_scvi
- pegasus.run_scvi(data, features='highly_variable_features', matkey='counts', n_jobs=-1, random_state=0, max_epochs=None, batch=None, categorical_covariate_keys=None, continuous_covariate_keys=None, use_gpu=None)[source]
Run scVI embedding.
This is a wrapper of scvitools package.
- Parameters
data (
MultimodalData.) – Annotated data matrix with rows for cells and columns for genes.features (
str, optional, default:"highly_variable_features") – Keyword indata.var, which refers to a boolean array. IfNone, all features will be selected.matkey (
str, optional, default:"counts") – Matrix key for the raw countn_jobs (
int, optional, default:-1.) – Number of threads to use.-1refers to using all physical CPU cores.random_state (
int, optional, default:0.) – Seed for random number generatormax_epochs (
int | None, optional, default:None.) – Maximum number of training epochs. Defaults to np.min([round((20000 / n_cells) * 400), 400])batch (
str, optional, default:None.) – If only one categorical covariate, the obs key representing batches that should be corrected for, default isNone.categorical_covariate_keys (
List[str]) – If multiple categorical covariates, a list of obs keys listing categorical covariates that should be corrected for, default isNone.continuous_covariate_keys (
List[str]) – A list of obs keys listing continuous covariates that should be corrected for, default isNone.use_gpu (
str | int | bool | None) – Use default GPU if available (if None or True), or index of GPU to use (if int), or name of GPU (if str, e.g.,cuda:0), or use CPU (if False).
- Return type
str- Returns
out_rep (
str) – The keyword indata.obsmreferring to the embedding calculated by integrative NMF algorithm. out_rep is always equal to “scVI”Update
data.obsm–data.obsm['X_scVI']: The embedding calculated by scVI.
Examples
>>> pg.run_scvi(data, batch="Channel") >>> pg.run_scvi(data, categorical_covariate_keys=["cell_source", "donor"], continuous_covariate_keys=["percent_mito", "percent_ribo"])