#sparse-matrix #statistics #non-zero #subset #compute #min #disk-based

app spars

💥 Disk-based sparse matrix statistics and subsetting 💥

1 stable release

new 1.0.0 Jan 13, 2025

#222 in Math

Download history 51/week @ 2025-01-07

51 downloads per month

MIT license

26KB
602 lines

Rust

💥 spars: disk-based sparse matrix tools

spars is a memory-efficient tool for working with sparse matrices in the Matrix Market format on-disk.

Usage

Subset a matrix on-disk:

spars subset -i <matrix.mtx> --rows <row_index.txt> --cols <col_index.txt> -o <matrix_subset.mtx>

Compute matrix statistics (nonzero count, sum, mean, variance, standard deviation, min, max) for each row and column:

spars stats -i <matrix.mtx> -o <filename>

Installation

From cargo

cargo install spars

From GitHub

To compile, clone the git repo and run cargo install:

git clone git@github.com:stuart-lab/spars.git
cd spars; cargo install --path .

Precompiled binaries are also available in the release

Dependencies

~3.5–5MB
~91K SLoC