scvi.model.SCANVI.get_feature_correlation_matrix

SCANVI.get_feature_correlation_matrix(adata=None, indices=None, n_samples=10, batch_size=64, rna_size_factor=1000, transform_batch=None, correlation_type='spearman')

Generate gene-gene correlation matrix using scvi uncertainty and expression.

Parameters
adata : AnnData | NoneOptional[AnnData] (default: None)

AnnData object with equivalent structure to initial AnnData. If None, defaults to the AnnData object used to initialize the model.

indices : Sequence[int] | NoneOptional[Sequence[int]] (default: None)

Indices of cells in adata to use. If None, all cells are used.

n_samples : intint (default: 10)

Number of posterior samples to use for estimation.

batch_size : intint (default: 64)

Minibatch size for data loading into model. Defaults to scvi.settings.batch_size.

rna_size_factor : intint (default: 1000)

size factor for RNA prior to sampling gamma distribution.

transform_batch : Sequence[Union[int, float, str]] | NoneOptional[Sequence[Union[int, float, str]]] (default: None)

Batches to condition on. If transform_batch is:

  • None, then real observed batch is used.

  • int, then batch transform_batch is used.

  • list of int, then values are averaged over provided batches.

correlation_type : {‘spearman’, ‘pearson’}Literal[‘spearman’, ‘pearson’] (default: 'spearman')

One of “pearson”, “spearman”.

Return type

DataFrameDataFrame

Returns

Gene-gene correlation matrix