pocketmt.alpha_spheres package#

Submodules#

pocketmt.alpha_spheres.alpha_spheres module#

class pocketmt.alpha_spheres.alpha_spheres.AlphaSpheres(points=None)[source]#

Bases: object

Set of alpha-spheres

Object with a set of alpha-spheres and its main attributes such as radius and contacted points

points#

Array of coordinates in space of all points used to generate the set of alpha-spheres.

Type:

ndarray (shape=[n_points,3], dtype=float)

n_points#

Number of points in space to generate the set of alpha-spheres.

Type:

int

centers#

Centers of alpha-spheres.

Type:

ndarray (shape=[n_alpha_spheres,3], dtype=float)

radii#

Array with the radii of alpha-spheres.

Type:

ndarray (shape=[n_alpha_spheres], dtype=float)

points_of_alpha_sphere#

Indices of points in the surface of each alpha-sphere.

Type:

ndarray (shape=[n_alpha_spheres, 4], dtype=int)

n_alpha_spheres#

Number of alpha-spheres in the set.

Type:

int

get_points_of_alpha_spheres(indices)[source]#

Get the points in contact with a subset of alpha-spheres The list of point indices accounting for the points in contact with a subset of alpha-spheres is calculated.

Parameters:

indices (numpy.ndarray, list or tuple (dtype:ints)) – List, tuple or numpy.ndarray with the alpha-sphere indices defining the subset.

Returns:

points_of_alpha_spheres – List of point indices in contact with one or more alpha-spheres of the subset.

Return type:

list

Examples

>>> import openpocket as opoc
>>> points = ([[-1.,  2.,  0.],
>>>            [ 0.,  2.,  1.],
>>>            [ 1., -2.,  1.],
>>>            [ 0.,  1.,  1.],
>>>            [ 0.,  0.,  0.],
>>>            [-1., -1.,  0.]])
>>> aspheres = opoc.AlphaSpheres(points)
>>> aspheres.get_points_of_alpha_spheres([1,3])
[0,2,3,4,5]
remove_alpha_spheres(indices)[source]#

Removing alpha-spheres from the set The method removes from the set those alpha-spheres specified by the input argument indices.

Parameters:

indices (numpy.ndarray, list or tuple (dtype:ints)) – List, tuple or numpy.ndarray with the integer numbers corresponding to the alpha-sphere indices to be removed from the set.

Examples

remove_big_alpha_spheres(maximum_radius)[source]#
remove_small_alpha_spheres(minimum_radius)[source]#
view(view=None, indices='all')[source]#

3D spatial view of alpha-spheres and points An NGLview view is returned with alpha-spheres (gray color) and points (red color).

Parameters:

indices (numpy.ndarray, list or tuple (dtype:ints)) – List, tuple or numpy.ndarray with the alpha-sphere indices defining the subset.

Returns:

view – View object of NGLview.

Return type:

nglview

Examples

>>> import openpocket as opoc
>>> points = ([[-1.,  2.,  0.],
>>>            [ 0.,  2.,  1.],
>>>            [ 1., -2.,  1.],
>>>            [ 0.,  1.,  1.],
>>>            [ 0.,  0.,  0.],
>>>            [-1., -1.,  0.]])
>>> aspheres = opoc.alpha_spheres.AlphaSpheresSet(points)
>>> view = aspheres.view([1,3])
>>> view

Module contents#