multivelo.velocity_chrom
- multivelo.velocity_chrom(adata_rna, adata_atac=None, gene_list=None, mode='stochastic', verbose=False, parallel=True, n_jobs=None, save_plot=False, plot_dir=None, rna_only=False, extra_color_key=None, min_r2=0.01, outlier=99.8, n_pcs=30, n_neighbors=30, fig_size=(8, 6), point_size=7)
Multi-omic steady-state model.
This function incorporates chromatin accessibilities into RNA steady-state velocity.
- Parameters:
adata_rna (
AnnData) – RNA anndata object. Required fields: Mu, Ms, and connectivities.adata_atac (
AnnData(default: None)) – ATAC anndata object. Required fields: Mc.gene_list (str, list of str (default: highly variable genes)) – Genes to use for model fitting.
mode (str (default: ‘stochastic’)) – Fitting method. ‘stochastic’: computing steady-state ratio with the first and second moments. ‘deterministic’: computing steady-state ratio with the first moments.
verbose (int or bool (default: False)) – Level of fitting detail to output. Possible values: False, 0, 1, 2, or any number above 2.
parallel (bool (default: True)) – Whether to fit genes in a parallel fashion (recommended).
n_jobs (int (default: available threads)) – Number of parallel jobs.
save_plot (bool (default: False)) – Whether to save the fitted gene portrait figures as files. This will take some disk space.
plot_dir (str (default: plots for multiome and rna_plots for) –
RNA-only) – Directory to save the plots.
rna_only (bool (default: False)) – Whether to only use RNA for fitting (RNA velocity).
extra_color_key (str (default: None)) – Extra color key used for plotting. Common choices are leiden, celltype, etc. The colors for each category must be present in one of anndatas, which can be pre-computed. with scanpy.pl.scatter function.
min_r2 (float (default: 1e-2)) – Minimum R-squared value for selecting velocity genes.
outlier (float (default: 99.8)) – The percentile to mark as outlier that will be excluded when fitting the model.
n_pcs (int (default: 30)) – Number of principal components to compute distance smoothing neighbors. This can be different from the one used for expression smoothing.
n_neighbors (int (default: 30)) – Number of nearest neighbors for distance smoothing. This can be different from the one used for expression smoothing.
fig_size (tuple (default: (8,6))) – Size of each figure when saved.
point_size (float (default: 7)) – Marker point size for plotting.
- Returns:
fit_r2 (.var) – R-squared of regression fit
fit_loss (.var) – loss of model fit
velo_s (.layers) – velocities in spliced space
variance_velo_s (.layers) – variance velocities based on second moments in spliced space
velo_s_genes (.var) – velocity genes
velo_s_params (.var) – fitting arguments used
ATAC (.layers) – KNN smoothed chromatin accessibilities copied from adata_atac