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)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_translate_id(self, entity_id) source code
 
__contains__(self, id)
True if the mapping has a property for this residue.
source code
 
__getitem__(self, key)
Return property for a residue.
source code
 
__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
 
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 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__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)]

@param chain_id: chain id
@type chain_id: char

@param res_id: residue id
@type res_id: char

__getitem__(self, key)
(Indexing operator)

source code 

Return property for a residue.

@param chain_id: chain id
@type chain_id: char

@param res_id: residue id
@type res_id: int or (char, int, char)

@return: some residue property
@rtype: anything (can be a tuple)

__len__(self)
(Length operator)

source code 

Return number of residues for which the property is available.

@return: number of residues
@rtype: int

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

@param chain_id: chain id
@type chain_id: char

@param res_id: residue id
@type res_id: char

keys(self)

source code 

Return the list of residues.

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

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

@return: iterator