Skip to content

Commit ac09650

Browse files
pinin4fjordsclaude
andcommitted
fix(sjdb): off-by-one on stitch-time acceptor coordinate
The previous commit normalised the DB to genome-absolute 0-based and updated the stats-time query. Stitch-time was left unchanged on the assumption that it already passed genome-absolute 0-based — half right. donor_fwd was correct (first intron base, 0-based) but acceptor_fwd = donor_fwd + del landed on the first base AFTER the intron, while the DB keys store the last intron base. Lookup missed every annotated junction. Subtract 1 from the acceptor to land on the last intron base. After this, Log.final.out Annotated (sjdb) goes from 0 to a non-zero count that's consistent with the annotated=1 row count in SJ.out.tab on the same BAM. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6724959 commit ac09650

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/align/stitch.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,12 +1302,11 @@ fn stitch_align_to_transcript(
13021302
return None;
13031303
}
13041304

1305-
// Check annotation (needed for sjdbScore bonus and finalization check)
13061305
let is_annotated = junction_db.is_some_and(|db| {
13071306
let junc_donor_sa = (donor_sa as i64 + jr_shift as i64) as u64;
13081307
let donor_fwd =
13091308
index.sa_pos_to_forward(junc_donor_sa, cluster.is_reverse, del as usize);
1310-
let acceptor_fwd = donor_fwd + del as u64;
1309+
let acceptor_fwd = donor_fwd + del as u64 - 1;
13111310
db.is_annotated(cluster.chr_idx, donor_fwd, acceptor_fwd, 0)
13121311
|| db.is_annotated(cluster.chr_idx, donor_fwd, acceptor_fwd, 1)
13131312
|| db.is_annotated(cluster.chr_idx, donor_fwd, acceptor_fwd, 2)

0 commit comments

Comments
 (0)