CMIN
- class cmin(**kwargs)
Class containing all the functions from the CMIN module.
Parameters
- kwargsargument class
Specify any arguments from the CMIN module (for a complete list of variables, visit the AQME documentation)
- ani_optimize(mol, charge, mult)
Perform ANI optimization on a single molecule.
Uses ASE with ANI calculator to optimize molecular geometry and compute energy using semi-empirical neural network potentials.
- Args:
mol: RDKit molecule object charge (list): List of atomic charges mult (list): List of atomic unpaired electrons
- Returns:
- tuple: (mol, energy, cmin_valid)
mol: Updated molecule with optimized coordinates
energy: Final energy in kcal/mol
cmin_valid: True if optimization succeeded
- charge_mult_cmin()
Retrieve charge and multiplicity arrays for ANI optimizations.
Extracts formal charges and radical electrons from each atom, then calculates total multiplicity.
- Returns:
- tuple: (charge, mult, final_mult)
charge: List of atomic formal charges
mult: List of unpaired electrons per atom
final_mult: Overall spin multiplicity (2S+1)
- compute_cmin(file)
Run conformer minimization for all molecules in file.
Optimizes each conformer using ANI or xTB, applies energy and RMSD filters, and writes results to SDF files.
- Args:
file (str): Path to input SDF file
- get_cmin_model()
Generate the ANI optimization model for CMIN.
Loads the specified ANI model (e.g., ANI2x) from torchani.
- Returns:
torchani model: ANI neural network potential model
- load_jobs(file)
Load molecules from input file.
Reads SDF file and extracts molecule objects and base name. Tries loading from current directory first, then from initial directory.
- Args:
file (str): Path to SDF file
- Returns:
tuple: (inmols, name_mol) - list of molecules and file basename
- write_confs(conformers, selectedcids, log)
Write filtered conformers to SDF file.
Writes only the conformers that passed filters to the output SDF.
- Args:
conformers (list): List of molecule objects selectedcids (list): IDs of conformers to write log: Logger object for error messages
Parameters
General
- filesstr or list of str, default=None
Input files. Formats accepted: XYZ, SDF, GJF, COM and PDB. Also, lists can be used (i.e. [FILE1.sdf, FILE2.sdf] or *.FORMAT such as *.sdf).
- programstr, default=None
Program required in the conformational refining. Current options: 'xtb', 'ani'
- w_dir_mainstr, default=os.getcwd()
Working directory
- destinationstr, default=None,
Directory to create the output file(s)
- varfilestr, default=None
Option to parse the variables using a yaml file (specify the filename)
- nprocsint, default=None
Number of processors used in the xTB optimizations
- chargeint, default=None
Charge of the calculations used in the xTB calculations. If charge isn't defined, it automatically reads the charge from the input SDF files (if the files come from CSEARCH, which adds the property "Real charge") or calculates it from the generated mol object
- multint, default=None
Multiplicity of the calculations used in the xTB calculations. If charge isn't defined, it automatically reads the charge from the input SDF files (if the files come from CSEARCH, which adds the property "Mult") or calculates it from the generated mol object. Be careful with the automated calculation of mult from mol objects when using metals!
- ewin_cminfloat, default=5.0
Energy window in kcal/mol to discard conformers (i.e. if a conformer is more than the E window compared to the most stable conformer)
- initial_energy_thresholdfloat, default=0.0001
Energy difference in kcal/mol between unique conformers for the first filter of only E
- energy_thresholdfloat, default=0.25
Energy difference in kcal/mol between unique conformers for the second filter of E + RMS
- rms_thresholdfloat, default=0.25
RMS difference between unique conformers for the second filter of E + RMS
- stacksizestr, default='1G'
Controls the stack size used (especially relevant for xTB/CREST calculations of large systems, where high stack sizes are needed)
- prefixstr, default=''
Prefix added to all the names
- suffixstr, default=''
Suffix added to all the names
xTB only
- xtb_keywordsstr, default=None
Define additional keywords to use in xTB that are not included in -c, --uhf, -P and --input. For example: '--alpb ch2cl2 --gfn 1'
- constraints_atomslist, default=[]
Specify constrained atoms as [AT1,AT2,AT3]. An example of multiple constraints with atoms 1, 2 and 5 frozen: [1,2,5]
- constraints_distlist of lists, default=[]
Specify distance constraints as [AT1,AT2,DIST]. An example of multiple constraints with atoms 1 and 2 frozen at a distance of 1.8 Å, and atoms 4 and 5 with distance of 2.0 Å: [[1,2,1.8],[4,5,2.0]]
- constraints_anglelist of lists, default=[]
Specify angle constraints as [AT1,AT2,AT3,ANGLE]. An example of multiple constraints with atoms 1, 2 and 3 frozen at an angle of 180 degrees, and atoms 4, 5 and 6 with an angle of 120: [[1,2,3,180],[4,5,6,120]]
- constraints_dihedrallist of lists, default=[]
Specify dihedral constraints as [AT1,AT2,AT3,AT4,DIHEDRAL]. An example of multiple constraints with atoms 1, 2, 3 and 4 frozen at a dihedral angle of 180 degrees, and atoms 4, 5, 6 and 7 with a dihedral angle of 120: [[1,2,3,4,180],[4,5,6,7,120]]
ANI only
- opt_stepsint, default=1000
Maximum number of steps used in the ase.optimize.BFGS optimizer.
- opt_fmaxfloat, default=0.05
Maximum force value to determine convergence in the ase.optimize.BFGS optimizer.
- ani_methodstr, default='ANI2x'
ANI model used in the ase.optimize.BFGS optimizer.