gnrs.gnrsutil


gnrs.gnrsutil.molecule_bonding

This module implements the molecule bonding module.

This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.

gnrs.gnrsutil.molecule_bonding.construct_pair_keys(elements)[source]

Constructs pair_key matrix for every element in the argument

Parameters:

elements (list[str])

Return type:

numpy.ndarray

gnrs.gnrsutil.molecule_bonding.construct_intermolecular_dist_dict()[source]

Constructs the intermolecular distance dictionary with vdW radii.

Return type:

None

gnrs.gnrsutil.molecule_bonding.get_vdw_distance_cutoff_matrix(mol_path, z, sr, natural_cutoff_mult)[source]

Get the van der Waals distance cutoff matrix.

Parameters:
  • mol_path (str | list[str]) – Path to the molecule file.

  • z (int) – Number of molecules in the unit cell.

  • sr (float) – Fraction of the van der Waals distance cutoff.

  • natural_cutoff_mult (float) – Multiplier for the natural cutoffs.

Returns:

Van der Waals distance cutoff matrix. hbond_keys: List of hydrogen bond keys.

Return type:

cutoff_matrix

class gnrs.gnrsutil.molecule_bonding.MoleculeBonding[source]

Bases: object

Identifies all bonded atoms in a molecule or

structure using ASE NeighborList

Parameters:
  • atoms (ASE atoms object OR list of ASE atoms object) – Structure object to build molecule bonding

  • natural_cutoff_mult (float) – Multiplier to covalent distances for identifying molecular bonding

  • skin (float) – For ase.neighborlists. If skin is not zero, then extra neighbors outside the cutoff can be returned.

__init__(atoms, natural_cutoff_mult=1.2, skin=0)[source]
get_cutoff_matrix(vdw_mult=0.85)[source]

Returns NxN matrix expressing a cutoff distance between intermolecular contacts in a crystal system of the given molecule.

Parameters:

vdw_mult (float) – Multiplicative factor for the cutoff distance for vdw type contacts. A cutoff value of 0.85 is well supported by statistical analysis for these types of contacts.

get_cutoff_matrix_vdw(vdw_mult=0.85)[source]

Returns NxN matrix expressing a cutoff distance between intermolecular contacts in a crystal system of the given molecule. Only uses vdw contact distances.

Parameters:

vdw_mult (float) – Multiplicative factor for the cutoff distance for vdw type contacts. A cutoff value of 0.85 is well supported by statistical analysis for these types of contacts.

get_crystal_cutoff_matrix(nmpc, vdw_mult=0.85)[source]

Copies the intermolecular distance matrix from MoleculeBonding.get_cutoff_matrix into the correct size for a specific number of molecules in the unit cell.

class gnrs.gnrsutil.molecule_bonding.BondNeighborhood[source]

Bases: object

Returns the bonding neighborhood of each atom for a structure. User is allowed to define a radius that the algorithm traverses to build the neighborhood for each atom. If the radius is 0, this would correspond to just return the atoms im the system.

Parameters:
  • radius (int) – Radius is the number of edges the model is allowed to traverse on the graph representation of the molecule.

  • mb_kwargs (dict) – Keyword arguments for the molecule bonding module. The default values are the recommended settings. A user may potentially want to decrease the natural_cutoff_mult. This value is multiplied by covalent bond radii in the MoleculeBonding class. It’s highly recommended that the skin value is kept at 0. For more details see ibslib.molecules.MoleculeBonding

__init__(radius=1, mb_kwargs={'natural_cutoff_mult': 1.2, 'skin': 0})[source]
calc(struct)[source]

gnrs.gnrsutil.volume_estimation

This module is based on the PyMoVE algorithm implemented in: [PyMoVE](https://github.com/manny405/PyMoVE) predicting the unit cell volume of a molecule.

This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.

gnrs.gnrsutil.volume_estimation.predict_cell_volume(mol_path, seed=42)[source]

Predict the unit cell volume of a molecule.

Parameters:

mol_path – Path to the molecule file.

Returns:

Predicted unit cell volume.

Return type:

float

class gnrs.gnrsutil.volume_estimation.MoleculeVolumeEstimator[source]

Bases: object

Class for performing molecular volume estimation using vdW radii.

Parameters:
  • tol – Tolerance to converge the estimation.

  • iterations – Maximum number of iterations to converge.

  • batch – Number of samples to process in MC method at a single time.

  • vdW – Array of vdW radii indexed by the atomic number.

  • seed – Random seed.

__init__(tol=0.001, iterations=100000000, batch=200000, vdW=ase.data.vdw_radii, seed=42)[source]
Parameters:
  • tol (float)

  • iterations (int)

  • batch (int)

  • vdW (numpy.ndarray)

  • seed (int)

calc(molecule_struct)[source]

Calculates the predicted molecular volume for a Structure object.

Parameters:

molecule_struct (Structure)

Return type:

float

bond_neighberhood_model(molecule_struct, MC_volume)[source]

Applies linear correction to the input volume from CSD analysis.

Parameters:
Return type:

float

MC(molecule_struct)[source]

Monte Carlo method for volume estimation using vdW radii.

Parameters:

molecule_struct (Structure)

Return type:

float

gnrs.gnrsutil.core

Utility functions for Genarris.

This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.

gnrs.gnrsutil.core.eV2kJ(e)[source]

Convert energy from eV to kJ/mol.

Parameters:

e (float)

Return type:

float

gnrs.gnrsutil.core.check_if_exp_found(config, gnrs_info)[source]

Check if experimental structure is found within the generated pool.

Parameters:
  • config (dict) – Configuration dictionary

  • gnrs_info (dict) – Dictionary containing information about the Genarris run