Commit 0fa5563
fix(chain): count decoy hits in fillMemCollection (decoy/transcript equal footing)
findOptChain early-returns `if (maxHits == 0)` and builds no chains. maxHits came
from fillMemCollection, which returned `maxNonDecoyHits` — the max MEM-hit count
over *non-decoy* references only. A mate that maps ONLY to a decoy (e.g. the
intronic mate of a genomic / pre-mRNA fragment, which maps uniquely to the genome
and to no transcript) therefore returned 0 and was given no chains at all. It
could never form the concordant decoy pair its (exonic) mate participates in, so
the genomic fragment leaked through as a spurious single-mate transcript orphan
instead of being attributed to the decoy.
Count hits over ALL references (transcript and decoy) so the two are chained on
equal footing — matching the salmon Rust implementation, whose chaining/consensus
considers decoy and transcript candidates together. At the default
FILTER_AFTER_CHAINING policy the only behavioral change is that decoy-only mates
are now chained (and can pair); transcript-only reads are unaffected.
Validated on SRR1039508 + GRCh38 decoy index: a fragment with one exonic mate
(maps to transcript+genome) and one intronic mate (genome only) now forms the
concordant genome pair and is correctly counted as decoy. On the 3M-read subset
C++ goes from 94.019% mapped / 42,044 decoy to 93.742% / 154,800 — matching the
Rust port's 93.749% / 154,284 (was a 0.27-pt over-report of transcript mappings).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7JMur5DmDpECddErpi2JS1 parent 41a9245 commit 0fa5563
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
75 | 85 | | |
76 | 86 | | |
77 | 87 | | |
| |||
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
107 | | - | |
| 117 | + | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
112 | | - | |
| 122 | + | |
| 123 | + | |
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
| |||
0 commit comments