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. |
fop_frame |
Field of points from the current frame. |
resolution |
Resolution for determining point proximity.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
The Jaccard distance between the reference and current field of points. |
Examples:
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:
|
subpex_config |
SuPEx configuration containing selection strings and other parameters.
TYPE:
|
atoms_ref |
Reference frame for comparison, must be provided if not None.
TYPE:
|
*args |
Additional positional arguments.
TYPE:
|
**kwargs |
Additional keyword arguments.
TYPE:
|
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:
|
atoms_frame |
Atomic coordinates of the current frame.
TYPE:
|
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:
|
subpex_config |
SuPEx configuration containing selection strings and other parameters.
TYPE:
|
atoms_ref |
Reference frame for comparison, must be provided if not None.
TYPE:
|
*args |
Additional positional arguments.
TYPE:
|
**kwargs |
Additional keyword arguments.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
The RMSD between the reference and current frame. |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If |
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. |
*args |
Additional positional arguments.
TYPE:
|
**kwargs |
Additional keyword arguments.
TYPE:
|
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:
|
subpex_config |
SuPEx configuration containing selection strings and other parameters.
TYPE:
|
atoms_ref |
Reference frame for comparison, must be provided if not None.
TYPE:
|
*args |
Additional positional arguments.
TYPE:
|
**kwargs |
Additional keyword arguments.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
The radius of gyration of the pocket. |
Examples:
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:
|
subpex_config |
SuPEx configuration containing selection strings and other parameters.
TYPE:
|
atoms_ref |
Reference frame for comparison, defaults to None.
TYPE:
|
*args |
Additional positional arguments.
TYPE:
|
**kwargs |
Additional keyword arguments.
TYPE:
|
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}")