Mercurial > repos > iuc > medaka_variant_pipeline
comparison convert_VCF_info_fields.py @ 10:7623e5888be9 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/medaka commit 0faf0ade3f13d7c78d93869823ea9fdf25c21b13"
author | iuc |
---|---|
date | Thu, 22 Apr 2021 20:24:49 +0000 |
parents | 1040a307be0c |
children | 597407d61386 |
comparison
equal
deleted
inserted
replaced
9:336b3def9b2b | 10:7623e5888be9 |
---|---|
9 | 9 |
10 import sys | 10 import sys |
11 from collections import OrderedDict | 11 from collections import OrderedDict |
12 from math import log10 | 12 from math import log10 |
13 | 13 |
14 from scipy.stats import fisher_exact | 14 import scipy |
15 import scipy.stats | |
15 | 16 |
16 | 17 |
17 def pval_to_phredqual(pval): | 18 def pval_to_phredqual(pval): |
18 try: | 19 try: |
19 ret = round(-10 * log10(pval)) | 20 ret = round(-10 * log10(pval)) |
67 dpspf += sr_list[i] | 68 dpspf += sr_list[i] |
68 dpspr += sr_list[i + 1] | 69 dpspr += sr_list[i + 1] |
69 for j, i in enumerate(range(2, len(sr_list), 2)): | 70 for j, i in enumerate(range(2, len(sr_list), 2)): |
70 dp4 = (sr_list[ref_fwd], sr_list[ref_rev], sr_list[i], sr_list[i + 1]) | 71 dp4 = (sr_list[ref_fwd], sr_list[ref_rev], sr_list[i], sr_list[i + 1]) |
71 dp2x2 = [[dp4[0], dp4[1]], [dp4[2], dp4[3]]] | 72 dp2x2 = [[dp4[0], dp4[1]], [dp4[2], dp4[3]]] |
72 _, p_val = fisher_exact(dp2x2) | 73 _, p_val = scipy.stats.fisher_exact(dp2x2) |
73 sb = pval_to_phredqual(p_val) | 74 sb = pval_to_phredqual(p_val) |
74 | 75 |
75 as_ = (sc_list[ref_fwd], sc_list[ref_rev], sc_list[i], sc_list[i + 1]) | 76 as_ = (sc_list[ref_fwd], sc_list[ref_rev], sc_list[i], sc_list[i + 1]) |
76 | 77 |
77 info = [] | 78 info = [] |