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__(property_dict, property_keys, property_list)
Initialize the class.
- __contains__(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__(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__()
Return number of residues for which the property is available.
- Returns
number of residues
- Return type
int
- keys()
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__()
Iterate over the (entity, property) list.
Handy alternative to the dictionary-like access.
- Returns
iterator
Examples
>>> entity_property_list = [ ... ('entity_1', 'property_1'), ... ('entity_2', 'property_2') ... ] >>> map = AbstractPropertyMap({}, [], entity_property_list) >>> for (res, property) in iter(map): ... print(res, property) entity_1 property_1 entity_2 property_2
- class Bio.PDB.AbstractPropertyMap.AbstractResiduePropertyMap(property_dict, property_keys, property_list)
Bases:
Bio.PDB.AbstractPropertyMap.AbstractPropertyMap
Define class for residue properties map.
- __init__(property_dict, property_keys, property_list)
Initialize the class.
- __annotations__ = {}
- class Bio.PDB.AbstractPropertyMap.AbstractAtomPropertyMap(property_dict, property_keys, property_list)
Bases:
Bio.PDB.AbstractPropertyMap.AbstractPropertyMap
Define class for atom properties map.
- __init__(property_dict, property_keys, property_list)
Initialize the class.
- __annotations__ = {}