forked from trgaleev/AlleleSeq2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter_by_pval.py
22 lines (19 loc) · 938 Bytes
/
filter_by_pval.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sys
with open(sys.argv[1], 'r') as infdr:
for line in infdr:
if line.startswith('Target'): pth = float(line.split()[-1])
for line in sys.stdin:
(chr,ref_coord,hap1_coord,hap2_coord,ref_allele,hap1_allele,hap2_allele,cA,cC,cG,cT,cN,
ref_allele_ratio,sum_ref_n_alt_cnts,p_binom,cnv,mmap_log) = line.split('\t')
outcolmns = '\t'.join([
chr,
ref_coord,
ref_allele,
hap1_allele,
hap2_allele,
cA, cC, cG, cT, cN,
ref_allele_ratio,
p_binom
])
if chr == '#chr': sys.stdout.write(outcolmns+'\n')
elif float(p_binom) <= pth: sys.stdout.write(outcolmns+'\n')