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

function ProperOrientation() have a bug? #61

Open
linhxxx opened this issue Jan 14, 2021 · 0 comments
Open

function ProperOrientation() have a bug? #61

linhxxx opened this issue Jan 14, 2021 · 0 comments

Comments

@linhxxx
Copy link

linhxxx commented Jan 14, 2021

Hi, it seems that the function ProperOrientation returns the read pairs in FR. But in the code:

if (b->core.pos < b->core.mpos) {
  return (b->core.flag&BAM_FREVERSE) == 0 && (b->core.flag&BAM_FMREVERSE) != 0 ? true : false;
} else {
  return (b->core.flag&BAM_FREVERSE) == 0 && (b->core.flag&BAM_FMREVERSE) != 0 ? false : true; # here meet a bug?
}

In the "else" part, it return the read pairs in FR, also the FF and RR, as the code only remove the pairs in RF.

It will be better that rewrite it like this?

}else{
return (b->core.flag&BAM_FREVERSE) != 0 && (b->core.flag&BAM_FMREVERSE) == 0 ? true : false;
}

Second, in small insert size data, such as cfDNA data, mpos may == pos. So need add supporting for this situation.

if (b->core.pos < b->core.mpos) {
return (b->core.flag&BAM_FREVERSE) == 0 && (b->core.flag&BAM_FMREVERSE) != 0 ? true : false;
} else if(b->core.pos > b->core.mpos) {
return (b->core.flag&BAM_FREVERSE) != 0 && (b->core.flag&BAM_FMREVERSE) == 0 ? true : false;
}
else{
return (((b->core.flag&BAM_FREVERSE) == 0 && (b->core.flag&BAM_FMREVERSE) != 0) || ((b->core.flag&BAM_FREVERSE) != 0 && (b->core.flag&BAM_FMREVERSE) == 0)) ? true : false;
}

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