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

Class AbstractPropertyMap

source code

object --+
         |
        AbstractPropertyMap
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, property_dict, property_keys, property_list)
Initialize the class.
source code
 
_translate_id(self, entity_id) source code
 
__contains__(self, id)
Check 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)
Check 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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, property_dict, property_keys, property_list)
(Constructor)

source code 
Initialize the class.
Overrides: object.__init__

__contains__(self, id)
(In operator)

source code 

Check if the mapping has a property for this residue.

Examples

>>> 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 

Check if the mapping has a property for this residue.

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

Examples

>>> 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.

Examples

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