scvi.model.TOTALVI.get_feature_correlation_matrix

TOTALVI.get_feature_correlation_matrix(adata=None, indices=None, n_samples=10, batch_size=64, rna_size_factor=1000, transform_batch=None, correlation_type='spearman', log_transform=False)[source]

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

Parameters
adata

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

indices

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[~Number, str]] | NoneOptional[Sequence[Union[~Number, 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”.

log_transform : boolbool (default: False)

Whether to log transform denoised values prior to correlation calculation.

Return type

DataFrameDataFrame

Returns

Gene-protein-gene-protein correlation matrix