diff --git a/actions/ost-compare-ligand-structures b/actions/ost-compare-ligand-structures index e8af175af2aa41f6c922165f901f9f917e7713c4..dd82320f1a0011ae9b34be425d49427c6cb0ab3b 100644 --- a/actions/ost-compare-ligand-structures +++ b/actions/ost-compare-ligand-structures @@ -56,6 +56,7 @@ and "unassigned_reference_ligands". import argparse import json import os +import sys import traceback import ost @@ -295,6 +296,16 @@ def _ParseArgs(): return parser.parse_args() +def _CheckCompoundLib(): + clib = ost.conop.GetDefaultLib() + if not clib: + ost.LogError("A compound library is required for this action. " + "Please refer to the OpenStructure website: " + "https://openstructure.org/docs/conop/compoundlib/.") + sys.tracebacklimit = 0 + raise RuntimeError("No compound library found") + + def _GetStructureFormat(structure_path, sformat=None): """Get the structure format and return it as "pdb" or "mmcif". """ @@ -580,6 +591,7 @@ def _Process(model, model_ligands, reference, reference_ligands, args): def _Main(): args = _ParseArgs() + _CheckCompoundLib() ost.PushVerbosityLevel(args.verbosity) try: # Load structures diff --git a/actions/ost-compare-structures b/actions/ost-compare-structures index 56b040fb37b2aa8aca3dcf4489896d1daa419e20..6cb962d5278a32a527246c24c59f90814077369c 100644 --- a/actions/ost-compare-structures +++ b/actions/ost-compare-structures @@ -80,6 +80,7 @@ ost compare-structures -m model.pdb -r reference.cif -c A:B B:A import argparse import os import json +import sys import traceback import math @@ -526,6 +527,15 @@ def _ParseArgs(): return parser.parse_args() +def _CheckCompoundLib(): + clib = ost.conop.GetDefaultLib() + if not clib: + ost.LogError("A compound library is required for this action. " + "Please refer to the OpenStructure website: " + "https://openstructure.org/docs/conop/compoundlib/.") + sys.tracebacklimit = 0 + raise RuntimeError("No compound library found") + def _RoundOrNone(num, decimals = 3): """ Helper to create valid JSON output """ @@ -852,6 +862,7 @@ def _Process(model, reference, args, model_format, reference_format): def _Main(): args = _ParseArgs() + _CheckCompoundLib() try: compute_cad = args.cad_score or args.local_cad_score if compute_cad and not args.residue_number_alignment: