{ "nbformat": 4, "nbformat_minor": 5, "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "cells": [ { "cell_type": "markdown", "id": "intro", "metadata": {}, "source": [ "# HESRT: one verified sample\n", "Run beside hesrt_io.py after installing requirements.txt. No token is needed. The default package is about 3.2 MB.\n" ] }, { "cell_type": "code", "id": "catalog", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "from pathlib import Path\n", "from hesrt_io import load_catalog, download_sample\n", "catalog, revision = load_catalog()\n", "catalog[['gsm_id', 'tissue', 'technology', 'archive_bytes']].head()\n" ] }, { "cell_type": "code", "id": "download", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "row = catalog.loc[catalog.gsm_id.eq('GSM8915497')].iloc[0]\n", "folder = download_sample(row, Path('hesrt_demo'), revision)\n", "folder\n" ] }, { "cell_type": "code", "id": "matrix", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "import anndata as ad\n", "adata = ad.read_h5ad(folder / 'spatial.h5ad', backed='r')\n", "print(adata.shape, adata.obsm['spatial'].shape)\n", "adata.file.close()\n" ] }, { "cell_type": "code", "id": "qc", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "from PIL import Image\n", "with Image.open(folder / 'alignment_qc.png') as im:\n", " display(im.copy())\n" ] } ] }