Hello everyone,
I am currently trying to calculate Dxy per site values from ANGSD output to make a manhattan plot. I have come across this script on ngsPopGen that calculates Dxy using mafs files from ANGSD. I got a strange plot running this script (attached file), I am unsure why I got this.
I took a closer look at calcDxy.R and it calculates Dxy using (knownEM.x*(1-knownEM.y))+(knownEM.y*(1-knownEM.x). I think KnownEM.x and KnownEM.y are the major/minor frequency of population x and y.
I then test this formula out with some numbers:
scenario 1:
Major/minor allele frequency of population x =0.5
Major/minor allele frequency of population y =0.5
Dxy = 0.5*(1-0.5)+0.5*(1-0.5) = 0.5
scenario 2:
Major/minor allele frequency of population x =0.9
Major/minor allele frequency of population y =0.1
Dxy = 0.9*(1-0.9) + 0.1*(1-0.1) = 0.18
Why did the Dxy values for a more differentiated population come out so low? I am unsure how else to interpret this script.
Any help on this script and getting Dxy per site plot via ANGSD output is greatly appreciated. Thanks!
I am currently trying to calculate Dxy per site values from ANGSD output to make a manhattan plot. I have come across this script on ngsPopGen that calculates Dxy using mafs files from ANGSD. I got a strange plot running this script (attached file), I am unsure why I got this.
I took a closer look at calcDxy.R and it calculates Dxy using (knownEM.x*(1-knownEM.y))+(knownEM.y*(1-knownEM.x). I think KnownEM.x and KnownEM.y are the major/minor frequency of population x and y.
I then test this formula out with some numbers:
scenario 1:
Major/minor allele frequency of population x =0.5
Major/minor allele frequency of population y =0.5
Dxy = 0.5*(1-0.5)+0.5*(1-0.5) = 0.5
scenario 2:
Major/minor allele frequency of population x =0.9
Major/minor allele frequency of population y =0.1
Dxy = 0.9*(1-0.9) + 0.1*(1-0.1) = 0.18
Why did the Dxy values for a more differentiated population come out so low? I am unsure how else to interpret this script.
Any help on this script and getting Dxy per site plot via ANGSD output is greatly appreciated. Thanks!