simba.tl.compare_entities

simba.tl.compare_entities(adata_ref, adata_query, n_top=50, T=1)[source]

Compare the embeddings of two entities by calculating

the following values between reference and query entities:

  • dot product

  • normalized dot product

  • softmax probability

and the following metrics for each query entity:

  • max (The average maximum dot product of top-rank reference entities, based on normalized dot product)

  • std (standard deviation of reference entities, based on dot product)

  • gini (Gini coefficients of reference entities, based on softmax probability)

  • entropy (The entropy of reference entities, based on softmax probability)

Parameters:
  • adata_ref (AnnData) – Reference entity anndata.

  • adata_query (list) – Query entity anndata.

  • n_top (int, optional (default: 50)) – The number of reference entities to consider when calculating the metric ‘max’

  • T (float) – Temperature parameter for softmax. It controls the output probability distribution. When T goes to inf, it becomes a discrete uniform distribution, each query becomes the average of reference; When T goes to zero, softargmax converges to arg max, each query is approximately the best of reference.

Returns:

adata_cmp – Store reference entity as observations and query entity as variables

Return type:

AnnData