-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmendelian.py
41 lines (39 loc) · 1.47 KB
/
mendelian.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import utilities as util
def flt(vcf_file, output):
vcf, comments = util.readVcf(vcf_file)
for line in vcf:
if line[0] == "#":
output.write("%s"%line)
continue
a = line.split()
tmp = a[9].split(':')
mother = tmp[0]
tmp = a[10].split(':')
father = tmp[0]
tmp = a[11].split(':')
son = tmp[0]
is_filtered = False
if mother == "0/0" and father == "0/0" and son == "1/1":
is_filtered = True
elif mother == "0/0" and father == "0/1" and son == "1/1":
is_filtered = True
elif mother == "0/1" and father == "0/0" and son == "1/1":
is_filtered = True
elif mother == "1/1" and father == "1/1" and son == "0/0":
is_filtered = True
elif mother == "0/1" and father == "1/1" and son == "0/0":
is_filtered = True
elif mother == "1/1" and father == "0/1" and son == "0/0":
is_filtered = True
elif mother == "0/0" and father == "1/1" and son == "0/0":
is_filtered = True
elif mother == "0/0" and father == "1/1" and son == "1/1":
is_filtered = True
elif mother == "1/1" and father == "0/0" and son == "1/1":
is_filtered = True
elif mother == "1/1" and father == "0/0" and son == "0/0":
is_filtered = True
if is_filtered == False:
output.write("%s"%line)
print("Done...")
output.close()