Commit 3e2f559
fix(map): a concordant decoy pair must not suppress a transcript orphan
The orphan-fallback rule discarded all orphan mappings whenever the fragment had
ANY concordant (proper-pair) mapping — including a concordant pair to a *decoy*
(genome). On a decoy-aware index this silently destroyed transcript evidence: a
fragment that pairs concordantly on the genome but only orphans onto a transcript
(one mate exonic, the other intronic/genomic — extremely common) had its
transcript orphan dropped, leaving only the decoy pair. finalize then saw no
surviving non-decoy mapping (best_valid = None) and classified the fragment as
decoy-dominated. Critically, because best_valid was None, even --allowDecoyOrphans
could not rescue it (that flag only gates the "transcript present but dominated"
branch) — so the flag was effectively a no-op for the dominant decoy-orphan case.
Fix: only a concordant *non-decoy* (transcript) pair suppresses orphans. When the
only concordant pair is to a decoy, keep the transcript orphan(s) too and let the
decoy-domination logic in finalize_mappings_counted adjudicate — default still
drops the decoy-dominated orphan (deny), --allowDecoyOrphans now keeps it.
Default behavior is unchanged (verified byte-identical on SRR1039508 full:
21,488,979 mapped both before and after). --allowDecoyOrphans now works as
intended: on a per-fragment trace of 8,966 such fragments it recovers 8,183 (was
308), matching C++ salmon's orphan handling; on the full sample the ADO rate rises
93.92% -> 94.81%. This is the SA mirror of the sketch-mode decoy-orphan rescue.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7JMur5DmDpECddErpi2JS1 parent a198954 commit 3e2f559
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
303 | 312 | | |
304 | 313 | | |
305 | | - | |
| 314 | + | |
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
| |||
0 commit comments