Welcome to interactive-viewer!
interactive-viewer is a web application for interactively 3D reconstruction of spatial transcriptomics in 3D space.
You can clone the Spateo-Viewer with git
and install dependencies with pip
:
git clone https://github.com/aristoteleo/spateo-viewer.git
cd spateo-viewer
pip install -r requirements.txt
python stv_interactive_app.py --port 1234
import spateo as st
# Load the anndata object
adata = st.read_h5ad("E7_8h_cellbin.h5ad")
# Make sure adata.obsm contains 'spatial' to save the coordinates
adata.obsm['spatial'] = adata.obsm['3d_align_spatial']
# Interactive-viewer will read all info contained in anndata.obs, so please make sure the info you need has been saved in anndata.obs
# Save the anndata object
adata.write_h5ad("E7_8h_cellbin.h5ad", compression="gzip")
You can refer to the data structure we include by default in the dataset.
-
Upload file via the tool included in the toolbar in the web application:
-
Upload folder via the
stv_interactive_app.py
:from stviewer.interactive_app import interactive_server, state if __name__ == "__main__": **state.upload_anndata = None** interactive_server.start()
Change None in
state.upload_anndata = None
to the absolute path of the file you want to upload.(Please give priority to this method when used in remote servers)