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

Class ContactMaster

source code


Distribute calculations done on all complexes of a ComplexList.

Instance Methods [hide private]
  __init__(self, complexLst, chunks=5, hosts=cpus_all, refComplex=None, updateOnly=0, niceness=nice_dic, force=[], outFile='complexes_cont.cl', com_version=-1, show_output=0, add_hosts=0, verbose=1, log=StdLog())
  __check_models(self, cl)
Perform some checks for models assocciated with ComplexList.
ComplexList __extractVersion(self, cel, com_version=-1)
Get a ComplexList by extracting a specified version (generation) of a ComplexEvolvingList.
  __addSurfaceMasks(self, cl)
Add surface area to rec and lig model if not already there.
  __addSurface(self, m)
Add surface area to model.
  __refMasks(self, refCom, normalCom)
Create residue and atom contact masks for reference complex.
[int], PDBModel __ref_interface(self, RC, NC, res_contacts, mask_rec, mask_lig, bb=0)
Returns atom mask for getting interface from NC.model(), reference interface
  __reduced_refContacts(self)
calculate contact mask of atom-reduced reference complex.
1|0 __toBeUpdated(self, com)
Check if complex is to be updated.
{int:Complex}, ComplexList __complexDic(self, cl)
Collect info about complexes in ComplexList that needs to be updated.
  __create_reduced_models(self, cl, refCom=None)
Create rec and lig models with pooled atoms (ca.
dict getInitParameters(self, slave_tid)
hand over parameters to slave once.
  isFinished(self)
  cleanup(self)
Remove temporary files.
ComplexList getResult(self, **arg)
Return result ComplexList, if it is available.
  done(self)
Collect the last complexes and write result ComplexList to file.

Method Details [hide private]

__init__(self, complexLst, chunks=5, hosts=cpus_all, refComplex=None, updateOnly=0, niceness=nice_dic, force=[], outFile='complexes_cont.cl', com_version=-1, show_output=0, add_hosts=0, verbose=1, log=StdLog())
(Constructor)

source code 
Parameters:
  • complexLst (ComplexList) - input list
  • chunks (int) - number of complexes to hand over to each slave at each call
  • hosts ([str]) - list of hostnames
  • niceness (dict) - dictionary mapping hosts to nice values:
                    {'hostname':nice_value, ..., 'default': nice_value}
                     nice_value: int or str
    
  • outFile (str) - file name for output list of complexes with calculated contacts (default: 'complexes_cont.cl')
  • com_version (int) - contact the given version of a ComplexEvolving, only valid if input is ComplexEvolvingList (default: -1)
  • show_output (1|0) - show x-window for each slave or not (default: 0)
  • add_hosts (1|0) - add hosts to PVM (can take some time) (default: 0)
  • force ([str]) - force update of given info keys
  • verbose (0|1) - print progress infos (default: 1)
Raises:
  • BiskitError - if attempting to extract version from list that is not of type ComplexEvolvingList.

__check_models(self, cl)

source code 

Perform some checks for models assocciated with ComplexList.

__extractVersion(self, cel, com_version=-1)

source code 

Get a ComplexList by extracting a specified version (generation) of a ComplexEvolvingList.
Parameters:
  • cel (ComplexEvolvingList) - ComplexEvolvingList
  • com_version (int) - version of ComplexEvolvingList to get (default: -1, last version)
Returns: ComplexList
ComplexList

__addSurfaceMasks(self, cl)

source code 

Add surface area to rec and lig model if not already there.
Parameters:
  • cl (ComplexList) - ComplexList

__addSurface(self, m)

source code 

Add surface area to model.
Parameters:
  • m (PDBModel) - model

__refMasks(self, refCom, normalCom)

source code 

Create residue and atom contact masks for reference complex.
Parameters:
  • refCom (Complex) - reference complex
  • normalCom (Complex) - complex with different atom/residue content than the reference complex to be used for determining the sections that are identical in both complexes

__ref_interface(self, RC, NC, res_contacts, mask_rec, mask_lig, bb=0)

source code 
Parameters:
  • RC (Complex) - reference complex, casted to normal complex
  • NC (Complex) - normal complex, not casted to RC
  • res_contacts (matrix) - residue contact matrix for defining interface residues
  • mask_rec ([1|0]) - atom mask to cast NC.rec() to RC.rec()
  • mask_lig ([1|0]) - atom mask to cast NC.lig() to RC.lig()
  • bb (1|0) - apply a backbone mask (default: 0)
Returns: [int], PDBModel
atom mask for getting interface from NC.model(), reference interface

__reduced_refContacts(self)

source code 

calculate contact mask of atom-reduced reference complex.

__toBeUpdated(self, com)

source code 

Check if complex is to be updated.
Parameters:
  • com (Complex) - Complex
Returns: 1|0
1, if complex needs to be contacted

__complexDic(self, cl)

source code 

Collect info about complexes in ComplexList that needs to be updated.
Parameters:
  • cl (ComplexList) - ComplexList
Returns: {int:Complex}, ComplexList
dictionary mapping solution number to Complex, remaining complexes as a ComplexList

__create_reduced_models(self, cl, refCom=None)

source code 

Create rec and lig models with pooled atoms (ca. every 3 atoms) but keep only those united atoms where the singular atoms have an average rel surf acc area > 30%. Do the same to the reference complex rec and lig. The result are PDBModels with actually less atoms than residues but whose contact matrix (and fnac) still resembles the one calculated from all atoms.
Parameters:
  • cl (ComplexList) - ComplexList
  • refCom (Complex) - reference complex

getInitParameters(self, slave_tid)

source code 

hand over parameters to slave once.
Parameters:
  • slave_tid (int) - slave task id
Returns: dict
dictionaty with slave parameters

isFinished(self)

source code 

cleanup(self)

source code 

Remove temporary files. Overrides TrackingJobMaster method

getResult(self, **arg)

source code 

Return result ComplexList, if it is available.
Returns: ComplexList
resulting ComplexList

done(self)

source code 

Collect the last complexes and write result ComplexList to file.
Raises: