szpiech / selscan

Haplotype based scans for selection
GNU General Public License v3.0
109 stars 33 forks source link

norm: --crit-percent command not working? #24

Closed gabyrech closed 7 years ago

gabyrech commented 7 years ago

Hi! I was trying to normalize my ihs values using the "--crit-percent" parameter for finding the SNPs in the most extreme tails. First question is, if a SNP has a extreme value we expect to have a "1" in the last column, right? If this the case, while testing different --crit-percent values (0.5, 0.10, ...., 0.90, 0.95, 0.99) I found that there were no differences in the number of 'extreme' SNPs, so this parameter seems to be not working. Also I found that all SNPs having the "1" in the last column are those with iHS > 2, so I guess that the default "--crit-val" is actually the one being applied. My command is:
$ norm --ihs --files SNPs.ihs.out --bins 10 --crit-percent 0.95 Any idea of what is going on? Thanks!

szpiech commented 7 years ago

Oh, wow, yes that's definitely a dumb bug on my part. This should now be fixed on the devel branch, but you'll have to re-compile the binary.

gabyrech commented 7 years ago

Hi Zachary, Thanks your reply. I downloaded the devel branch and compiled the code again, but the norm still working in the same way. BTW, It is also possible to obtain the critical "cutoff" values that norm is using for classifying an iHS value as "extreme". Thanks!

szpiech commented 7 years ago

Hmm, well I went back and checked a few things, and I missed the --xpehh section, which is now fixed and uploaded to the devel branch.

I've also now tested this on my end, and it appears to work. If you use --crit-percent 0.05 you should get approximately +/- 2 as the cutoffs. Let me know if it continues to give you trouble. The norm --help message should give you v1.1.0b.

szpiech commented 7 years ago

As an example, if you go into the examples folder and run (with the new norm, which you'll have to compile) norm --ihs --files example.ihs.out --crit-percent 0.01 you should get a message to stdout and the logfile that Top cutoff: 2.49423 Bottom cutoff: -2.5958.

gabyrech commented 7 years ago

Thank you very much Zachary! Now is working! Best!