-
Notifications
You must be signed in to change notification settings - Fork 7
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
How to get p values for significant LD? #51
Comments
It might be because of low allele frequencies; did you check sites with higher frequencies?
I can see what you mean, but it is possible for Dprime to be
Outputting the final log likelihood has not been fully implemented yet, so that is just a place holder (for now). |
Just noted that
These frequencies are actually quite high in this data. I'm not that familiar with C code. But, actually, if I look here: https://github.com/fgvieira/ngsLD/blob/afb35a355cc28926c1588ab8a643c0e65941f579/ngsLD.cpp#L330C1-L332C1 Shouldn't the frequency be maf1 mfa2 and 1-maf1 and 1-maf2? This is an attempt to calculate the expected heterozygotes and from the R^2
So it seems that maf1 and maf2 are PA, PB, Pa and Pb. But later in the frequency calculation, it uses the genotype frequencies (h00, h01, h10, h11). Maybe I'm misunderstanding something here, but it seems that there is a variable misplaced here. Is that correct? Edit: No it's the same! so no problem here! |
I was curious in looking at the raw beagle file and try to get a sense of the allele frequency in the file. Basically, I wrote a naive (without model) script that finds the maximum probability for each genotype in each individual. When there is a 0.5 0.5 probability, I just take a random one (I only had a few). I then used the genotypes to get the number of each allele and divide by the total number of alleles (nb of individuals*2).
But when I look at the MAF from the ngsLD output file, I have "maf2 = 0.026971" for the same position... check line 8 for "chr8:33199177". How could that be? |
Can you send a small example beagle file so I can reproduce your results? |
I sent the data over email. |
I ran something like this:
And now have a .ld file with the chi2 column.
I loaded the file, in R, and got:
Basically, all the positions that have significant LD have r2 = 0. Not sure if I'm doing something incorrect here.
Here's a glimpse at the output
Also, why sometimes D' is =1 when r2 is =0 ? And at other times, D' is =0 and r2 is =0... see lines 6, 22, and 30 for example.
I'm wondering if there is not something odd going on here:
ngsLD/ngsLD.cpp
Line 305 in 7001165
Also, why is the loglike hard coded as '0.0'?
ngsLD/ngsLD.cpp
Line 348 in 7001165
The text was updated successfully, but these errors were encountered: