Skip to content

Commit

Permalink
updated biostat
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengzhenxian committed Jul 5, 2024
1 parent 19188ae commit 70b1cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/cnv_germline_tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@

from argparse import ArgumentParser
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__))))
from shared.vcf import VcfReader
from src.sort_vcf import compress_index_vcf
from numpy import *
from scipy.stats import binomtest

file_directory = os.path.dirname(os.path.realpath(__file__))
entry_path = os.path.join(file_directory, 'verdict')
Expand Down
10 changes: 5 additions & 5 deletions src/verdict/tag_germline_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import subprocess
from src.sort_vcf import compress_index_vcf
from numpy import *
from scipy.stats import binomtest
from scipy.stats import binom_test

import random
from time import time
Expand Down Expand Up @@ -94,14 +94,14 @@ def tag_germline_variant(args):
P_G1 = P_G2 = P_S1 = P_S2 = 0
AF_G1 = (p * M + 1 * (1 - p)) / (p * C + 2 * (1 - p) + sys.float_info.epsilon)
AF_S1 = (p * M + 0 * (1 - p)) / (p * C + 2 * (1 - p) + sys.float_info.epsilon)
P_G1 = binomtest(round(depth * frequency), depth, AF_G1).pvalue
P_S1 = binomtest(round(depth * frequency), depth, AF_S1).pvalue
P_G1 = binom_test(round(depth * frequency), depth, AF_G1).pvalue
P_S1 = binom_test(round(depth * frequency), depth, AF_S1).pvalue
if M != C - M:
AF_G2 = (p * (C - M) + 1 * (1 - p)) / (p * C + 2 * (1 - p) + sys.float_info.epsilon)
P_G2 = binomtest(round(depth * frequency), depth, AF_G2).pvalue
P_G2 = binom_test(round(depth * frequency), depth, AF_G2).pvalue
if C - M != 0:
AF_S2 = (p * (C - M) + 0 * (1 - p)) / (p * C + 2 * (1 - p) + sys.float_info.epsilon)
P_S2 = binomtest(round(depth * frequency), depth, AF_S2).pvalue
P_S2 = binom_test(round(depth * frequency), depth, AF_S2).pvalue
else:
AF_S2 = P_S2 = nan
else:
Expand Down

0 comments on commit 70b1cf8

Please sign in to comment.