Skip to content

Unify Giraffe and vg surject surjection - #5025

Merged
adamnovak merged 15 commits into
masterfrom
giraffe-surject-paired-fail
Aug 31, 2026
Merged

Unify Giraffe and vg surject surjection#5025
adamnovak merged 15 commits into
masterfrom
giraffe-surject-paired-fail

Conversation

@adamnovak

@adamnovak adamnovak commented Aug 27, 2026

Copy link
Copy Markdown
Member

Changelog Entry

To be copied to the draft changelog by merger:

  • vg giraffe and vg surject now surject paired-end reads with the same code.

Description

This fixes #4563 by making vg surject and the SurjectingAlignmentEmitter used by vg giraffe do all their pair surjection with the same function, instead of two implementations with two different notions of how to set up supplementaries or match up surjection results. I'm stealing it off of SurjectingAlignmentEmitter and putting it on Surjector.

I'm also running paired-end multipath surjection through this function, since it had yet a third implementation of this. This makes the function really complex, but it does ensure that we can't end up doing things weirdly differently depending on alignment format.

The behavior of all 3 modes is going to change. The new behavior is probably more right (it finds paths and strands that we have both reads on, picks the best scoring multi-surjection on each path strand, and then the path strand with the best 2 of those), but it's still not really right because it doesn't e.g. match up surjections according to fragment length, and when we don't have a pair on the same path and strand we just pick the first result for each read.

@Sagorikanag has code that should obviate almost all of this, and properly handle the notion of a surjection of a pair, but I can't merge it yet.

faithokamoto and others added 15 commits August 23, 2026 16:14
`vg giraffe --output-format bam` can make properly paired output, and this is under test https://github.com/vgteam/vg/blob/fd49b9a9040716197f3b23521e14ca29e547fbb7/test/t/50_vg_giraffe.t#L204-L209

`vg surject` can make properly paired output from `vg map`'s GAMs, and this is under test https://github.com/vgteam/vg/blob/fd49b9a9040716197f3b23521e14ca29e547fbb7/test/t/15_vg_surject.t#L117-L124

However, if you do `vg giraffe` to get a GAM, and then do `vg surject` on that GAM, the resulting BAM output will not be properly paired. This is documented in #4563 and I can easily reproduce the behavior, though I have no idea why it's happening. Here I've just made a unit test which fails.
though honestly it should auto-detect
…ary surjection handling together so they can't disagree
@adamnovak
adamnovak merged commit 3a37aa3 into master Aug 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BAM flags inconsistent when running 'giraffe->BAM' compared to 'giraffe->GAM->surject->BAM'

2 participants