⚡
GPU Acceleration
WebGPU (default) with WebGL2 fallback. 10-100x faster than CPU implementations.
Wilcoxon rank-sum test for single-cell RNA-seq data, running entirely in the browser
import { rankGenesGroups } from 'deg.js';
const result = await rankGenesGroups(expression, groups, {
nGenes: 100,
corrMethod: 'benjamini-hochberg',
});
for (const [groupName, data] of result.groups) {
console.log(`Top genes for ${groupName}:`, data.names.slice(0, 10));
}Tested on Intel i7-1265U, 32GB RAM, Intel Iris Xe Graphics (integrated GPU)
| Dataset Size | Python Scanpy | deg.js |
|---|---|---|
| 10K cells | ~5s | ~0.5s |
| 100K cells | ~30s | ~3s |
| 1M cells | ~5min | ~60s |
First Run Initialization
The first analysis includes WebGPU/WebGL2 initialization (shader compilation, pipeline creation). Subsequent runs are significantly faster as the GPU context is reused.
| Browser | WebGPU | WebGL2 |
|---|---|---|
| Chrome 113+ | ✅ | ✅ |
| Edge 113+ | ✅ | ✅ |
| Firefox 141+ | ✅ | ✅ |
| Safari 17+ | ✅ | ✅ |