File: test-mkdssp.py

package info (click to toggle)
dssp 4.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 752 kB
  • sloc: cpp: 3,246; python: 125; sh: 13; makefile: 9
file content (83 lines) | stat: -rw-r--r-- 2,501 bytes parent folder | download
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
from mkdssp import dssp, helix_type, TestBond
import os
import gzip

file_path = os.path.join("..", "test", "1cbs.cif.gz")

with gzip.open(file_path, "rt") as f:
	file_content = f.read()
 
dssp = dssp(file_content)
 
print("residues: ", dssp.statistics.residues)
print("chains: ", dssp.statistics.chains)
print("SS_bridges: ", dssp.statistics.SS_bridges)
print("intra_chain_SS_bridges: ", dssp.statistics.intra_chain_SS_bridges)
print("H_bonds: ", dssp.statistics.H_bonds)
print("H_bonds_in_antiparallel_bridges: ", dssp.statistics.H_bonds_in_antiparallel_bridges)
print("H_bonds_in_parallel_bridges: ", dssp.statistics.H_bonds_in_parallel_bridges)

count = 0
for res in dssp:
	count += 1
	print(res.asym_id, res.seq_id, res.compound_id)
	print("alt_id", res.alt_id)
	print("compound_letter", res.compound_letter)
	print("auth_asym_id", res.auth_asym_id)
	print("auth_seq_id", res.auth_seq_id)
	print("pdb_strand_id", res.pdb_strand_id)
	print("pdb_seq_num", res.pdb_seq_num)
	print("pdb_ins_code", res.pdb_ins_code)
	print("alpha", res.alpha)
	print("kappa", res.kappa)
	print("phi", res.phi)
	print("psi", res.psi)
	print("tco", res.tco)
	print("omega", res.omega)
	print("is_pre_pro", res.is_pre_pro)
	print("is_cis", res.is_cis)
	print("chiral_volume", res.chiral_volume)
	print("chi", res.chi)
	print("ca_location", res.ca_location)
	print("chain_break", res.chain_break)
	print("nr", res.nr)
	print("type", res.type)
	print("ssBridgeNr", res.ssBridgeNr)
	print("helix(_3_10)", res.helix(helix_type._3_10))
	print("helix(alpha)", res.helix(helix_type.alpha))
	print("helix(pi)", res.helix(helix_type.pi))
	print("helix(pp)", res.helix(helix_type.pp))
	print("is_alpha_helix_end_before_start", res.is_alpha_helix_end_before_start)
	print("bend", res.bend)
	print("sheet", res.sheet)
	print("strand", res.strand)

	for i in range(0, 1):
		(ri, nr, dir) = res.bridge_partner(i)
		if ri != None:
			print("bridge partner ", i, ri.asym_id, ri.seq_id, ri.compound_id, nr, dir)

	for i in range(0, 1):
		(ri, e) = res.acceptor(i)
		if ri != None:
			print("acceptor ", i, ri.asym_id, ri.seq_id, ri.compound_id, e)
			print("test bond: ", TestBond(res, ri))
   	
	for i in range(0, 1):
		(ri, e) = res.donor(i)
		if ri != None:
			print("donor ", i, ri.asym_id, ri.seq_id, ri.compound_id, e)
			print("test bond: ", TestBond(res, ri))

	print("accessibility", res.accessibility)
	break


print("count: ", count)

a = dssp.get('A', 137)
b = dssp.get('A', 6)

print ("a & b", a, b)

assert(TestBond(a, b))