Skip to content

Compute

Compute properties of pockets.

get_pocket_jaccard(fop_ref, fop_frame, resolution)

Calculates the Jaccard distance between two fields of points (FoPs).

The Jaccard distance measures the dissimilarity between two sets of points based on their intersection and union, considering a specific resolution for point proximity.

PARAMETER DESCRIPTION
fop_ref

Reference field of points.

TYPE: Sequence[Sequence[float]]

fop_frame

Field of points from the current frame.

TYPE: Sequence[Sequence[float]]

resolution

Resolution for determining point proximity.

TYPE: float

RETURNS DESCRIPTION
float

The Jaccard distance between the reference and current field of points.

Examples:

>>> fop_ref = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
>>> fop_frame = [[1.1, 2.1, 3.1], [4.1, 5.1, 6.1]]
>>> jaccard = get_pocket_jaccard(fop_ref, fop_frame, 0.5)
>>> print(f"Jaccard Distance: {jaccard:.2f}")

get_pocket_jaccard_convenience(atoms_frame, subpex_config, atoms_ref=None, *args, **kwargs)

A convenience wrapper around get_pocket_jaccard using a simulation frame.

This function simplifies the calculation of the Jaccard distance between a reference frame and a given trajectory frame using the subpex configuration.

PARAMETER DESCRIPTION
atoms_frame

Trajectory frame to analyze.

TYPE: AtomGroup

subpex_config

SuPEx configuration containing selection strings and other parameters.

TYPE: SubpexConfig

atoms_ref

Reference frame for comparison, must be provided if not None.

TYPE: AtomGroup | None DEFAULT: None

*args

Additional positional arguments.

TYPE: Any DEFAULT: ()

**kwargs

Additional keyword arguments.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
float

The Jaccard distance between the reference and current field of points.

Examples:

>>> u = mda.Universe("topology.pdb", "trajectory.dcd")
>>> frame = u.select_atoms("protein")
>>> ref = u.select_atoms("protein").positions
>>> config = SubpexConfig(pocket=PocketConfig(selection_str="protein"))
>>> jaccard = get_pocket_jaccard_convenience(frame, config, ref)
>>> print(f"Pocket Jaccard Distance: {jaccard:.2f}")

get_pocket_rmsd(atoms_ref, atoms_frame)

Calculates the root-mean-square deviation (RMSD) between two sets of atomic coordinates.

This function computes the RMSD between a reference structure and a current frame, assuming each atom has an equal mass of one. RMSD is a measure of the average distance between atoms of superimposed proteins.

PARAMETER DESCRIPTION
atoms_ref

Atomic coordinates of the reference structure.

TYPE: NDArray[float64]

atoms_frame

Atomic coordinates of the current frame.

TYPE: NDArray[float64]

RETURNS DESCRIPTION
float

The RMSD between the reference and current frame.

Example

atoms_ref = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) atoms_frame = np.array([[1.1, 2.1, 3.1], [4.1, 5.1, 6.1]]) rmsd = get_pocket_rmsd(atoms_ref, atoms_frame) print(f"RMSD: {rmsd:.2f}")

get_pocket_rmsd_convenience(atoms_frame, subpex_config, atoms_ref=None, *args, **kwargs)

A convenience wrapper around get_pocket_rmsd using a simulation frame.

This function simplifies the calculation of the RMSD between a reference frame and a given trajectory frame using the subpex configuration.

PARAMETER DESCRIPTION
atoms_frame

Trajectory frame to analyze.

TYPE: AtomGroup

subpex_config

SuPEx configuration containing selection strings and other parameters.

TYPE: SubpexConfig

atoms_ref

Reference frame for comparison, must be provided if not None.

TYPE: AtomGroup | None DEFAULT: None

*args

Additional positional arguments.

TYPE: Any DEFAULT: ()

**kwargs

Additional keyword arguments.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
float

The RMSD between the reference and current frame.

RAISES DESCRIPTION
ValueError

If atoms_ref is None.

Example

u = mda.Universe("topology.pdb", "trajectory.dcd") frame = u.select_atoms("protein") ref = u.select_atoms("protein").positions config = SubpexConfig(pocket=PocketConfig(selection_str="protein")) rmsd = get_pocket_rmsd_convenience(frame, config, ref) print(f"Pocket RMSD: {rmsd:.2f}")

get_pocket_rog(fop, *args, **kwargs)

Calculates the radius of gyration for a field of points (FOP).

The radius of gyration is a measure of the compactness of a set of points, assuming a uniform mass distribution.

PARAMETER DESCRIPTION
fop

The field of points defining the pocket shape.

TYPE: Sequence[Sequence[float]]

*args

Additional positional arguments.

TYPE: Any DEFAULT: ()

**kwargs

Additional keyword arguments.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
float

The radius of gyration of the pocket.

Example

fop = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]] rog = get_pocket_rog(fop) print(f"Radius of Gyration: {rog:.2f}")

get_pocket_rog_convenience(atoms_frame, subpex_config, atoms_ref=None, *args, **kwargs)

A convenience wrapper around get_pocket_rog using a simulation frame.

This function simplifies the calculation of the radius of gyration for a pocket from a given trajectory frame using the subpex configuration.

PARAMETER DESCRIPTION
atoms_frame

Trajectory frame to analyze.

TYPE: AtomGroup

subpex_config

SuPEx configuration containing selection strings and other parameters.

TYPE: SubpexConfig

atoms_ref

Reference frame for comparison, must be provided if not None.

TYPE: AtomGroup | None DEFAULT: None

*args

Additional positional arguments.

TYPE: Any DEFAULT: ()

**kwargs

Additional keyword arguments.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
float

The radius of gyration of the pocket.

Examples:

>>> u = mda.Universe("topology.pdb", "trajectory.dcd")
>>> frame = u.select_atoms("protein")
>>> config = SubpexConfig(pocket=PocketConfig(selection_str="protein"))
>>> rog = get_pocket_rog_convenience(frame, config)
>>> print(f"Radius of Gyration: {rog:.2f}")

get_pocket_volume_convenience(atoms_frame, subpex_config, atoms_ref=None, *args, **kwargs)

This function simplifies the calculation of the volume of a pocket from a given trajectory frame. It wraps around the lower-level get_fop_volume function, abstracting away some of the complexity and inputs.

PARAMETER DESCRIPTION
atoms_frame

Trajectory frame to analyze.

TYPE: AtomGroup

subpex_config

SuPEx configuration containing selection strings and other parameters.

TYPE: SubpexConfig

atoms_ref

Reference frame for comparison, defaults to None.

TYPE: AtomGroup | None DEFAULT: None

*args

Additional positional arguments.

TYPE: Any DEFAULT: ()

**kwargs

Additional keyword arguments.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
float

The calculated volume of the pocket.

Example

u = mda.Universe("topology.pdb", "trajectory.dcd") frame = u.select_atoms("protein") config = SubpexConfig(pocket=PocketConfig(selection_str="protein")) volume = get_pocket_volume_convenience(frame, config) print(f"Pocket volume: {volume:.2f}")