Bio.PDB.AbstractPropertyMap module

Class that maps (chain_id, residue_id) to a residue property.

class Bio.PDB.AbstractPropertyMap.AbstractPropertyMap(property_dict, property_keys, property_list)

Bases: object

Define base class, map holder of residue properties.

__init__(self, property_dict, property_keys, property_list)

Initialize the class.

__contains__(self, id)

Check if the mapping has a property for this residue.

Parameters
  • chain_id (char) – chain id

  • res_id (char) – residue id

Examples

This is an incomplete but illustrative example:

if (chain_id, res_id) in apmap:
    res, prop = apmap[(chain_id, res_id)]
__getitem__(self, key)

Return property for a residue.

Parameters
  • chain_id (char) – chain id

  • res_id (int or (char, int, char)) – residue id

Returns

some residue property

Return type

anything (can be a tuple)

__len__(self)

Return number of residues for which the property is available.

Returns

number of residues

Return type

int

keys(self)

Return the list of residues.

Returns

list of residues for which the property was calculated

Return type

[(chain_id, res_id), (chain_id, res_id),..]

__iter__(self)

Iterate over the (entity, property) list.

Handy alternative to the dictionary-like access.

Returns

iterator

Examples

>>> for (res, property) in iter(map):
...     print(res, property)
...
class Bio.PDB.AbstractPropertyMap.AbstractResiduePropertyMap(property_dict, property_keys, property_list)

Bases: Bio.PDB.AbstractPropertyMap.AbstractPropertyMap

Define class for residue properties map.

__init__(self, property_dict, property_keys, property_list)

Initialize the class.

class Bio.PDB.AbstractPropertyMap.AbstractAtomPropertyMap(property_dict, property_keys, property_list)

Bases: Bio.PDB.AbstractPropertyMap.AbstractPropertyMap

Define class for atom properties map.

__init__(self, property_dict, property_keys, property_list)

Initialize the class.