From 7cba23a2a3c9f5326e1a99964c730a8eb3a8f62c Mon Sep 17 00:00:00 2001 From: Gerardo Tauriello <gerardo.tauriello@unibas.ch> Date: Wed, 5 Jul 2017 15:23:33 +0200 Subject: [PATCH] SCHWED-1786: improved example for QSscorer. --- modules/mol/alg/pymod/qsscoring.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/mol/alg/pymod/qsscoring.py b/modules/mol/alg/pymod/qsscoring.py index 95e25df8a..c37178e82 100644 --- a/modules/mol/alg/pymod/qsscoring.py +++ b/modules/mol/alg/pymod/qsscoring.py @@ -27,20 +27,22 @@ class QSscorer: .. code-block:: python - from ost import io, LogScript + import ost from ost.mol.alg import qsscoring - # load two structures - ent_1 = io.LoadPDB('4ux8', remote=True) - ent_2 = io.LoadPDB('3fub', remote=True) + # 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 score + ost.PushVerbosityLevel(3) try: qs_scorer = qsscoring.QSscorer(ent_1, ent_2) - LogScript('QSscore:', str(qs_scorer.global_score)) - LogScript('Chain mapping used:', str(qs_scorer.chain_mapping)) + ost.LogScript('QSscore:', str(qs_scorer.global_score)) + ost.LogScript('Chain mapping used:', str(qs_scorer.chain_mapping)) except qsscoring.QSscoreError as ex: - # default handling: QS score failed! - LogError('QSscore failed: ...') + # default handling: report failure and set score to 0 + ost.LogError('QSscore failed:', str(ex)) qs_score = 0 For maximal performance when computing QS scores of the same entity with many -- GitLab