rsx-rs Documentation

Author:

Rohit Goswami

1 rsx-rs

Rust rewrite of RADSex, a computational pipeline for analyzing sex-determination using RAD-Sequencing data. Drop-in CLI replacement with Python bindings and C FFI for downstream workflow integration.

1.1 Features

  • Original RADSex-compatible commands: process, distrib, signif, depth, freq, map, subset

  • Sex-linked marker evidence command: strict calls, Bayes factors, posterior P(sex-linked), penetrance, bias direction, and marker class

  • merge command: external sort-merge for 75M+ sequence tables

  • pca command: streaming sample PCA in O(nindividuals2) memory

  • Bayesian marker evidence: Bayes factors and symmetric posterior probabilities for sex-linked enrichment in either compared group

  • Byte-identical output to C++ RADSex (when groups specified explicitly)

  • Bounded-memory streaming: all commands work on 50GB+ tables

  • Parallel file processing via rayon

  • minimap2 alignment (replaces BWA-MEM)

  • Optional Parquet output for merge (--features parquet-io)

  • Python bindings for notebook and workflow use; C API with cbindgen for R/Python/C++ integration

  • Cross-platform: Linux, macOS (Intel + Apple Silicon), Windows (without map)

  • SymPy/Sollya mathematical proofs for all optimizations

1.2 Quick start

# Install from source
git clone https://github.com/HaoZeke/rsx-rs.git
cd rsx-rs
cargo build --release
cp target/release/rsx ~/.local/bin/

# Or via pixi
pixi run build

# Python bindings (high-level API for notebooks/workflows)
pip install pyrsx
# or pixi run -e python build-python


# Run the pipeline
rsx process -i reads/ -o markers.tsv -T 8
rsx distrib -t markers.tsv -p popmap.tsv -o distrib.tsv -G M,F
rsx signif -t markers.tsv -p popmap.tsv -o signif.tsv -G M,F
rsx map -t markers.tsv -p popmap.tsv -g genome.fa -o aligned.tsv -G M,F