Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
118 lines (112 loc) · 4.83 KB
/
Copy pathCargo.toml
File metadata and controls
118 lines (112 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
[package]
name = "rustar-aligner"
version = "0.2.0"
edition = "2024"
rust-version = "1.89"
authors = ["James Ferguson"]
description = "A Rust reimplementation of STAR (Spliced Transcripts Alignment to a Reference), the RNA-seq aligner"
license = "MIT"
repository = "https://github.com/scverse/rustar-aligner"
readme = "README.md"
keywords = ["bioinformatics", "rna-seq", "aligner", "sequencing", "star"]
categories = ["command-line-utilities", "science"]
exclude = [
"test/",
"tests/",
"docs/",
".github/",
"Dockerfile",
".dockerignore",
"ROADMAP.md",
]
[[bin]]
name = "rustar-aligner"
path = "src/main.rs"
[dependencies]
clap = { version = "4", features = ["derive"] }
anyhow = "1"
thiserror = "2"
log = "0.4"
env_logger = "0.11"
memmap2 = "0.9"
byteorder = "1"
noodles = { version = "0.116", features = ["fastq", "sam", "bam", "bgzf"] }
bstr = "1"
# Use the pure-Rust `zlib-rs` backend instead of flate2's default `miniz_oxide`:
# ~2-3x faster inflate/deflate on the FASTQ decode + BGZF (BAM) paths, with no C
# toolchain dependency. Backend is chosen at build time; API is unchanged.
flate2 = { version = "1", default-features = false, features = ["zlib-rs"] }
rayon = "1"
rustc-hash = "2"
dashmap = "6"
chrono = "0.4"
tempfile = "3"
bitflags = { version = "2.12.1", features = ["std"] }
shlex = "2.0.1"
caps-sa = "0.7"
# mimalloc as the global allocator. Two reasons:
# 1. **Memory return**: glibc malloc creates one arena per worker
# thread (rayon spawns ~num_cpus workers + sub-threads) and
# caches freed allocations in those arenas indefinitely. On
# genome-scale runs that adds 10-20 GB of allocator slack to
# peak RSS for no good reason. mimalloc's per-thread heaps
# release whole segments back to the OS when threads abandon
# them, so the cache size stays bounded.
# 2. **Speed**: mimalloc has lower per-allocation cost than
# glibc's, which adds up on the millions of small allocations
# caps-sa makes during phase 1 / phase 4.
# `default-features = false` skips the secure / debug builds (no
# extra cost in release, but the default features add a few hundred
# kB of fast-path stubs we don't need).
mimalloc = { version = "0.1", default-features = false }
libmimalloc-sys = { version = "0.1.49", features = ["extended"] } # mi_option_set (purge_delay); see main.rs
libdeflater = "1.25.2"
noodles-bgzf = { version = "0.51", features = ["libdeflate"] }
# Deterministic SIMD overlap aligner for the CellRanger4 5' TSO clip (STAR
# links Opal for this). Pure Rust, zero dependencies, bit-identical across
# backends. Pinned exactly: this crate is published, so downstream builds
# resolve their own version without our Cargo.lock, and an unvetted release
# must not move alignment output. Bump deliberately, rerunning the Opal oracle
# test (`cr4_tso_matches_star_opal_oracle`).
hyalite = "=0.4.0"
# Optional FASTQ input decoders beyond gzip (#218). The format is detected by
# magic bytes in `src/io/fastq.rs`. Every backend below is pure Rust, so turning
# them on adds no C toolchain requirement. `niffler` was evaluated and not used:
# it cannot offer a pure-Rust zstd backend, its xz backend is C-only
# (`liblzma-sys`), and its `bgz` backend duplicates `noodles-bgzf`.
# `bzip2` 0.6 defaults to `libbz2-rs-sys` (pure Rust), not the C `bzip2-sys`.
bzip2 = { version = "0.6", optional = true }
# Decode-only pure-Rust Zstandard.
ruzstd = { version = "0.9.1", optional = true }
# Pure-Rust XZ decoder; encoder and lzip support left out.
lzma-rust2 = { version = "0.21", optional = true, default-features = false, features = ["std", "xz", "optimization"] }
[features]
default = []
# FASTQ input compressed with bzip2 (magic `42 5a 68`).
bz2 = ["dep:bzip2"]
# FASTQ input compressed with Zstandard (magic `28 b5 2f fd`).
zstd = ["dep:ruzstd"]
# FASTQ input compressed with XZ (magic `fd 37 7a 58 5a 00`).
xz = ["dep:lzma-rust2"]
# All compressed input formats beyond gzip.
compressed-input = ["bz2", "zstd", "xz"]
[dev-dependencies]
assert_cmd = "2"
predicates = "3"
# XZ encoder, used only to build `.xz` test fixtures at runtime.
lzma-rust2 = { version = "0.21", default-features = false, features = ["std", "xz", "encoder"] }
[build-dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock"] }
# Whole-program LTO + a single codegen unit are worth the extra build time
# for the seed-search and DP-extension inner loops. Cargo warns about this
# profile being shadowed when rustar-aligner is built as a workspace member
# (the workspace root carries its own [profile.release] with the same
# values); keeping it here means standalone clones get the same release
# tuning even when there is no parent workspace.
# CI overrides these via `CARGO_PROFILE_RELEASE_LTO=thin` /
# `CODEGEN_UNITS=16` env vars to keep test-matrix runtime reasonable.
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true