scanpy_plus.tl.run_scvi module

scanpy_plus.tl.run_scvi.clean_genes(data, additional_genes_to_exclude=[])

Clean up gene list. Remove cc, hb, mt, ribo and custom list of genes

scanpy_plus.tl.run_scvi.download_cc()

Download cellcycle genes

scanpy_plus.tl.run_scvi.run_scvi(adata_hvg, batch_key, raw_count_layer='counts', clean_genes_before_integration=True, n_latent=10, n_layers=1, max_epochs=10, batch_size=512, categorical_covariate_keys=[], continuous_covariate_keys=[], dispersion='gene-batch', latent_key='X_scvi', **kwargs)

Run scvi returns: adata_hvg, plt, model

scanpy_plus.tl.run_scvi.scvi_plot(model)

Plots to help if scvi has learnt If training and validation curves converge → good fit

If validation loss diverges → possible overfitting or learning-rate issue

If loss is noisy or doesn’t decrease → model may not be converging (try smaller LR, more epochs, or normalize input better)