mdgo.volume module
Computes the volume for each ligand or active site in a file.
In ligand mode, the volume of the entire structure is calculated. The -x, -y, -z, -xsize, -ysize and -zsize options are ignored.
In active site mode, the unoccupied volume within a cube is calculated. The center of the cube is defined by the -x, -y and -z options, and the size of the cube is defined by the -xsize, -ysize and -zsize options.
- mdgo.volume.parse_command_line()[source]
The command line parser helper function.
- Usage:
python volume.py -xyz <input_xyz> [options]
- mdgo.volume.get_max_dimensions(mol)[source]
Calculates the dimension of a Molecule
- Parameters
mol (
Molecule) – A Molecule object.- Return type
Tuple[float,float,float,float,float,float]- Returns
xmin, xmax, ymin, ymax, zmin, zmax
- mdgo.volume.set_max_dimensions(x=0.0, y=0.0, z=0.0, x_size=10.0, y_size=10.0, z_size=10.0)[source]
Set the max dimensions for calculating active site volume.
- Parameters
x (
float) – X center for volume grid. Default to 0.0.y (
float) – Y center for volume grid. Default to 0.0.z (
float) – Y center for volume grid. Default to 0.0.x_size (
float) – X side length for volume grid. Default to 10.0.y_size (
float) – Y side length for volume grid. Default to 10.0.z_size (
float) – Z side length for volume grid. Default to 10.0.
- Return type
Tuple[float,float,float,float,float,float]- Returns
x_min, x_max, y_min, y_max, z_min, z_max
- mdgo.volume.round_dimensions(x_min, x_max, y_min, y_max, z_min, z_max, mode='lig')[source]
Round dimensions to a larger box size (+ buffer).
- Parameters
x_min (
float) – x min.x_max (
float) – x max.y_min (
float) – y min.y_max (
float) – y max.z_min (
float) – z min.z_max (
float) – z max.mode (
str) – “lig” or “act” mode. Default to “lig”.
- Return type
Tuple[float,float,float,float,float,float]- Returns
x0, x1, y0, y1, z0, z1
- mdgo.volume.dsq(a1, a2, a3, b1, b2, b3)[source]
Squared distance between a and b
- Parameters
a1 (
float) – x coordinate of aa2 (
float) – y coordinate of aa3 (
float) – z coordinate of ab1 (
float) – x coordinate of bb2 (
float) – y coordinate of bb3 (
float) – z coordinate of b
- Return type
float- Returns
squared distance
- mdgo.volume.get_dimensions(x0, x1, y0, y1, z0, z1, res=0.1)[source]
Mesh dimensions in unit of res.
- Parameters
x0 (
float) – x min.x1 (
float) – x max.y0 (
float) – y min.y1 (
float) – y max.z0 (
float) – z min.z1 (
float) – z max.res (
float) – Resolution of the mesh to use in Å
- Return type
Tuple[int,int,int]- Returns
xsteps, ysteps, zsteps
- mdgo.volume.make_matrix(x_num, y_num, z_num)[source]
Make a matrix of None with specified dimensions.
- Parameters
x_num (
int) – x dimension.y_num (
int) – y dimension.z_num (
int) – z dimension.
- Return type
ndarray- Returns
matrix
- mdgo.volume.get_radii(radii_type='Bondi')[source]
Get a radii dict by type.
- Parameters
radii_type (
str) – The radii type. Valid types are “Bondi”, “Lange”, and “pymatgen”. Default to “Bondi”.- Return type
Dict[str,float]- Returns
A radii dict.
- mdgo.volume.fill_volume_matrix(mol, x0, x1, y0, y1, z0, z1, res, matrix, radii_type, exclude_h=True)[source]
This method perform the mesh point filling algorithm on a given matrix.
- Parameters
mol (
Molecule) – The Molecule object to calculate volume.x0 (
float) – x min.x1 (
float) – x max.y0 (
float) – y min.y1 (
float) – y max.z0 (
float) – z min.z1 (
float) – z max.res (
float) – Resolution of the mesh to use when estimating molar volume, in Åmatrix (
ndarray) – The mesh matrix to perform mesh point filling.radii_type (
str) – The radii type. Valid types are “Bondi”, “Lange”, and “pymatgen”. Default to “Bondi”.exclude_h (
bool) – Whether to exclude H when estimating molar volume. Default to True.
- Return type
ndarray- Returns
The filled matrix.
- mdgo.volume.get_occupied_volume(matrix, res, name=None, molar_volume=True)[source]
Get the occupied volume of the molecule in the box.
- Parameters
matrix (
ndarray) – The filled mesh matrix.res (
float) – Resolution of the mesh in Å.name (
Optional[str]) – The name of the moleculemolar_volume – Whether to return molar_volume, otherwise molecular volume. Default to True.
- Return type
float- Returns
Volume
- mdgo.volume.get_unoccupied_volume(matrix, res, name=None, molar_volume=True)[source]
Get the unoccupied volume of the molecule in the box.
- Parameters
matrix (
ndarray) – The filled mesh matrix.res (
float) – Resolution of the mesh in Å.name (
Optional[str]) – The name of the moleculemolar_volume – Whether to return molar_volume, otherwise molecular volume. Default to True.
- Return type
float- Returns
Volume
- mdgo.volume.molecular_volume(mol, name=None, res=0.1, radii_type='Bondi', molar_volume=True, exclude_h=True, mode='lig', x_cent=0.0, y_cent=0.0, z_cent=0.0, x_size=10.0, y_size=10.0, z_size=10.0)[source]
Estimate the molar volume in cm^3/mol or volume in Å^3
- Parameters
mol (
Union[str,Molecule]) – Molecule object or path to .xyz or other file that can be read by Molecule.from_file()name (
Optional[str]) – String representing the name of the molecule, e.g. “NaCl”res (
float) – Resolution of the mesh to use when estimating molar volume, in Åradii_type (
str) – “Bondi”, “Lange”, or “pymatgen”. Bondi and Lange vdW radii are compiled in this package for H, B, C, N, O, F, Si, P, S, Cl, Br, and I. Choose ‘pymatgen’ to use the vdW radii from pymatgen.Element, which are available for most elements and reflect the latest values in the CRC handbook.molar_volume (
bool) – Whether to return molar volume. If false, then return volume. Default to True (molar volume).exclude_h (
bool) – Whether to exclude H atoms during the calculation. Default to True.mode (
str) – In ligand mode (“lig”), the volume of the entire structure is calculated. In active site mode (“act”), the unoccupied volume within a cube is calculated. Default to “lig”.x_cent (
float) – X center for volume grid. Default to 0.0.y_cent (
float) – Y center for volume grid. Default to 0.0.z_cent (
float) – Z center for volume grid. Default to 0.0.x_size (
float) – X side length for volume grid. Default to 10.0.y_size (
float) – Y side length for volume grid. Default to 10.0.z_size (
float) – Z side length for volume grid. Default to 10.0.
- Return type
float- Returns
The molar volume in cm^3/mol or volume in Å^3.