File: test_docker.py

package info (click to toggle)
openstructure 2.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,240 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (35 lines) | stat: -rw-r--r-- 1,050 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
import ost
from ost.mol.alg import scoring, qsscoring
from ost import conop

print("This is OpenStructure version " + ost.__version__)

lib = conop.GetDefaultLib()
if lib is not None:
    print("You have a valid compound library, last updated on " +
            lib.GetCreationDate())
else:
    ost.LogError("No compound library set as default!")
    print("The compound library is not working properly!")

# load two biounits to compare
ent_full = ost.io.LoadPDB('3ia3', remote=True)
ent_1 = ent_full.Select('cname=A,D')
ent_2 = ent_full.Select('cname=B,C')

# get scores
ost.PushVerbosityLevel(3)    

try:
    scorer = scoring.Scorer(ent_1, ent_2)
    ost.LogScript('lDDT:', str(scorer.lddt))
    ost.LogScript('QSscore:', str(scorer.qs_global))
    ost.LogScript('Chain mapping used:', str(scorer.mapping.GetFlatMapping()))
except Exception as ex:
    # default handling: report failure and set score to 0
    ost.LogError('Scoring failed:', str(ex))
    qs_score = 0
    print("OST is not working properly!")
else:
    print("OST is working!")