-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdssp.py
executable file
·51 lines (39 loc) · 1.4 KB
/
dssp.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
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/python3.6
__author__ = "Hélène Kabbech"
import sys
import os
# Implemented modules in /src foler :
sys.path.append(os.path.abspath('src'))
from management import *
from structures import *
import classes
# Biopython :
from Bio.PDB import *
if __name__ == "__main__":
opt = argsParsing() # Input and Output
hydrAddition(opt.input) # Hydrogen addition (*.pdb.H file created)
p = PDBParser(QUIET=True) # QUIET=T : Warnings issued are suppressed
pdb = p.get_structure(opt.input,opt.input+".H")
resList = [] # List of Residue instances
index = 0
for chain in pdb.get_chains():
# First residue of the current chain
first = next(res.id[1] for res in chain.get_residues() if (res.id[1] < 99999))
# Last residue of the current chain
for res in chain.get_residues():
if (res.get_id()[0] != ' '):
break
last = res.get_id()[1]
for resNum in range(first,last+1):
index += 1
r = classes.Residue(chain, index, chain.id, resNum)
r.tco_calculation(chain)
r.kappa_calculation(chain)
r.bend_assignation()
r.alpha_calculation(chain)
r.chirality_assignation()
r.phi_calculation(chain)
r.psi_calculation(chain)
resList.append(r)
resList = SSassignment(resList)
displayResults(opt,pdb,resList)