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

Class ComplexModelRegistry

source code

This is a helper class for ComplexList.

Keep unique copies of the rec and lig models from many Complexes. Make sure that 2 Complexes with the same rec_model (same by file name and unchanged) always point to the same PDBModel instance.

Instance Methods [hide private]
  __init__(self)
str version(self)
Version of class.
  addComplex(self, com)
Register Complex with the registry.
  removeComplex(self, com)
Remove a Complex from the registry.
  __removeModel(self, model, com, f2model, f2com)
Remove model of a complex from the registry.
PDBModel getRecModel(self, source)
Get receptor model belonging to source.
PDBModel getLigModel(self, source)
Get ligand model belonging to source.
PDBModel getModel(self, source)
Get model belonging to source.
[PDBModel] recModels(self)
Get a list with all receptor models.
[PDBModel] ligModels(self)
Get a list with all ligand models.
[Complex] getRecComplexes(self, model)
Get the complexes of which a given receptor model is a component.
[Complex] getLigComplexes(self, model)
Get the complexes of which a given ligand model is a component.
[Complex] __getComplexes(self, model, f2com)
Get the complexes of which a given ligand model is a component.
PDBModel, str __sync_model(self, m, f2model)
Get a shared model instance that is equal to m.
  __str__(self)
  __repr__(self)

Method Details [hide private]

__init__(self)
(Constructor)

source code 

version(self)

source code 

Version of class.
Returns: str
version of class

addComplex(self, com)

source code 

Register Complex with the registry.
Parameters:
  • com (Complex) - complex

removeComplex(self, com)

source code 

Remove a Complex from the registry.
Parameters:
  • com (Complex) - complex

__removeModel(self, model, com, f2model, f2com)

source code 

Remove model of a complex from the registry.
Parameters:
  • model (PDBModel) - receptor or ligand model
  • com (Complex) - complex
  • f2model ({str:PDBModel}) - dictionary mapping files to models
  • f2com ({str:Complex}) - dictionary mapping files to complexes

getRecModel(self, source)

source code 

Get receptor model belonging to source.
Parameters:
  • source (str) - path
Returns: PDBModel
model

getLigModel(self, source)

source code 

Get ligand model belonging to source.
Parameters:
  • source (str) - path
Returns: PDBModel
model

getModel(self, source)

source code 

Get model belonging to source.
Parameters:
  • source (str) - path
Returns: PDBModel
model

recModels(self)

source code 

Get a list with all receptor models.
Returns: [PDBModel]
list of models

ligModels(self)

source code 

Get a list with all ligand models.
Returns: [PDBModel]
list of models

getRecComplexes(self, model)

source code 

Get the complexes of which a given receptor model is a component.
Parameters:
  • model (object) - LocalPath or PDBModel
Returns: [Complex]
list of Complexes

getLigComplexes(self, model)

source code 

Get the complexes of which a given ligand model is a component.
Parameters:
  • model (object) - LocalPath or PDBModel
Returns: [Complex]
list of Complexes

__getComplexes(self, model, f2com)

source code 

Get the complexes of which a given ligand model is a component.
Parameters:
  • model (object) - LocalPath or PDBModel
  • f2com ({str:Complex}) - dictionary mapping paths to complexes
Returns: [Complex]
list of Complexes
Raises:

__sync_model(self, m, f2model)

source code 

Get a shared model instance that is equal to m. If there is no such instance in the registry, m is returned and m is added to the registry - but only if it has been pickled to disc and hasn't changed since.
Parameters:
  • m (PDBModel) - PDBModel
  • f2model ({ str:PDBModel }) - dictionary with the path to the file as key
Returns: PDBModel, str
Model from f2model equivalent to m, otherwise add m to f2model and return m. File name or None for stray model

__str__(self)
(Informal representation operator)

source code 

__repr__(self)
(Representation operator)

source code