Skip to content

braingeneers/sims-web

Repository files navigation

sims-web

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.

Demo

index.html opens an h5ad in the browser and runs a selected SIMs model and displays predictions.

Alt text

Running

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

Functional Experiments

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.

References

h5wasm

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

ONNX Runtime Javascript Examples

Graphical ONNX Editor

SIMS Streamlit App and Source

About

Attempt to run SIMS inference in the browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published