Powering single-cell analyses in the browser with WebAssembly
Powering single-cell analyses in the browser with WebAssembly - Published in JOSS (2023)
Science Score: 98.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 11 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
Single cell analysis in the browser
Basic Info
- Host: GitHub
- Owner: kanaverse
- License: mit
- Language: JavaScript
- Default Branch: master
- Homepage: https://kanaverse.org/kana/
- Size: 137 MB
Statistics
- Stars: 151
- Watchers: 6
- Forks: 18
- Open Issues: 31
- Releases: 8
Topics
Metadata Files
README.md
Kana: Single cell analysis in the browser
Kana comes from the Telugu word kaṇaṁ (కణం), which means ... drumroll... cell
Overview
kana is a web application for single-cell data analysis that works directly in the browser. That's right - the calculations are performed client-side, by your browser, on your computer! This differs from the usual paradigm of, e.g., Shiny applications where data needs to be sent to a backend server that does the actual analysis. Our client-side approach has a number of advantages:
- Your data is never transferred anywhere, so you don't have to worry about problems with data privacy. These can be especially hairy when your backend server lies in a different jurisdiction from your data source. By performing the analysis on the client, we avoid all of these issues.
- kana is super-cheap to run and deploy, just serve it as a static website. There's no need to maintain a server or cloud compute instance - let the user's machine take care of it. It also naturally scales to any number of users as they're automatically providing the compute.
- By removing network latency, we can achieve a smooth interactive experience. This ranges from steps such as animated dimensionality reductions to user-driven marker detection and celltype annotation.

For users
If you have a Matrix Market (.mtx) file or HDF5 (tenx V3 or AnnData representation stored as h5ad), or SummarizedExperiment (or derivatives like SingleCellExperiment) stored as an RDS file, or an ExperimentHub id, you're ready to go.
- Launch the application by clicking here.
- Select the Matrix Market file (this may be Gzip-compressed).
We recommend also providing the corresponding
genes.tsvorfeatures.tsvfile to identify marker genes properly. - Click the "Analyze" button, and we'll run a standard single-cell analysis for you.
The standard analysis follows the flow described in the Orchestrating Single-Cell Analysis with Bioconductor. Briefly, this involves:
- Removal of low-quality cells
- Normalization and log-transformation
- Modeling of the mean-variance trend across genes
- A principal components analysis on the highly variable genes
- Clustering with graph-based methods
- The usual dimensionality reductions (t-SNE/UMAP)
- Marker detection for each cluster
- Compute gene set enrichment for each cluster
- Support Multi-modal analysis for Cite-seq data and/or CRISPR
- Make custom cell selections and detect markers for this selection
- Cell type annotation for each cluster across user selected reference datasets
- Perform Integration or Batch correction using MNN correction. You can provide a single dataset containing multiple batches and specify the
batchcolumn in the cell annotations, or load multiple datasets where each dataset is considered a batch - Perform analysis on subsets (filter based on cell annotation)
The interface provides a depiction of the dimensionality reduction of choice, a ranking of marker genes for the cluster of interest, and diagnostic plots from the individual analysis steps.
Checkout the wiki for tutorials on the functionality Kana provides.

Tips and tricks:
- Clicking on a cluster name in the legend will highlight that cluster in the t-SNE/UMAP plot.
- Clicking on the droplet icon in the marker table will color the t-SNE/UMAP plot by the expression of the selected gene.
- Clicking on the plus icon in the marker table will give some details about that gene's expression in the selected cluster, including a histogram relative to cells in other clusters.
- Hovering over the bars in the Markers section for a gene displays a tooltip on different statistics for that gene vs the selected cluster.
- Filter markers either by searching for a gene or using the sliders to filter by various statistics.
- Clicking on Save in the t-SNE or UMAP section will capture the current state of the visualization to Gallery
- Clicking on Animate will interactively visualize dimensions at various iterations as the t-SNE or UMAP algorithms computes these embeddings
- Clicking on "What's happening" will show logs describing how long each step of the analysis took (and any errors during the analysis).
- Clicking Export will save the analysis either to the browser or download the analysis as a .kana file. Loading these files will restore the state of the application
If you use Kana for analysis or exploration, consider citing our JOSS publication -
bibtex
@article{Kana2023,
doi = {10.21105/joss.05603},
url = {https://doi.org/10.21105/joss.05603},
year = {2023},
publisher = {The Open Journal},
volume = {8},
number = {89},
pages = {5603},
author = {Aaron Tin Long Lun and Jayaram Kancherla},
title = {Powering single-cell analyses in the browser with WebAssembly},
journal = {Journal of Open Source Software}
}
For developers
Check out Contributing for guidelines on opening issues and pull requests.
Deployment
Deployment is as easy as serving the static files in this repository via HTTPS. Indeed, our deployment is just being served via GitHub Pages. other providers include static hosting on AWS S3, Google buckets, netlify or name-your-own-provider. As promised, there's no need to set up a backend server.
Docker based builds
Thanks to llewelld for creating a docker image that can generate static HTML files without the hassle of setting up npm and node.
Build the docker images and tag them as kana.
```sh docker build . -t kana
if you are on a macos with m1 or m2, you MIGHT have to use the platform tag
docker build . -t kana --platform linux/arm64 ```
Run the container to generate the production builds,
```sh docker run -v .:/kana -t kana
or depending on your operating system (noticed this on windows with WSL)
docker run -v $(pwd):/kana -t kana ```
and voila, you should now see a builds directory. you can also run the npm commands to generate the builds. checkout either the Dockerfile or the contributing section in this README.
Serving HTML locally
There are numerous options to serve the html files locally using tools that are probably already available on your machine.
Python's http.server
sh
python -m http.server 3000 -d builds
npm's serve
sh
npm install -g serve
serve builds
or caddy, apache, nginx or static hosting solutions, or anything else you are familiar with.
Architecture
We have significantly revamped the entire application and the underlying infrastructure to support hybrid compute - either purely client-side with webassembly, or on backend systems through node, or both.
kana uses the scran.js library for efficient client-side execution of single-cell analysis steps. This uses a variety of C/C++ libraries compiled to WebAssembly to enable heavy-duty calculations in the browser at near-native speed.
All computations performed by kana run in a Web Worker. This avoids blocking on the main thread and allows the application to be more responsive. Data is sent to the main thread on an as-needed basis, e.g., for visualizations. We also create separate Web Workers for the t-SNE and UMAP steps so that they can be run concurrently for maximum efficiency.

The WASM code itself is compiled with PThreads support to enable parallelization of some analysis steps.
This involves the use of a SharedArrayBuffer to efficiently share memory across Web Workers,
which in turn requires cross origin isolation of the site.
We achieve this by using a service worker to cache the resources and load the blobs with the relevant headers - hence the need for HTTPS.
Friends of Kana
- bakana: The core analysis workflow is refactored into an independent package to provide the same functionality in browser and node environments. The Kana front-end is now a wrapper around bakana.
- kanapi: provides a node API (using WebSockets) to run single-cell analysis in backend environments (extending
bakana). One can extend Kana to interact to this API (#good-first-issue) - kana-formats: as we add new functionality and features, we need to store and read the exported analysis state (
.kanafiles). This package specifies the formats and provides readers for parsing various versions. - kanaval: validate the exported analysis results.

For the curious: this project was bootstrapped with the Create React App.
Owner
- Name: kanaverse
- Login: kanaverse
- Kind: organization
- Location: United States of America
- Repositories: 11
- Profile: https://github.com/kanaverse
The one-stop shop for all of your kana-related needs!
JOSS Publication
Powering single-cell analyses in the browser with WebAssembly
Authors
Tags
WebAssembly bioinformatics single-cellCitation (CITATION.bib)
@article{Kana2023,
doi = {10.21105/joss.05603},
url = {https://doi.org/10.21105/joss.05603},
year = {2023},
publisher = {The Open Journal},
volume = {8},
number = {89},
pages = {5603},
author = {Aaron T. l. Lun and Jayaram Kancherla},
title = {Powering single-cell analyses in the browser with WebAssembly},
journal = {Journal of Open Source Software}
}
GitHub Events
Total
- Issues event: 3
- Watch event: 9
- Delete event: 1
- Issue comment event: 14
- Push event: 9
- Pull request event: 2
- Fork event: 4
- Create event: 1
Last Year
- Issues event: 3
- Watch event: 9
- Delete event: 1
- Issue comment event: 14
- Push event: 9
- Pull request event: 2
- Fork event: 4
- Create event: 1
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Kancherla | j****a@g****m | 220 |
| LTLA | i****s@g****m | 89 |
| Peter Hickey | p****y@g****m | 1 |
| David Llewellyn-Jones | d****d@f****k | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 38
- Total pull requests: 67
- Average time to close issues: 2 months
- Average time to close pull requests: 3 days
- Total issue authors: 8
- Total pull request authors: 2
- Average comments per issue: 1.26
- Average comments per pull request: 0.6
- Merged pull requests: 58
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 3
- Average time to close issues: 1 day
- Average time to close pull requests: about 4 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 5.5
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jkanche (26)
- LTLA (6)
- slowkow (3)
- PeteHaitch (2)
- ohmstead (2)
- MichaelSchulzGSH (1)
- vickywvng (1)
- kokitsuyuzaki (1)
- mdozmorov (1)
- colindaven (1)
- mixiaoluo88 (1)
Pull Request Authors
- jkanche (49)
- LTLA (26)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- @blueprintjs/core ^3.51.3
- @blueprintjs/popover2 ^0.13.0
- @blueprintjs/table ^3.9.12
- @dnd-kit/core ^5.0.3
- @dnd-kit/modifiers ^5.0.0
- @dnd-kit/sortable ^6.0.1
- @testing-library/jest-dom ^5.11.4
- @testing-library/react ^11.1.0
- @testing-library/user-event ^12.1.10
- bakana ^0.3.4
- d3 ^7.1.1
- epiviz.gl ^1.0.2
- epiviz.scatter.gl ^0.0.5
- hash-wasm ^4.9.0
- pub-sub-es ^2.0.1
- randomcolor ^0.6.2
- react ^17.0.2
- react-dom ^17.0.2
- react-scripts 5.0.0
- react-split-grid ^1.0.4
- react-virtuoso ^2.3.1
- web-vitals ^1.0.1
- workbox-background-sync ^5.1.3
- workbox-broadcast-update ^5.1.3
- workbox-cacheable-response ^5.1.3
- workbox-core ^5.1.3
- workbox-expiration ^5.1.3
- workbox-google-analytics ^5.1.3
- workbox-navigation-preload ^5.1.3
- workbox-precaching ^5.1.3
- workbox-range-requests ^5.1.3
- workbox-routing ^5.1.3
- workbox-strategies ^5.1.3
- workbox-streams ^5.1.3
- 1227 dependencies
- JamesIves/github-pages-deploy-action 4.1.3 composite
- actions/checkout v2 composite
- actions/setup-node v2 composite
