1 from ost
import settings
2 from ost
import bindings
11 hhblits_bin = settings.Locate(
'hhblits')
13 raise RuntimeError(
'Tried to determine HHblits version string which '\
14 'requires the hhblits binary to be in your path. '\
18 proc = subprocess.run([hhblits_bin,
'-h'], stdout=subprocess.PIPE)
23 version_line = re.search(
r'HHblits[^\n]+\d+\.\d+\.\d+', proc.stdout.decode())
24 if version_line
is not None:
25 version = re.search(
r'\d+\.\d+\.\d+', version_line.group())
26 if version
is not None:
27 version_string = version.group()
33 if hhblits_version_string
is None:
34 raise RuntimeError(
'Could not determine HHblits version. Please '\
35 'import the hhblits2 or hhblits3 binding explicitely.')
37 hhblits_version = int(hhblits_version_string.split(
'.')[0])
39 if hhblits_version == 2:
41 elif hhblits_version == 3:
44 raise RuntimeError(
'Determined HHblits version to be %i. OpenStructure '\
45 'only supports 2 or 3. If you think the detected '\
46 'version is wrong and you have version 2 or 3, '\
47 'import the hhblits2 or hhblits3 binding explicitely.'\
def GetHHblitsVersionString()