Skip to main content

Single Rust Ecosystem

A family of Rust libraries for high-performance single-cell data analysis

Core Libraries

anndata-rs

The foundational library providing core data structures and I/O operations for single-cell data. Implements the AnnData format in Rust.

anndata-memory

In-memory representation of AnnData objects optimized for computational efficiency and safe concurrent operations.

single-algebra

Linear algebra operations and statistical methods specific to single-cell analysis, with support for sparse matrices and parallelization.

single-svdlib

Optimized singular value decomposition implementations for dimensionality reduction in large-scale single-cell data.

Ecosystem Benefits

  • Performance: Native Rust implementation provides significant speed improvements over Python alternatives
  • Memory Safety: Rust's ownership model prevents common errors and ensures thread-safe operations
  • Concurrency: Built-in support for parallel computation to handle large datasets efficiently
  • Interoperability: Compatible with existing AnnData format for seamless integration with existing workflows
  • Modern Architecture: Modular design allows for flexible extension and customization

Architecture Overview

anndata-rs

Core data structures and I/O

anndata-memory

In-memory implementation

single-algebra

Linear algebra and statistics

single-svdlib

SVD implementations

single-rust

Main integration library

(Detailed connection diagram forthcoming)

Detailed diagram with exact dependencies and data flows coming soon

Feature Comparison

Featureanndata-rsanndata-memorysingle-algebrasingle-svdlib
Data Persistence---
In-Memory ProcessingLimited--
Linear Algebra Operations---
SVD Calculations--Limited
Sparse Matrix Support
Parallel Processing-
Statistical Methods---

Usage Example

// Example of using the Single Rust ecosystem
use anndata_memory::IMAnnData;
use single_algebra::Direction;
use single_rust::io::{read_h5ad_memory, FileScope};
use single_rust::memory::processing::compute_highly_variable_genes;

fn main() -> anyhow::Result<()> {
    // Load data with anndata-rs
    let adata = read_h5ad_memory("my_data.h5ad")?;
    
    // Compute statistics using single-algebra abstractions
    let n_cells = adata.n_obs();
    let means: Vec<f64> = adata.x()
        .sum_whole(&Direction::COLUMN)?
        .iter()
        .map(|sum: &f64| sum / n_cells as f64)
        .collect();
    
    // Find highly variable genes
    compute_highly_variable_genes(&adata, None)?;
    
    Ok(())
}