Biskit :: Dock :: Docker :: Docker :: Class Docker
[hide private]
[frames] | no frames]

Class Docker

source code

Prepare and run a hex docking for one or several models of a receptor and ligand pair. Collect docking results into a growing ComplexList.

The docking runs are started in seperate Threads. External objects can register a method with call_when_done() that is called whenever a docking has finished. The waitForLastHex() method can be called to wait until all currently running dockings are finished.

The models in the 2 given dictionaries might get different chainIds but Docker doesn't save them.


To Do: implement that as JobMaster / JobSlave instead, so that also the Hex-file parsing is distributed.

Instance Methods [hide private]
  __init__(self, recDic, ligDic, recPdb=None, ligPdb=None, comPdb=None, out='hex_%s', soln=512, recChainId=None, ligChainId=None, macDock=None, bin=settings.hex_bin, verbose=1)
str prepareOutFolder(self, fout)
Setup an output folder
PDBModel __setChainID(self, m, ids)
set chaiID for Hex pdb files
dict prepareHexPdbs(self, modelDic, idList, subDir)
create HEX-formatted PDB for each model
(str, str) createHexInp(self, nRec, nLig)
Create a HEX macro file for docking a rec lig pair.
  runHex(self, finp, log=0, ncpu=2, nice=0, host=os.uname() [1])
  countDifferentModels(self, lst)
  doneHex(self, runner)
Do something after hex has finished.
  failedHex(self, runner)
notify of failed hex run.
  waitForLastHex(self)
Return after the last hex thread has finished.
  set_call_when_done(RunThread)
  set_call_when_failed(RunThread)

Method Details [hide private]

__init__(self, recDic, ligDic, recPdb=None, ligPdb=None, comPdb=None, out='hex_%s', soln=512, recChainId=None, ligChainId=None, macDock=None, bin=settings.hex_bin, verbose=1)
(Constructor)

source code 
Parameters:
  • recDic (dict) - receptor dictionary
  • ligDic (dict) - ligand dictionary
  • recPdb (str) - hex-formatted PDB with rec models
  • ligPdb (str) - hex-formatted PDB with lig models
  • comPdb (str) - hex-formatted PDB with com models
  • soln (int) - number of solutions to keep from HEX (default 512)
  • recChainId ([str]) - force chain IDs only for HEX
  • ligChainId ([str]) - force chain IDs only for HEX
  • out (str) - out folder name, will be formatted against date
  • macDock (1|0) - force macro docking ON or OFF (default: size decides)
  • bin (str) - path to HEX binary
  • verbose (1|0) - verbosity level (default: 1)

prepareOutFolder(self, fout)

source code 

Setup an output folder
Parameters:
  • fout (str) - outfile name
Returns: str
out path

__setChainID(self, m, ids)

source code 

set chaiID for Hex pdb files
Parameters:
  • m (PDBModel) - model
  • ids ([str]) - chain id, len(ids) == m.lenChains
Returns: PDBModel
m is changed directly

prepareHexPdbs(self, modelDic, idList, subDir)

source code 

create HEX-formatted PDB for each model
Parameters:
  • modelDic (dict) - model dictionary to be prepared for HEX
  • idList ([str]) - force chain IDs for HEX pdb files
  • subDir (str) - 'rec' or 'lig'
Returns: dict
{ modelNumber : file_name_created, .. }

createHexInp(self, nRec, nLig)

source code 

Create a HEX macro file for docking a rec lig pair.
Parameters:
  • nRec (int) - model number rec in model dictionaries
  • nLig (int) - model number lig in model dictionaries
Returns: (str, str)
macro file name, future out file name
Raises:
  • DockerError - if macro dock option is different from previous call

runHex(self, finp, log=0, ncpu=2, nice=0, host=os.uname() [1])

source code 
Parameters:
  • finp (str) - hex macro file
  • log (1|0) - write log file
  • ncpu (int) - number of cpus to use
  • nice (int) - nice value for HEX job (default: 0)
  • host (str) - host to run jon on

countDifferentModels(self, lst)

source code 

doneHex(self, runner)

source code 

Do something after hex has finished. Notify all threads waiting on self.lockMsg

failedHex(self, runner)

source code 

notify of failed hex run.

waitForLastHex(self)

source code 

Return after the last hex thread has finished.

set_call_when_done(RunThread)

source code 

set_call_when_failed(RunThread)

source code