Skip to content

Spatial

Useful utilities involving field of points.

calculate_distance_two_points(point1, point2)

Calculates the distance between two points in a 3D coordinate system.

PARAMETER DESCRIPTION
point1

coordinates of first point. [x, y, z]

TYPE: Sequence[float]

point2

coordinates of second point. [x, y, z]

TYPE: Sequence[float]

RETURNS DESCRIPTION
float

Distance between point1 and point2.

get_centroid(fop_pocket)

Calculates the centroid or the center of mass for equal masses of a field of points.

PARAMETER DESCRIPTION
fop_pocket

the field of points defining the pocket shape.

TYPE: Sequence[Sequence[float]]

RETURNS DESCRIPTION
Sequence[float]

Coordinates of the pocket centroid.

get_rmsd(R, R_ref)

Compute the Root Mean Square Deviation (RMSD) between two sets of atomic coordinates.

RMSD is a measure of the average distance between atoms of two superimposed sets of coordinates. This function calculates RMSD without any alignment or fitting of the structures, assuming that the input arrays are already aligned.

PARAMETER DESCRIPTION
R

A 2D array of shape (N, 3) representing the atomic coordinates. Each row corresponds to the coordinates of one atom.

TYPE: ndarray

R_ref

A 2D array of shape (N, 3) representing the reference atomic coordinates. Each row corresponds to the coordinates of one atom.

TYPE: ndarray

RETURNS DESCRIPTION
float

The RMSD value between the two sets of atomic coordinates.

TYPE: float

RAISES DESCRIPTION
ValueError

If the input arrays R and R_ref do not have the same shape.

Example

R = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) R_ref = np.array([[1.1, 2.1, 3.1], [4.1, 5.1, 6.1]]) get_rmsd(R, R_ref) 0.1