ksiewert / BetaScan

Genome-wide scan for balancing selection using beta statistic
27 stars 5 forks source link

Problems encountered in calculating B2 #14

Closed LiShuhang-gif closed 2 years ago

LiShuhang-gif commented 2 years ago

Hi, I'm trying to calculate B2 using Betascan. However, when I did the last step, I encountered the following error:

Traceback (most recent call last):
  File "/public/home/fan_lab/shali/BetaScan/BetaScan/BetaScan.py", line 613, in <module>
    main()
  File "/public/home/fan_lab/shali/BetaScan/BetaScan/BetaScan.py", line 548, in main
    freq = freqCount/sampleN
ZeroDivisionError: float division by zero

The commands I used were basically the same as the tutorials you provided, except that I replaced the file with my own file.

python BetaScan.py -B2 -DivTime 12.5 -i chr22.beta.gz -o chr22.betascores.txt

Any suggestions for this error? I'm looking forward to your reply. Thanks in advance!

ksiewert commented 2 years ago

Hello!Can you check your chr22.beta.gz file and see if there's any SNPs with a sample size of 0? From the error message, I would bet this is what is causing the issue. If there are SNPs with sample size 0, remove them and try running again.