hardingnj / xpclr

Code to compute the XP-CLR statistic to infer natural selection
MIT License
85 stars 26 forks source link

Quite different results against with Chen's XPCLR programming #64

Open QianXiaobo opened 3 years ago

QianXiaobo commented 3 years ago

Hi Hardingnj, I wanna calculate xpclr score within 200K non-overlapping windows (just like some papers mentioned), so I set the parameters as following:

xpclr --format txt --map chr1.map --popA ref.geno --popB obj.geno --chr 1 --ld 0.95 --phased --maxsnps 600 --size 200000 --step 200000 --out OUTFILE

And command of Chen's XPCLR is as following:

XPCLR -xpclr obj.geno ref.geno chr1.map OUTFILE -w1 0.002 600 200000 1 -p1 0.95

I am not sure that -w1 0.002 600 200000 in command of Chen's XPCLR means '200K non-overlapping windows' or not.

I compared the results from above two methods, result of recode xpclr seems that xpclr scores is small (most of all smaller than 5) and even equal to zero, while the other gets the normal xpclr score (most of which > 50). According to published papers' results, I think xpclr score will be extremely large like 500 or more if there is difference and diversity in two population. So my question is why the results of two methods looks so different?

Hope for your reply.

XB Qian

hardingnj commented 3 years ago

Thanks. When you say the xpclr score- do you mean in all windows, or just where you think the selection is? Can you post the correlation of the 2 values?

You may not be comparing like with like- XPCLR is normalised, so the mean should be close to 0 across a chromosome.

QianXiaobo commented 3 years ago

Thank you for your reply. I mean xpclr score within the loci or region under selection should be significantly large. And I used the xpclr score by Chen's xpclr to determine where is under selection, while I got zero or much small score in these selection regions using python xpclr. I think you are confused by my words "while the other gets the normal xpclr score" , it means the score at a normal condition but normalized score. QAQ

biozzq commented 3 years ago

@QianXiaobo @hardingnj

Have you figured it out why they are different? Thank you.

Best. Zheng zhuqing

hardingnj commented 3 years ago

Happy to look into this- but I need the example data