Repository navigation
Conversation
CI previously only built (make + api-test) with no functional coverage, so the 3-letter -> 4-base meth rewrite had no regression net. test/test-meth-align.sh bisulfite-converts the bundled chrM reads, maps them with --meth, and asserts they align with low edit distance (mean NM < 2) and clearly beat plain mapping of the same converted reads (a regression to the non-meth path would spike NM and fail). Wired into the build workflow.
Replaces the "TODO: check if this is correct" on the mt flip. The flip is correct: mt is the read's base conversion (the same value mb_align1 receives and flips locally per segment), and the inverted segment maps to strand !r1->rev, so flipping when !r1->rev mirrors the mb_align1 / mb_matesw_core convention of flipping mt whenever the aligned segment is reverse. Verified empirically: across 555,050 holodeck chr17 em-seq alignments, NM is 0-2 for 99.18% of reads and never exceeds 10; a wrong-strand bisulfite alignment would spike NM to 30-70.
opt->b_ts has no CLI flag and is never initialized (b_ambi is, in options.c), so it stays 0 and the transition branch in ksw_gen_nt4_mat is inactive unless set programmatically. Document this so the field is not mistaken for a live knob, and note that meth mode forces the C>T/G>A cell to a match via mt regardless of b_ts.
Owner
Author
|
@coderabbitai pause |
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.
Three small
--meth-related changes. No change to alignment output.1. Add a bisulfite alignment test to CI.
build.ymlpreviously only built (plusapi-test), with no functional coverage — so the recent 3-letter → 4-base meth rewrite had no regression net.test/test-meth-align.shbisulfite-converts the bundled chrM reads (R1 C→T, R2 G→A), maps them with--meth, and asserts they align with low edit distance (mean NM < 2) and clearly beat plain mapping of the same converted reads (a regression to the non-meth path would spike NM and fail the test). Wired into the build workflow.2. Document the conversion-strand flip in
mb_align1_inv. Replaces the// TODO: check if this is correctatalign.c:775with a comment. The flip is correct:mtis the read's base conversion (the same valuemb_align1receives and flips locally per segment), and the inverted segment maps to strand!r1->rev, so flipping when!r1->revmirrors the establishedmb_align1/mb_matesw_coreconvention of flippingmtwhenever the aligned segment is reverse. Verified empirically: across 555,050 holodeck chr17 em-seq alignments, NM is 0–2 for 99.18% and never exceeds 10 — a wrong-strand bisulfite alignment would spike NM to 30–70.3. Note that
b_tsis unset by default.opt->b_ts(transition mismatch penalty) has no CLI flag and is never initialized (unlikeb_ambi), so it stays 0 and the transition branch inksw_gen_nt4_matis inactive unless set programmatically. Documented inminibwa.hso the field isn't mistaken for a live knob.