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

Potential bug in LogTool::prob2pl #105

Open
dwuab opened this issue Dec 27, 2019 · 0 comments
Open

Potential bug in LogTool::prob2pl #105

dwuab opened this issue Dec 27, 2019 · 0 comments

Comments

@dwuab
Copy link

dwuab commented Dec 27, 2019

This issue has been raised in hyunminkang/vt-topmed#1, but it seems that vt-topmed is an archive repo.
I found a problem in prob2pl from log_tool.cpp:

uint32_t LogTool::prob2pl(double x)
{
    if (x>1 || x<0)
    {
        std::cerr << "[e] x is not a probability\n";
        exit(1);
    }

    return (uint32_t) (round(-10*std::log10(x)));
}

If x is 0.0, round(-10*std::log10(x)) is inf as expected, but the subsequent conversion to uint32_t make the returned value 0, which is clearly wrong.
This could affect genotype calling. In my case (genotype calling of HG002,HG003,HG004 WES samples from Genome In A Bottle), this results in homozygous ref genotype erroneously called as homozygous alt. To cite an example, see

20      126155  .       GCAAA   G       255     .       AVGDP=363;AC=6;AN=6;AF=1;GC=0,0,3;GN=3;HWEAF=1;HWDGF=1.09424e-09,2.70797e-24,1;IBC=1;HWE_SLP=0;ABE=0.562105;ABZ=2.75288;BQZ=0;CYZ=0.586203;STZ=0.000924303;NMZ=0.254606;IOR=0.998043;NM1=0.0372093;NM0=0.0317044        GT:GQ:AD:DP:PL  1/1:255:255,0:283:0,255,0       1/1:105:255,215:509:255,0,0     1/1:255:255,0:297:0,255,0

where you can see the HG002's PL being 0,255,0, which looks impossible.

dwuab added a commit to dwuab/topmed_freeze3_calling that referenced this issue Dec 30, 2019
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