Skip to content

heatmap matrix #1737

Answered by keller-mark
zverozabr asked this question in Q&A
Discussion options

You must be logged in to vote

The heatmap in Vitessce assumes that one axis represents "observations" and the other represents "features".
If we consider each cluster as an "observation", then in this case we need to kind of trick Vitessce into showing the data.

We need to create a new AnnData object that has the clusters along both obs (observations) and var (features) axes. We can store two matrices aligned to these axes using layers:

from anndata import AnnData
import pandas as pd

obs = pd.DataFrame(index=[4, 6, 7, 11, -1, 9, 0], columns=[], data=[])
var = pd.DataFrame(index=[4, 6, 7, 11, -1, 9, 0], columns=[], data=[])

cluster_adata = AnnData(X=None, obs=obs, var=var)
cluster_adata.layers['global_clq'] = adata.uns[

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zverozabr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants