Skip to content

preserve mate position 1 when iterating over BAM - #437

Open
rpinho wants to merge 4 commits into
daler:masterfrom
rpinho:fix-bam-mate
Open

rpinho wants to merge 4 commits into
daler:masterfrom
rpinho:fix-bam-mate

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown

This fixes the mate position (PNEXT) when iterating over a BAM file.

pysam uses -1 for no mate position, and 0 for the first base. The code used 0 as no mate position too. So with the mate at position 1, it's 0, not 1.

Now, only -1 is no mate position. I added a test for this: a SAM pair with one mate at position 1, as a BAM.

I'm doing this with AI agents. A separate referee agent on a different model did it again, and it did not get the code of the agent that found it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

This branch has not been deployed

No deployments
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.

1 participant