Skip to content

Commit

Permalink
update code to Hex v. 8.0; still some issues (#26, #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
graik committed Aug 2, 2018
1 parent 8be2eac commit d2d4965
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion biskit/dock/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def dry_or_wet_run( self, run=True ):
# dock rec 1 vs. lig 2 on localhost
fmac1, fout = self.d.createHexInp( 1, 1 )
if run:
self.d.runHex( fmac1, log=1, ncpu=4, host='localhost' )
self.d.runHex( fmac1, log=1, ncpu=6, host='localhost' )

self.d.waitForLastHex()

Expand Down
9 changes: 6 additions & 3 deletions biskit/dock/hexparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, hexFile, rec_dic, lig_dic, forceModel=None):
self.lig_models = lig_dic
self.forceModel = forceModel
## pattern for analyzing single line of type "Value: -1.23":
self.ex_line = re.compile("^(\S+):\s*([-0-9\.\s]*)")
self.ex_line = re.compile("^(\S+):\s*(nan|[-0-9\.\s]*)")
## pattern to find one line of transformation matrix
self.ex_matrix = re.compile("([-0-9]+\.[0-9]+e[-+0-9]+)")

Expand Down Expand Up @@ -127,6 +127,8 @@ def nextComplex(self):
i['hex_etotal'] = float(m[1])
elif m[0] == 'Eshape':
i['hex_eshape'] = float(m[1])
elif m[0] == 'Eair':
i['hex_eair'] = float(m[1])
elif m[0] == 'LigandMatrix':
## get all numbers of matrix as list of strings
strings = self.ex_matrix.findall( l )
Expand Down Expand Up @@ -204,7 +206,7 @@ def test_hexParser(self):
rec_dic = t.load( t.testRoot() + "/dock/rec/1A2P_model.dic" )
lig_dic = t.load( t.testRoot() + "/dock/lig/1A19_model.dic" )

self.h = HexParser( t.testRoot() + "/dock/hex/1A2P-1A19_hex.out",
self.h = HexParser( t.testRoot() + "/dock/hex/1A2P-1A19_hex8.out",
rec_dic, lig_dic)

c_lst = self.h.parseHex()
Expand All @@ -217,7 +219,8 @@ def test_hexParser(self):

self.assertSetEqual( set(c_lst[1].info.keys()),
set(['soln', 'rms', 'hex_clst', 'hex_eshape',
'model2', 'model1', 'hex_etotal', 'date']) )
'model2', 'model1', 'hex_etotal', 'hex_eair',
'date']) )

if __name__ == '__main__':

Expand Down
3 changes: 1 addition & 2 deletions biskit/testdata/dock/generate_pickles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import biskit.tools as T
import biskit.dock.hexparser as H

## generate PDBModel and model dictionary pickles for receptor and ligand
rec = B.XplorModel(source='rec/1A2P_clean.pdb', fPsf='1A2P.psf', pdbCode='1A2P')
rec.saveAs('rec/1A2P.model')

Expand All @@ -17,7 +16,7 @@
T.dump(lig_dic, 'lig/1A19_model.dic')

## generate complex list from Hex docking result for this rec and lig
h = H.HexParser('hex/1A2P-1A19_hex.out', rec_dic, lig_dic)
h = H.HexParser('hex/1A2P-1A19_hex5.out', rec_dic, lig_dic)
c_lst = h.parseHex()

T.dump(c_lst, 'hex/complexes.cl')
3 changes: 1 addition & 2 deletions scripts2/Dock/hex2complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def setOptions():

o.setTest( lig= osp.join(f, 'dock/lig/1A19_model.dic'),
rec= osp.join(f, 'dock/rec/1A2P_model.dic'),
hex= osp.join(f, 'dock/hex/1A2P-1A19_hex.out'),
hex= osp.join(f, 'dock/hex/1A2P-1A19_hex5.out'),
o= osp.join(ftemp, 'complexes.cl'),
p= 0,
fsuccess=testSuccess )
Expand Down Expand Up @@ -153,7 +153,6 @@ def plot( complex_lst ):
def main( o ):
"""@param o: options dictionary"""

## load pickeled model dictionaries with XplorModels indexed by hex model
## number
rec_lst = load( o['rec'] )
lig_lst = load( o['lig'] )
Expand Down

0 comments on commit d2d4965

Please sign in to comment.