Skip to content

Installation

spearfish is written in Rust and installs with Cargo, from crates.io or from a checkout.

  • Rust 1.89 or newer, installed with rustup.
  • Linux or macOS, on x86-64 or arm64 (Apple Silicon). The alignment and parsing kernels pick AVX-512, AVX2 or scalar code at run time on x86-64, and NEON or scalar code on arm64, and every choice gives exactly the same output.
Terminal window
cargo install --locked spearfish-cli

This puts the spearfish binary in ~/.cargo/bin. From a checkout instead:

Terminal window
git clone https://github.com/COMBINE-lab/spearfish.git
cd spearfish
cargo install --locked --path crates/spearfish-cli

To build without installing:

Terminal window
cargo build --release
./target/release/spearfish --help
Terminal window
spearfish doctor

doctor prints the version and git revision, the target, the CPUs available and the SIMD kernels in use, then maps reads from a built-in toy transcriptome with every preset and checks the result against a reference. SPEARFISH_SIMD=scalar|avx2|avx512|neon makes spearfish use at most that level, for example to compare speeds. With --index transcripts.sfi it also checks that an index loads and suits this build. --json prints the same report as JSON, to attach to a bug report.

The full test suite is cargo test --workspace --release.

Terminal window
spearfish completions bash > ~/.local/share/bash-completion/completions/spearfish
spearfish completions zsh > ~/.zfunc/_spearfish # also fish, elvish, powershell
spearfish man -o ~/.local/share/man/man1 # spearfish.1, spearfish-map.1, ...

Abundances come from oarfish, installed separately: a build with spearfish support (its --help lists spearfish as a --mapper). See Quantification.