Biskit :: ModelList :: ModelList :: Class ModelList
[hide private]
[frames] | no frames]

Class ModelList

source code


A list of diverse PDBModels. Special support is given to access and use entries in the info dictionaries for filtering and sorting. Some care is taken to avoid the adding of non-PDBModel objects (but somehow it is, certainly, still possible).

See DictList for a complete description of all methods!

Comparison to Trajectory:

In contrast to Trajectory, ModelList does not require structures with identical atom content. This makes it of course less efficient and less powerful, in many respects. On the other hand, models are kept as seperate PDBModel instances with individual residue/atom profiles and info dictionaries.

Instance Methods [hide private]
  __init__(self, lst=[], item_type=PDBModel)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
str version(self)
Version of class.
any getItemValue(self, item, key, default=None)
Get a value from a given item (dictionary).
PDBModel file2model(self, file_or_model)
Load PDBModel from file if necessary.
dict _processNewItem(self, v, i)
Called before an item is added to the list.

Inherited from DictList.DictList: __getslice__, __setitem__, append, argsortRandom, checkType, extend, getItemKeys, getValue, keys, take

Inherited from DictList.DictList (private): _processNewItems

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setslice__, count, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, lst=[], item_type=PDBModel)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • lst ([ dict ]) - list
  • item_type ([ dict ]) - type, class of allowed items [ dict ]
Raises:
  • DictListError - if list contains non-item_type item.
Overrides: DictList.DictList.__init__

version(self)

source code 

Version of class.
Returns: str
class version number
Overrides: DictList.DictList.version

getItemValue(self, item, key, default=None)

source code 

Get a value from a given item (dictionary). Overrides DictList method.
Parameters:
  • item (dict) - possible entry of this list
  • key (any) - dictionary key
  • default (any) - return value if key is not found (default: None)
Returns: any
any
Overrides: DictList.DictList.getItemValue

file2model(self, file_or_model)

source code 

Load PDBModel from file if necessary.
Parameters:
  • file_or_model (str OR PDBModel) - file name or existing model
Returns: PDBModel
existing model or model loaded from file

_processNewItem(self, v, i)

source code 

Called before an item is added to the list. Override but call.
Parameters:
  • i (int) - index
  • v (dict) - value
Returns: dict
value
Overrides: DictList.DictList._processNewItem