Tools¶
This module contains a series of core tools used for the feature calculations in DeepRank. These tools are at the moment:
- sasa: a simple solvent surface area calculator
- sparse: a 3D sparse matrix engine
Here are the details of the submodule given in tools.
Solvent Accessible Surface Area¶
-
class
deeprank.tools.sasa.
SASA
(pdbfile)[source]¶ Simple class that computes Surface Accessible Solvent Area.
The method follows some of the approaches presented in:
Solvent accessible surface area approximations for rapid and accurate protein structure prediction https://link.springer.com/article/10.1007%2Fs00894-009-0454-9
Example
>>> sasa = SASA('1AK4_1w.pdb') >>> NV = sasa.neighbor_vector() >>> print(NV)
Parameters: pdbfile (str) – PDB file of the conformation -
get_center
(chain1='A', chain2='B', center='cb')[source]¶ Get the center of the resiudes.
Parameters: Raises: ValueError
– If the center is not recpgnized
-
get_residue_center
(chain1='A', chain2='B')[source]¶ Compute the average position of all the residues.
Parameters:
-
get_residue_carbon_beta
(chain1='A', chain2='B')[source]¶ Extract the position of the carbon beta of each residue.
Parameters:
-
neighbor_vector
(lbound=3.3, ubound=11.1, chain1='A', chain2='B', center='cb')[source]¶ Compute teh SASA folowing the neighbour vector approach.
The method is based on Eq on page 1097 of https://link.springer.com/article/10.1007%2Fs00894-009-0454-9
Parameters: Returns: neighbouring vectors
Return type:
-
neighbor_count
(lbound=4.0, ubound=11.4, chain1='A', chain2='B', center='cb')[source]¶ Compute the neighbourhood count of each residue.
The method is based on Eq on page 1097 of https://link.springer.com/article/10.1007%2Fs00894-009-0454-9
Parameters: Returns: Neighborhood count
Return type:
-
Sparse 3D Matrix¶
-
class
deeprank.tools.sparse.
FLANgrid
(sparse=None, index=None, value=None, shape=None)[source]¶ Flat Array sparse matrix.
Parameters: -
from_dense
(data, beta=None, debug=False)[source]¶ Create a sparse matrix from a dense one.
Parameters:
-
to_dense
(shape=None)[source]¶ Create a dense matrix.
Parameters: shape (3x3 array, optional) – Shape of the matrix Returns: Dense 3D matrix Return type: np.array Raises: ValueError
– shape not defined
-
_get_single_index
(index)[source]¶ Get the single index for a single element.
# get the index can be used with a map # self.index = np.array( list( map(self._get_single_index,index) ) ).astype(index_type) # however that is remarkably slow compared to the array version
Parameters: index (array) – COO index Returns: index Return type: int
-
_get_single_index_array
(index)[source]¶ Get the single index for multiple elements.
# get the index can be used with a map # self.index = np.array( list( map(self._get_single_index,index) ) ).astype(index_type) # however that is remarkably slow compared to the array version
Parameters: index (array) – COO index Returns: index Return type: list(int)
-