Package schrodinger :: Package application :: Package prime :: Module residue_interaction :: Class InteractionReader
[hide private]
[frames] | no frames]

Class InteractionReader

object --+
         |
        InteractionReader

Read the Prime residue interaction data from a structure

Instance Methods [hide private]
 
__init__(self, struc)
Read the Prime residue interaction data
tuple
_readEnergyMetaData(self, struc)
Get metadata about the stored interaction data
tuple
_readEnergyData(self, data_names, ninteract, data_handle)
Read in the interaction data
float
getEnergy(self, energy_type, res1, res2)
Get the interaction energy between the specified residues
str
_getResKey(self, res)
Get the Prime-formatted residue name for the specified residue

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

Class Methods [hide private]
bool
hasData(cls, struc)
Check if the specified structure contains interaction data
int
_openDataHandle(cls, struc)
Open an m2io handle to the interaction data
Static Methods [hide private]
str
resKey(res)
Get the Prime-formatted residue name for the specified residue
Class Variables [hide private]
  BLOCK_NAME = 'm_psp_residue_interaction_energies'
Instance Variables [hide private]
set _available_res
A set of residue names for which Prime interaction data has been read
dict _energy
A dictionary of the interaction energy, stored as [energy type][res1][res2].
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, struc)
(Constructor)

 

Read the Prime residue interaction data

Parameters:
Raises:
  • ValueError - If the structure does not have any Prime residue interaction data
Overrides: object.__init__

hasData(cls, struc)
Class Method

 

Check if the specified structure contains interaction data

Parameters:
Returns: bool
True if the structure has interaction data. False otherwise.

_readEnergyMetaData(self, struc)

 

Get metadata about the stored interaction data

Parameters:
Returns: tuple
A tuple of
  • The names of the stored data (i.e. column headers) (list)
  • The number of interactions (i.e. row count) (int)
  • An open m2io handle to the data (int)

_openDataHandle(cls, struc)
Class Method

 

Open an m2io handle to the interaction data

Parameters:
Returns: int
An open m2io handle to the data
Raises:
  • ValueError - If the structure does not have any Prime residue interaction data

_readEnergyData(self, data_names, ninteract, data_handle)

 

Read in the interaction data

Parameters:
  • data_names (list) - The names of the stored data (i.e. column headers)
  • ninteract (int) - The number of interactions (i.e. row count)
  • data_handle (int) - An open m2iohandle to the data
Returns: tuple
A tuple of
  • The residues for which data was read (set)
  • The interaction data (dict). See InteractionReader._energy documentation for an explanation of the data format.

getEnergy(self, energy_type, res1, res2)

 

Get the interaction energy between the specified residues

Parameters:
Returns: float
The interaction energy between the specified residues
Raises:
  • ValueError - If no data is found for the given energy type or residues

_getResKey(self, res)

 

Get the Prime-formatted residue name for the specified residue

Parameters:
Returns: str
The formatted name

resKey(res)
Static Method

 

Get the Prime-formatted residue name for the specified residue

Parameters:
Returns: str
The formatted name

Instance Variable Details [hide private]

_energy

A dictionary of the interaction energy, stored as [energy type][res1][res2]. Note that this dictionary is not symmetric: [energy type][res1][res2] is stored but [energy type][res2][res1] is not. In _buildEnergyDict and getEnergy, res1 is arbitrarily assigned to be less than res2.
Type:
dict