stats_sfs.py 404B

12345678910111213141516171819202122
  1. from frst import vcf_to_sfs
  2. import math
  3. if __name__ == "__main__":
  4. sfs_folded_hir = {0: 575935, 1: 346313, 2: 220539, 3: 130150, 4: 69989, 5: 33768, 6: 41031}
  5. n = len(sfs_folded_hir.values())
  6. pi = 0
  7. s_prime = 0
  8. for i in range(1, n-1):
  9. pi += i * (n-1) * sfs_folded_hir[i-1] / math.comb(n, 2)
  10. #s_prime += math.comb() * math.comb() / math.comb()
  11. print(pi)