feat: WASP allele-specific-mapping filter (SE + PE) - #108
Closed
BenjaminDEMAILLE wants to merge 7 commits into
Closed
feat: WASP allele-specific-mapping filter (SE + PE)#108BenjaminDEMAILLE wants to merge 7 commits into
BenjaminDEMAILLE wants to merge 7 commits into
Conversation
CI's clippy advanced to 1.97 (new lints fail the `-D warnings` gate) and rustsec flagged several advisories in the dependency tree. Both block all PRs. Clippy: - src/index/suffix_array.rs: assert!(x == 0) -> assert_eq! (manual_assert_eq) - src/io/sam.rs, tests/alignment_features.rs: byte-slice literals -> byte strings, e.g. [b'S', b'M'] -> *b"SM" (byte_char_slices) - src/quant/transcriptome.rs: if-let/else-return-None -> `?` (question_mark) Security audit (Cargo.lock only, no manifest change): - memmap2 0.9.10 -> 0.9.11 (RUSTSEC-2026-0186, out-of-bounds pointer offset) - crossbeam-epoch 0.9.18 -> 0.9.20 (RUSTSEC-2026-0204, invalid pointer deref) - anyhow 1.0.102 -> 1.0.104 (RUSTSEC-2026-0190, unsound downcast_mut) No behavioural change. Unblocks CI for open and future PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add LICENSES/STAR_RS_LICENSE (STAR-rs MIT notice, Copyright (c) 2026 Benjamin Demaille) and note it in LICENSES/README.md, for attribution of modules ported from STAR-rs. STAR-rs is dual MIT-OR-Apache; ported code is taken under its MIT option, compatible with this repo's MIT license. Add docs-old/dev/porting-from-star-rs.md documenting the STAR-rs to rustar-aligner type/module mapping, the licensing and cellranger reference-only caveat, the determinism decision (adopt STAR-rs's thread-invariant, no-rand model), and how to validate ports against native STAR via the existing test/ harness with DIVERGENCES.md as the acceptance spec. This is the base of a series of themed, dependency-stacked PRs bringing the STAR-rs feature surface (WASP, clipping, signal tracks, genome transforms, STARlong, STARsolo, ...) into rustar-aligner. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Port STAR's WASP filter (--waspOutputMode SAMtag, --varVCFfile) from STAR-rs `crates/star-align/src/star_wasp.rs`. A uniquely-mapped read overlapping heterozygous SNVs is re-mapped with every alternative-allele combination; if all re-maps land on the identical locus it passes (vW:i:1), otherwise a failure code (2..7) is reported. Emits vW, and vA/vG when requested in --outSAMattributes. - src/wasp/mod.rs: load_vcf, wasp_type (re-map decision), wasp_variants (vG/vA), and record annotation. Works in base-code space; variant/read overlap is computed by walking the transcript CIGAR (same convention as build_md_tag), so it does not depend on the exon read-coordinate frame. - src/params: add --waspOutputMode (None|SAMtag) and --varVCFfile, validation (SAMtag requires a VCF), and vW/vA/vG in --outSAMattributes. - src/lib.rs: load the VCF once per run, re-map with a WASP-relaxed parameter set (match_nmin=0, multimap_score_range=1, multimap_nmax=10, matching STAR), and stamp vW/vA/vG onto the SAM records in the single-end path. Paired-end WASP is a follow-up. See docs-old/dev/porting-from-star-rs.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BenjaminDEMAILLE
force-pushed
the
bd/wasp
branch
from
July 23, 2026 18:02
a8b872b to
3e84d97
Compare
Replace the single giant phase-log paragraph and the stale hardcoded test count / known-issues list with a short faithfulness summary and a pointer to ROADMAP.md / CHANGELOG.md / docs-old for per-phase history. Refresh the source layout (params/ split, cpu.rs, sa_build.rs, sjdb_insert.rs, transcriptome.rs, log.rs) and the dependency list (caps-sa, mimalloc, rand 0.10, tempfile as a runtime dep) to match the current tree. Documentation only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Complete the WASP filter for paired-end reads, the documented follow-up to the single-end port (3e84d97). Ports STAR-rs `wasp_type_pe` / `wasp_variants_pe` into rustar-aligner's two-transcript-per-pair model. - src/wasp/mod.rs: add wasp_variants_pe (combined vG/vA over mate1 then mate2, STAR's `mate1 ++ rc(mate2)` combined-transcript order), wasp_type_pe (single vW code: walk each mate's variants in its SAM frame, apply every allele combination, map back to forward mates, and re-map the pair via align_paired_read with the WASP-relaxed params; a combination passes only if exactly one both-mapped pair lands on the same exons for both mates), and annotate_records_pe (both mate records share vW/vA/vG; multimapped pairs overlapping variants get vW:i:2). - src/lib.rs: build the WaspContext once in align_reads_paired_end and stamp vW/vA/vG onto the built pair records, mirroring the single-end path. Gate green: cargo build, clippy -D warnings, fmt, 464 tests (2 new PE variant-frame unit tests). Byte-level validation against native STAR via the test/ harness is a separate step. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BenjaminDEMAILLE
force-pushed
the
bd/wasp
branch
from
July 24, 2026 07:49
0b346cb to
b5b09de
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--waspOutputMode SAMtag,--varVCFfile) for both single-end and paired-end reads.docs-old/dev/porting-from-star-rs.md— this PR is now WASP-only. Clipping, signal tracks, genome transforms, and STARlong now have their own PRs (see stack below).Stack
Test plan