Run SIMS in the browser using scran.js and h5wasm to read local AnnData (.h5ad) files and ONNX to run the model on CPU or GPU if available.
index.html opens an h5ad in the browser and runs a selected SIMs model and displays predictions.
Export a SIMS checkpoint to an onnx file and list of genes. Note this assumes you have the SIMS repo as a peer to this one so it can load the model definition.
python sims-to-onnx.py models/default.ckpt
Check the model for compatibility with onnx
python -m onnxruntime.tools.check_onnx_model_mobile_usability --log_level debug models/default.ckpt
Serve the web app and models locally
python -m http.server 3000
h5ad.html demonstrates reading an h5ad file over http and using h5wasm in the browser and extracting the gene names and expression matrix values. Must be served locally to comply with CORS. An actual implementation would present an open file dialog to read a file locally.
onnx.html demonstrates loading the sims.onnx file in the browser and running forward inference on a sample zero tensor.
anndata/h5ad file structure and on disk format
Classify images in a web application with ONNX Runtime Web
ONNX Runtime Web (WASM Backend)
ONNX Runtime Web Platform Functionality Details