-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateSubNetworks.py
More file actions
85 lines (77 loc) · 2.75 KB
/
Copy pathCreateSubNetworks.py
File metadata and controls
85 lines (77 loc) · 2.75 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import re
import glob
import sys
protos = []
barrels = []
with open("CompCodesE-3.txt", "r") as barrel_codes:
for line in barrel_codes:
line = line.strip().split("\t")
barrels.append(line[0])
if line[1] == "1":
protos.append(line[0])
barrel_sizes = [[] for x in range(27)]
with open("BarrelChars85.txt", "r") as barrel_data:
for line in barrel_data:
if "PDB" not in line:
line = line.split("\t")
if line[0] in protos:
barrel_sizes[ int(line[1]) ].append(line[0])
count = 0
with open("data/AllDataE1_v6_Numbered.txt", "r") as inData:#, open("data/ProtosOnlyE-3_v6_Numbered.txt", "w+") as outData:
for line in inData:
if "Dom1" in line:
#outData.write(line)
continue
else:
line = line.split(" ")
pdb1 = line[1]
pdb2 = line[2]
if float(line[3]) <= 1e-3:
if pdb1 in protos and pdb2 in protos:
#utData.write(" ".join(line))
count += 1
else:
continue
print(count)
"""cutoff1 = 1e-3
cutoff2 = 1e-3
for x in range(8, 23):
for y in range(x+1, 23):
print(x, y)
keep_lines = []
with open("data/AllDataE1_v6_Numbered.txt", "r") as inData:
for line in inData:
if "Dom1" in line:
keep_lines.append(line.strip().split(" "))
else:
line = line.strip().split(" ")
pdb1 = line[1]
pdb2 = line[2]
if float(line[3]) <= cutoff1:# and float(line[3]) > cutoff2:
#if "3wi4_A" in line[2]: print(line)
if pdb1 in barrel_sizes[x] and pdb2 in barrel_sizes[y]:
keep_lines.append(line)
elif pdb1 in barrel_sizes[y] and pdb2 in barrel_sizes[x]:
keep_lines.append(line)
else:
continue
if len(keep_lines) > 1:
print(x, y)
with open("data/BySize/%s_%s_E-3.txt"%(x, y), "w+") as subnetwork:
for value in keep_lines:
subnetwork.write("\t".join(value) + "\n")
"""
"""cutoff = 1e-3
count = 0
with open("data/AllDataE20_v6_Numbered.txt", "r") as inData:
for line in inData:
if "Dom1" in line:
keep_lines.append(line.strip().split(" "))
else:
line = line.strip().split(" ")
pdb1 = line[1]
pdb2 = line[2]
if pdb1 in protos and pdb2 in protos and float(line[3]) <= cutoff and float(line[10]) >= 75:
count += 1
print(count)
"""