Commit 2a76e4f
committed
Initial import: chelae — FASTQ trim/filter toolkit extracted from fqtk
Brings the `trim` subcommand (and its associated build / CI / documentation
scaffolding) from `fqtk` on branch `tf_trim` into a standalone crate. Source
of truth for the pre-split design history is `fqtk`'s `tf_trim_backup`
branch (30+ individual commits); the upstream `tf_trim` branch carries the
same content as three squashed commits.
Pipeline stages (in order):
1. Read-structure hard-trim and UMI extraction
2. Poly-G 3' trim (on by default; SIMD kernel is ~free)
3. Optional poly-X 3' trim (`--trim-polyx`)
4. Adapter trim — PE-overlap evidence mode, plus `--kit`,
`--adapter-sequence`, `--adapter-fasta` for SE or deep trimming
5. Optional 5'→3' then 3'→5' sliding-window quality trim
6. Length filter (`--filter-length MIN[:MAX]`)
7. Optional N-base, mean-quality, and low-quality-fraction filters
Architecture:
* Worker-pool threading: a per-input reader thread (decompress + parse),
N worker threads running the full trim → filter → serialize → compress
pipeline on pooled batches, and per-output writer threads that stream
bytes in input order via oneshot-per-batch ordering.
* Portable SIMD (`wide`) kernels: poly-G/X tail, sliding-window 3' quality
trim, Q20/Q30/N counting, low-quality-fraction counting, 3' adapter
matching (ACGT fast path; IUPAC falls back to scalar), PE-overlap
evidence scans.
* x86_64 release builds target `x86-64-v3` (AVX2+); a pre-main CPUID
guard prevents `SIGILL` on older hardware.
Outputs:
* BGZF-compressed FASTQ.
* fastp-compatible JSON report with per-mate Q20/Q30 stats, filtering
breakdown, adapter cutting stats, and detected adapter sequences.
* MultiQC consumes the JSON directly via its `fastp` module.
Library (`chelae_lib`) exposes just the pieces trim needs:
* `IUPAC_MASKS` — 256-byte ASCII-indexed LUT for IUPAC base compatibility.
* `adapter_db` — built-in kit presets (truseq, nextera, small-rna, aviti,
mgi/dnbseq) and the `all` union selectable via `--kit`.
Retained from fqtk: `rust-toolchain.toml` (Rust 1.95), `rustfmt.toml`,
`ci/check.sh`, pre-commit script, GitHub Actions workflow (README sync +
format / clippy / test matrix), Fulcrum logos, CODEOWNERS, CLAUDE.md
project conventions.0 parents commit 2a76e4f
24 files changed
Lines changed: 8332 additions & 0 deletions
File tree
- .cargo
- .github
- logos
- scripts
- workflows
- ci
- src
- bin
- commands
- lib
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments