rsx-rs Documentation¶
- Author:
Rohit Goswami
1 rsx-rs¶
rsx is a Rust framework for RAD-seq marker analysis and sex determination. It
pairs bounded-memory streaming kernels with a Bayesian marker-evidence layer and
Python and C bindings. It builds on and stays command-compatible with
RADSex, so existing analyses transfer
unchanged and prior biological results remain directly comparable.
1.1 Features¶
Original RADSex-compatible commands:
process,distrib,signif,depth,freq,map,subsetSex-linked marker evidence command: strict calls, Bayes factors, posterior P(sex-linked), penetrance, bias direction, and marker class
mergecommand: external sort-merge for 75M+ sequence tablespcacommand: streaming sample PCA in O(nindividuals2) memoryBayesian 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