Map bedMethyl intervals and strands into genomic space - #662
Open
SuhasSrinivasan wants to merge 1 commit into
Open
Map bedMethyl intervals and strands into genomic space#662SuhasSrinivasan wants to merge 1 commit into
SuhasSrinivasan wants to merge 1 commit into
Conversation
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.
Review status: Author-reviewed and ready for ONT review.
Fixes #661.
Summary
bedmethyl map-to-genome.Severity
Severity: High — scientific correctness and output validity
Rationale: The affected command exits successfully while producing reversed intervals and incorrect genomic strand labels, which can cause downstream interval tools to reject or biologically misinterpret rows.
Root cause
The map-to-genome loop used the input bedMethyl strand to choose the coordinate endpoint, subtracting one for a negative row. Strand is an annotation and must not determine BED interval direction. The loop also changed the contig and coordinate but never composed the transcript-relative row strand with the transcript model's genomic orientation.
Implementation
map_bedmethyl_line_to_genome, which converts the transcript start with the existing exon-aware mapper, obtains the stop with checked+1, composes strand, and updates the output contig/interval together.TranscriptModel::strand()accessor, keeping other model details encapsulated.+,-, and..Preserved behavior
Non-goals
Behavior before and after
[1,0), strand-[1,2), strand-[11,12), strand+[11,12), strand-[10,9), strand-[10,11), strand+..Testing
Test environment
ab28f5f86a27259db35310308f80329af4736fb6788fdf37cb56da054f553393804dd53c33cd9e2b; clean5cecc3fb3a9336068d9e3c68d5c08d678153dd2cCargo.lockSHA-25649c08c4c51b6f4320726551146d971fa9ef2183d40c3f6c631b2005965e242c0; resolvedhts-sys 2.2.0; the lockfile is not in this diff[1,0)and[10,9)invalid intervals; both negative-transcript strands remain transcript-relativecargo test --offline --locked -p mod_kit bedmethyl_util::subcommands::tests::map_to_genome_composes_coordinates_and_strands -- --exact --test-threads=1cargo test --offline --locked -p mod_kit -- --test-threads=1cargo test --offline --locked -p modkit --test test_bedmethyl_util -- --test-threads=1cargo test --offline --workspace --all-targets -- --test-threads=1on the frozen exact headfaec651a64d16ac971cf19b82321c3809dfa34d28e4f7977e78f3d276916e7edto679f14e162ff8809d54d19b701f6d01543fa2400bcfed99316671b82d765170f; negative output changed fromcc357b2588e711ecc4d84c2372e48f06abc0ce8aa8b945140b403687d8b3d7e6tof15c5dd598081bcf68215db175cf4337a98a202db962e019acd96eb67fc74f06+,-,.rustfmt --edition 2021 --checkon both changed Rust files;git diff --check upstream/master...HEAD; clean-worktree checkTests not performed
cargo clippywas not run.Scientific validation
[g, g+1); genomic strand is transcript strand composed with row strand.Output and compatibility
Reviewer guide
map_to_genome_composes_coordinates_and_strandsfor the complete nine-case oracle.map_bedmethyl_line_to_genomefor checked interval construction and three-way strand composition.Checklist