mira.tl.get_relative_norms#

mira.tl.get_relative_norms(adata1, adata2, *, key='X_umap_features', colname='relative_mode_weights')#

One may assume that the influence of the two modalities on the joint representation is driven by the relative magnitude of the norm of these modalities’ embeddings. This function calculates the relative norm of the embeddings so that one can determine which model is principally driving joint UMAP geometry.

Parameters
expr_adataanndata.AnnData

AnnData object with expression features, must have “X_umap_features” in .obsm.

atac_adataanndata.AnnData

AnnData object with accessibility features, must have “X_umap_features” in .obsm.

Returns
adataanndata.AnnData
.obs[‘relative_mode_weights’]np.ndarray[float] of shape (n_cells,)

log2 ratio of expression embedding norms over accessibility embedding norms. This per-cell metric will thus be positive if the joint representation for that cell is primarily driven by expression topics, and negative for accessibility.