Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mem] reads are not labelled as proper pair #397

Open
ftian9 opened this issue Aug 7, 2023 · 0 comments
Open

[mem] reads are not labelled as proper pair #397

ftian9 opened this issue Aug 7, 2023 · 0 comments

Comments

@ftian9
Copy link

ftian9 commented Aug 7, 2023

In bwa mem, when the insertion size cutoff is set as [a, b] (using the -I option), only the reads with the insertion size of [a + 1, b + 1] will have the change to be labeled with "proper pair" (flag 2).

Reason:
The dist variable (the distance between R1 and R2 starting position) instead of the insertion size was used to compare with the cutoff.
https://github.com/lh3/bwa/blob/master/bwamem_pair.c#L239-L242

Solution:
From:

if (dist > pes[dir].high) break;
if (dist < pes[dir].low)  continue;

To:

if (dist + 1 > pes[dir].high) break;
if (dist + 1 < pes[dir].low)  continue;
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

No branches or pull requests

1 participant