Landscape-Heatmap Visium-HD¶
In [1]:
Copied!
%load_ext autoreload
%autoreload 2
%env ANYWIDGET_HMR=1
%load_ext autoreload
%autoreload 2
%env ANYWIDGET_HMR=1
env: ANYWIDGET_HMR=1
In [2]:
Copied!
import pandas as pd
import celldega as dega
import pandas as pd
import celldega as dega
In [3]:
Copied!
base_url = 'https://raw.githubusercontent.com/broadinstitute/celldega_Visium_HD_mouse_brain/main/Visium_HD_mouse_brain'
base_url = 'https://raw.githubusercontent.com/broadinstitute/celldega_Visium_HD_mouse_brain/main/Visium_HD_mouse_brain'
In [ ]:
Copied!
landscape_visium = dega.viz.Landscape(
technology='Visium-HD',
base_url=base_url,
height=600,
max_tiles_to_view = 10
)
landscape_visium = dega.viz.Landscape(
technology='Visium-HD',
base_url=base_url,
height=600,
max_tiles_to_view = 10
)
/var/folders/_6/bhs42vt57t1dkb59k4sy0p440000gp/T/ipykernel_42157/3604516923.py:1: UserWarning: Transformation matrix not found at https://raw.githubusercontent.com/broadinstitute/celldega_Visium_HD_mouse_brain/main/Visium_HD_mouse_brain/micron_to_image_transform.csv. Using identity. landscape_visium = dega.viz.Landscape(
In [ ]:
Copied!
In [5]:
Copied!
file_path = f'{base_url}/df_sig.parquet'
df_sig = pd.read_parquet(file_path)
top_genes = df_sig.sum(axis=1).sort_values(ascending=False).index.tolist()[:5000]
df_sig = df_sig.loc[top_genes]
file_path = f'{base_url}/df_sig.parquet'
df_sig = pd.read_parquet(file_path)
top_genes = df_sig.sum(axis=1).sort_values(ascending=False).index.tolist()[:5000]
df_sig = df_sig.loc[top_genes]
In [6]:
Copied!
mat = dega.clust.Matrix(data=df_sig)
mat.norm(axis='col', by='total')
mat.norm(axis='row', by='zscore')
mat.cluster()
cgm = dega.viz.Clustergram(matrix=mat, width=500, height=500)
mat = dega.clust.Matrix(data=df_sig)
mat.norm(axis='col', by='total')
mat.norm(axis='row', by='zscore')
mat.cluster()
cgm = dega.viz.Clustergram(matrix=mat, width=500, height=500)
In [7]:
Copied!
dega.viz.landscape_clustergram(landscape_visium, cgm)
dega.viz.landscape_clustergram(landscape_visium, cgm)
Out[7]:
In [ ]:
Copied!