Cell embeddings¶
With hundreds to thousands of cells, the question becomes which cells are alike. uchrom.emb embeds
cells by their contact maps — FastHigashi’s tensor decomposition, or scHiCluster’s imputed maps — and by
the other measurements of the same cells (RNA, accessibility), clusters them, scores the clusters against
known cell types and stores everything on the cells axis (cd.cellm, with the metadata the web browser uses
to label it in cd.uns["embeddings"]).
import uchrom as uc
import uchrom.datasets as ds
import uchrom.emb as emb
cd = ds.load("kim2020_scihic") # cells + per-cell contact maps (linked)
uc.tl.embed_higashi(cd, rank=64, seed=0) # FastHigashi -> cd.cellm["higashi"]
emb.score_embedding(cd, "higashi", "cell_type") # ARI / NMI of k-means, kNN purity
Task |
API |
|---|---|
embed cells by their contact maps: FastHigashi |
|
embed cells by their contact maps: scHiCluster |
|
embed cells from RNA / ATAC / chromatin marks / any matrix (PCA, t-SNE, UMAP) |
|
clusters and their markers |
|
how well an embedding separates known types |
|
plot an embedding, coloured by a type or a value |
|
The same functions embed imaging cells by their chromatin marks (DNA seqFISH+).
Tutorials¶
API: uchrom.emb.