|
@@ -13,22 +13,12 @@ if(len(sys.argv)<2):
|
13
|
13
|
"call structure and parameters.")
|
14
|
14
|
else:
|
15
|
15
|
pdb_file = pdb.PDBFile(sys.argv[1])
|
16
|
|
- # print(pdb_file.residues[15].atoms["C"].coord_x)
|
17
|
|
- #print(pdb_file.residues[2].atoms["N"].res_seq_nb, pdb_file.residues[2].atoms["N"].coord_x, pdb_file.residues[2].atoms["N"].coord_y, pdb_file.residues[2].atoms["N"].coord_z)
|
18
|
|
- #print(pdb_file.residues[2].atoms["H"].coord_x)
|
19
|
|
- #print(pdb_file.residues[2].h_bond(pdb_file.residues[40]))
|
20
|
|
- #print(get_turns(pdb_file.residues))
|
21
|
|
- #print(pdb_file.residues[27].h_bond(pdb_file.residues[28]))
|
22
|
|
- #print(get_bridges(pdb_file.residues))
|
23
|
|
-
|
24
|
|
-
|
|
16
|
+
|
25
|
17
|
#turns = get_turns(pdb_file.residues)
|
26
|
18
|
#get_helix(pdb_file.residues, turns)
|
27
|
19
|
#get_bends(pdb_file.residues)
|
28
|
20
|
# get_chirality(pdb_file.residues)
|
29
|
|
- bridges = get_bridges(pdb_file.residues)
|
30
|
|
- ladders = get_ladders(bridges, pdb_file.residues)
|
31
|
|
- sheets = get_sheets(ladders)
|
|
21
|
+
|
32
|
22
|
|
33
|
23
|
# print("NBRIDGES",len(bridges))
|
34
|
24
|
|
|
@@ -36,32 +26,51 @@ else:
|
36
|
26
|
|
37
|
27
|
# get_bonds(pdb_file.residues)
|
38
|
28
|
|
39
|
|
- residues = pdb_file.residues
|
40
|
|
- e_min = 0
|
41
|
|
- for res in residues:
|
42
|
|
- ene = residues[1].h_bond(res)
|
43
|
|
- if ene <= e_min:
|
44
|
|
- e_min = ene
|
45
|
|
- best_res = res
|
|
29
|
+
|
|
30
|
+ # e_min = 0
|
|
31
|
+ # for res in residues:
|
|
32
|
+ # ene = residues[1].h_bond(res)
|
|
33
|
+ # if ene <= e_min:
|
|
34
|
+ # e_min = ene
|
|
35
|
+ # best_res = res
|
46
|
36
|
#print(residues[1].resid, best_res.resid,e_min)
|
47
|
37
|
|
48
|
38
|
#get_phi_psi(residues)
|
49
|
39
|
#print(residues[2].atoms, residues[0].resid, residues[1].resid)
|
50
|
40
|
#print(get_TCO(residues[2],residues[3]))
|
51
|
41
|
|
52
|
|
- for i,res in enumerate(residues):
|
53
|
|
- # res.get_turns(residues, turns)
|
54
|
|
- res.get_helix(residues)
|
55
|
|
- #res.get_bridges(residues)
|
56
|
|
- #res.get_ladders(residues, ladders)
|
57
|
|
- #res.get_sheets(residues)
|
58
|
42
|
|
59
|
|
-for i,ladder in enumerate(ladders.values()):
|
60
|
|
- print(chr(65+i))
|
|
43
|
+# for i,ladder in enumerate(ladders.values()):
|
|
44
|
+# print(chr(65+i))
|
61
|
45
|
|
62
|
|
-for ind, sheet in sheets.items():
|
63
|
|
- print(ind, sheet)
|
64
|
|
- for ladder in sheet:
|
65
|
|
- print(ladder['start'], ladder['end'])
|
|
46
|
+# for ind, sheet in sheets.items():
|
|
47
|
+# print(ind, sheet)
|
|
48
|
+# for ladder in sheet:
|
|
49
|
+# print(ladder['start'], ladder['end'])
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+################### OUTPUT ####################
|
|
53
|
+# print DSSP-style formatted header of PDB file
|
|
54
|
+for elem in pdb_file.get_header() :
|
|
55
|
+ print(pdb_file.get_header()[elem], end="")
|
66
|
56
|
|
|
57
|
+# Get preliminary data for print loop
|
|
58
|
+residues = pdb_file.residues
|
|
59
|
+bridges = get_bridges(residues)
|
|
60
|
+ladders = get_ladders(bridges, residues)
|
|
61
|
+sheets = get_sheets(ladders)
|
67
|
62
|
|
|
63
|
+# iterating over residues
|
|
64
|
+for i,res in enumerate(residues):
|
|
65
|
+ #res.get_turns(residues, turns)
|
|
66
|
+ #res.get_helix(residues)
|
|
67
|
+ kappa = res.get_bends(residues)
|
|
68
|
+ t_co = res.get_tco(residues)
|
|
69
|
+ alpha = res.get_chirality(residues)[0]
|
|
70
|
+ phi = res.get_phi_psi(residues)[0]
|
|
71
|
+ psi = res.get_phi_psi(residues)[1]
|
|
72
|
+ x_ca = res.atoms["CA"].coord_x
|
|
73
|
+ y_ca = res.atoms["CA"].coord_y
|
|
74
|
+ z_ca = res.atoms["CA"].coord_z
|
|
75
|
+ print(i+1, res.resid, res.chain_id, res.res_letter, round(t_co, 3), round(kappa,1),
|
|
76
|
+ round(alpha, 1), round(phi, 1), round(psi,1), round(x_ca,1), round(y_ca,1), round(z_ca,1))
|