You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement read continuation for unresolved row targets - #10
Builds on unresolved-late-indels. Merge that one first.
What changes
A row whose target lies in an unresolved end is Other: the tag alone cannot tell a gap from substitutions there. Reads longer than the tag show what follows it. generate now uses those bases to decide such a row again.
Read pass: keeps the commonest bases after a tag, for the two canonical tags and for rows whose target is unread. They are stored in the per-sample cache.
Pooling: a tag has a continuation when 3 reads and 60% of its reads carry it.
Decision: the row, the Ref tag and the Alt tag are each read with their own bases after the tag. It is the same decision on a longer window. The answer counts when the window grows by 12 bases or more and reads the added bases with at most 2 substitutions.
Outcome: the gap stands, the substitutions stand, or the row stays unresolved. A settled row is written like any other row.
Not changed: tags, row identity, AlleleSequence, assignment and denoising. A row whose target the tag already reads is never asked. A target that an insertion pushed past the tag stays Other.
QC JSON: gains output_summary.read_continuation with bases_after_tag, rows_settled and reads_settled.
Effect
Three sets of simulated haplotypes:
Rows counted for
Before
After
v0.13
the right allele
91.7%
94.8%
92.2%
the wrong allele
0.14%
0.14%
1.15%
no allele, target unread
3.2%
0.06%
—
Cost
A run takes 4% to 7% longer where reads carry bases after the tag.
The cache grows by 2% to 3%.
The cache format is now 0.6.0. Existing caches are rebuilt once.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
An active moderate issue in madcats.py causes the tag continuation gate to omit the first two eligible reads, producing incorrect minimum-read and 60% share calculations.
Implements read-continuation rescue for unresolved row targets by caching and pooling post-tag bases, re-evaluating eligible rows on extended windows, and reporting continuation-related QC metrics while preserving existing assignment and allele identity behavior.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A moderate active finding remains: the 60% threshold uses a truncated top-three continuation population rather than all reads reaching the window, allowing under-supported continuations to pass and miscalculating downstream counts.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Use all reads reaching the window in the 60% threshold denominator
madcats.py:2823
The 60% test is calculated only over at_length, which is reconstructed from the per-sample top three continuations. Reads of this tag that stop at the tag/selected length, and fourth-or-later continuation sequences discarded by CONTINUATIONS_KEPT, are absent from the denominator, so a continuation can pass this gate even when it is below 60% of the tag's reads (and the same truncated population also drives bases_after_tag). Retain the relevant total/length counts or otherwise include all reads that reach the chosen window when applying the threshold.
…esolved end
A row whose end the tag leaves unresolved is decided again on a longer
window: the row and the Ref and Alt tags, each followed by the commonest
bases the cohort's reads carry after that tag.
- The read pass keeps, per sample, the 3 commonest strings of up to 40
bases after a tag, from the tag's third read on. It keeps them for the
two canonical tags and for rows whose target is unread. They are stored
inside the cache's count entries; the cache format is 0.6.0.
- The kept strings are pooled over the samples. A tag has a continuation
with 3 reads and 60% of the tag's reads.
- The longer window's answer is taken when the window grows by 12 bases
or more, its own end is resolved, and it reads the added bases with at
most 2 substitutions. The answer is cut back to the tag.
- Only a row whose target is unread is asked. A row the tag alone decides
does not change. A row whose target an insertion pushed past the tag
stays Other.
- Category, Variants, MarkerType and primer removal read the one shared
decision. Variants is written from the alignment the row was settled
with, in tables with and without primers.
- Tags, row identity, AlleleSequence, assignment and denoising are
unchanged. Reads that end at the tag give byte-identical tables.
- The summary reports read_continuation: bases_after_tag, rows_settled,
reads_settled.
Simulated haplotypes: 94.82% right, 0.14% wrong allele, 0.06% unread
(before: 91.69%, 0.14%, 3.18%). Pecan settles 149 rows and sweetpotato 45.
A run takes 4% to 7% longer and the cache grows by 2% to 3% where reads
carry bases after the tag.
The classification page said a continuation counts when 3 reads and 60%
of a tag's reads carry it. The read pass keeps continuations from a
tag's third read in a sample on, so a sample's first two reads of a tag
are in neither count. The page now says so.
No code changes. Under the default evidence rule a new row has 10 reads
in each of two samples or 30 in one, so the reads left out never decide
whether it has a continuation.
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
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.
Builds on
unresolved-late-indels. Merge that one first.What changes
A row whose target lies in an unresolved end is
Other: the tag alone cannot tell a gap from substitutions there. Reads longer than the tag show what follows it.generatenow uses those bases to decide such a row again.AlleleSequence, assignment and denoising. A row whose target the tag already reads is never asked. A target that an insertion pushed past the tag staysOther.output_summary.read_continuationwithbases_after_tag,rows_settledandreads_settled.Effect
Three sets of simulated haplotypes:
Cost