Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Private Member Functions
Bio.PDB.AbstractPropertyMap.AbstractResiduePropertyMap Class Reference
Inheritance diagram for Bio.PDB.AbstractPropertyMap.AbstractResiduePropertyMap:
Inheritance graph
[legend]
Collaboration diagram for Bio.PDB.AbstractPropertyMap.AbstractResiduePropertyMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __contains__
def __getitem__
def __len__
def has_key
def keys
def __iter__

Public Attributes

 property_dict
 property_keys
 property_list

Private Member Functions

def _translate_id

Detailed Description

Definition at line 108 of file AbstractPropertyMap.py.


Constructor & Destructor Documentation

def Bio.PDB.AbstractPropertyMap.AbstractResiduePropertyMap.__init__ (   self,
  property_dict,
  property_keys,
  property_list 
)

Reimplemented from Bio.PDB.AbstractPropertyMap.AbstractPropertyMap.

Reimplemented in Bio.PDB.DSSP.DSSP.

Definition at line 109 of file AbstractPropertyMap.py.

00109 
00110     def __init__(self, property_dict, property_keys, property_list):
00111         AbstractPropertyMap.__init__(self, property_dict, property_keys, 
00112                 property_list)


Member Function Documentation

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 

Definition at line 18 of file AbstractPropertyMap.py.

00018 
00019     def __contains__(self, id):
00020         """True if the mapping has a property for this residue.
00021 
00022         Example:
00023             >>> if (chain_id, res_id) in apmap:
00024             ...     res, prop = apmap[(chain_id, res_id)]
00025 
00026         @param chain_id: chain id
00027         @type chain_id: char 
00028 
00029         @param res_id: residue id
00030         @type res_id: char 
00031         """
00032         translated_id = self._translate_id(id)
00033         return (translated_id in self.property_dict)

Here is the call graph for this function:

def Bio.PDB.AbstractPropertyMap.AbstractPropertyMap.__getitem__ (   self,
  key 
) [inherited]
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)

Definition at line 34 of file AbstractPropertyMap.py.

00034 
00035     def __getitem__(self, key):
00036         """
00037         Return property for a residue.
00038 
00039         @param chain_id: chain id
00040         @type chain_id: char 
00041 
00042         @param res_id: residue id
00043         @type res_id: int or (char, int, char) 
00044 
00045         @return: some residue property 
00046         @rtype: anything (can be a tuple)
00047         """
00048         translated_id=self._translate_id(key)
00049         return self.property_dict[translated_id]

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 93 of file AbstractPropertyMap.py.

00093 
00094     def __iter__(self):
00095         """
00096         Iterate over the (entity, property) list. Handy alternative to 
00097         the dictionary-like access.
00098 
00099         Example:
00100             >>> for (res, property) in iter(map):
00101             ...     print res, property
00102 
00103         @return: iterator
00104         """
00105         for i in range(0, len(self.property_list)):
00106             yield self.property_list[i]
00107 

Here is the caller graph for this function:

Return number of residues for which the property is available.

@return: number of residues
@rtype: int

Definition at line 50 of file AbstractPropertyMap.py.

00050 
00051     def __len__(self):
00052         """
00053         Return number of residues for which the property is available.
00054 
00055         @return: number of residues
00056         @rtype: int
00057         """
00058         return len(self.property_dict)

Reimplemented from Bio.PDB.AbstractPropertyMap.AbstractPropertyMap.

Definition at line 113 of file AbstractPropertyMap.py.

00113 
00114     def _translate_id(self, ent_id):
00115         chain_id, res_id=ent_id
00116         if isinstance(res_id, int):
00117             ent_id=(chain_id, (' ', res_id, ' '))
00118         return ent_id
00119 

Here is the caller graph for this function:

def Bio.PDB.AbstractPropertyMap.AbstractPropertyMap.has_key (   self,
  id 
) [inherited]
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 

Definition at line 59 of file AbstractPropertyMap.py.

00059 
00060     def has_key(self, id):
00061         """True if the mapping has a property for this residue.
00062 
00063         (Obsolete; use "id in mapping" instead.)
00064 
00065         Example:
00066 
00067             >>> if apmap.has_key((chain_id, res_id)):
00068             ...     res, prop = apmap[(chain_id, res_id)]
00069 
00070         Is equivalent to:
00071 
00072             >>> if (chain_id, res_id) in apmap:
00073             ...     res, prop = apmap[(chain_id, res_id)]
00074 
00075         @param chain_id: chain id
00076         @type chain_id: char 
00077 
00078         @param res_id: residue id
00079         @type res_id: char 
00080         """
00081         import warnings
00082         warnings.warn("This function is obsolete; use 'id in mapping' instead", PendingDeprecationWarning)
00083         return (id in self)

Return the list of residues.

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

Definition at line 84 of file AbstractPropertyMap.py.

00084 
00085     def keys(self):
00086         """
00087         Return the list of residues.
00088 
00089         @return: list of residues for which the property was calculated
00090         @rtype: [(chain_id, res_id), (chain_id, res_id),...] 
00091         """
00092         return self.property_keys

Here is the caller graph for this function:


Member Data Documentation

Definition at line 11 of file AbstractPropertyMap.py.

Definition at line 12 of file AbstractPropertyMap.py.

Definition at line 13 of file AbstractPropertyMap.py.


The documentation for this class was generated from the following file: