Package Bio :: Package PDB :: Module AbstractPropertyMap :: Class AbstractPropertyMap
[hide private]
[frames] | no frames]

Class AbstractPropertyMap

source code

Known Subclasses:

Instance Methods [hide private]
 
__init__(self, property_dict, property_keys, property_list) source code
 
_translate_id(self, entity_id) source code
anything (can be a tuple)
__getitem__(self, key)
Return property for a residue.
source code
int
__len__(self)
Return number of residues for which the property is available.
source code
 
has_key(self, id)
Return 1 if the map has a property for this residue, 0 otherwise.
source code
[(chain_id, res_id), (chain_id, res_id),...]
keys(self)
Return the list of residues.
source code
 
__iter__(self)
Iterate over the (entity, property) list.
source code
Method Details [hide private]

__getitem__(self, key)
(Indexing operator)

source code 

Return property for a residue.

Parameters:
  • chain_id (char) - chain id
  • res_id (int or (char, int, char)) - residue id
Returns: anything (can be a tuple)
some residue property

__len__(self)
(Length operator)

source code 

Return number of residues for which the property is available.

Returns: int
number of residues

has_key(self, id)

source code 

Return 1 if the map has a property for this residue, 0 otherwise.

Example:

>>> if map.has_key((chain_id, res_id)):
>>>     res, property=map[(chain_id, res_id)]
Parameters:
  • chain_id (char) - chain id
  • res_id (char) - residue id

keys(self)

source code 

Return the list of residues.

Returns: [(chain_id, res_id), (chain_id, res_id),...]
list of residues for which the property was calculated

__iter__(self)

source code 

Iterate over the (entity, property) list. Handy alternative to the dictionary-like access.

Example:

>>> for (res, property) in iter(map):
>>>     print res, property
Returns:
iterator