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
 
__contains__(self, id)
True if the mapping has a property for this residue.
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)
True if the mapping has a property for this residue.
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]

__contains__(self, id)
(In operator)

source code 

True if the mapping has a property for this residue.

Example:

>>> if (chain_id, res_id) in apmap:
...     res, prop = apmap[(chain_id, res_id)]
Parameters:
  • chain_id (char) - chain id
  • res_id (char) - residue id

__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 

True if the mapping has a property for this residue.

(Obsolete; use "id in mapping" instead.)

Example:

>>> if apmap.has_key((chain_id, res_id)):
...     res, prop = apmap[(chain_id, res_id)]

Is equivalent to:

>>> if (chain_id, res_id) in apmap:
...     res, prop = apmap[(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