bio-expression-matrix-sparse-handling
Installation
SKILL.md
Version Compatibility
Reference examples tested with: numpy 1.26+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Sparse Matrix Handling
"Convert counts to sparse matrix" → Store zero-heavy expression data (especially single-cell) in memory-efficient sparse format.
- Python:
scipy.sparse.csr_matrix(dense_array),anndata.Xstores sparse by default - Python:
scipy.io.mmread('matrix.mtx')for Market Matrix format (10x Genomics)