Repository navigation
Fix bugs in masking, consensus, window joins and output - #95
Open
traviswheeler wants to merge 1 commit into
Open
traviswheeler wants to merge 1 commit into
traviswheeler wants to merge 1 commit into
Conversation
Masking (mask.cpp, main.cpp): - --mask masked a record that had no repeats, using the previous record's regions, when that record's last repeat ran to its end. - The masker counted only ACGTN as positions, while the reader counts every alphanumeric byte and skips ';' lines. Masks landed on the wrong positions after IUPAC codes, digits or comment lines. - The first base of a region stayed unmasked when only a run of N separated it from the previous region. - --mask with a path that could not be opened segfaulted. It now prints an error and exits 255. Repeats (repeat.cpp): - CreateLogo did not advance its column counter past a deletion in the previous copy, so each deletion shifted the later copies by one consensus column. It now advances and counts the skipped bases. - joint_repeat_region cut the joined repeat short when the second repeat ended inside the first. - joint_repeat_region appended the second repeat's split positions without moving them to that repeat's place in the joined repeat. - StoreScores took the parent of the current column's cell where the previous column's cell looks intended. Only PositionScoreDeltas reads these values. Output and options: - JSON LogoNumbers wrote its first entry twice. - With --max_consensus 0, TSV rows had no Consensus column although the header did. - The --acgt sum check called the integer abs, so any sum between 0 and 2 passed. - Annotation coverage counted the overlap between repeats twice, because OutputRepeat compared read ids with a counter that was never updated. - examples/library_example.cpp passed its options without a program name, so -p was ignored. Implemented with assistance from Claude (Fable 5.2)
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.
This fixes thirteen bugs in 1.2.2, found while porting ULTRA to Rust.
Masking (
mask.cpp,main.cpp)--maskmasked a record that had no repeats, using the previous record's regions, when that record's last repeat ran to its end.ACGTNas positions, while the reader counts every alphanumeric byte and skips;lines. Masks landed on the wrong positions after IUPAC codes, digits or comment lines.Nseparated it from the previous region.--maskwith a path that could not be opened segfaulted. It now prints an error and exits 255.Repeats (
repeat.cpp)CreateLogodid not advance its column counter past a deletion in the previous copy, so each deletion shifted the later copies by one consensus column. It now advances (p += bdesc.indelNumber) and counts the skipped bases in the columns they belong to.joint_repeat_regioncut the joined repeat short when the second repeat ended inside the first.joint_repeat_regionappended the second repeat's split positions without moving them to that repeat's place in the joined repeat.StoreScorestook the parent of the current column's cell where the previous column's cell looks intended. OnlyPositionScoreDeltas(--show_delta) reads these values.Output and options
LogoNumberswrote its first entry twice (JSONFileWriter.cpp).--max_consensus 0, TSV rows had no Consensus column although the header did (TabFileWriter.cpp).--acgtsum check called the integerabs, so any sum between 0 and 2 passed (cli.cpp).OutputRepeatcompared read ids with a counter that was never updated (ultra.cpp,ultra.hpp).examples/library_example.cpppassed its options without a program name, so-pwas ignored.What was checked
make examplesruns. The format check adds no warnings under clang-format 23.CreateLogo: for 24 copies ofACGGTCATTGwith four 1-bp deletions, 1.2.2 reports the consensusGGGGGTTTTTand this branch reportsACGGTCATTG.-t 8, 1.2.2 reportedseq1 599916-601237as599916-600000in 4 of 6 runs, and this branch in 0 of 6.Known limits
CreateLogochange is right when the deletion is real. When the model calls a deletion in a copy that is full length, the old code is back in phase one period later and the new code is not; that reading comes from one case traced by hand. In a simulation of arrays mutated from a master unit, the consensus became an exact rotation of the unit in 462 arrays and stopped being one in 49. Nobody has reviewed the simulator code.-t > 1can still differ from-t 1. In 3 of the 6 runs above, the joined repeat had the right coordinates and score, but its consensus differed from the-t 1consensus by one base. This PR does not address that.Implemented with assistance from Claude (Fable 5.2)