utils
- class Logger(filein, append, suffix='dat', verbose=True)
Class that wraps a file object to abstract the logging.
- finalize()
Closes the file
- QM_coords(outlines, min_RMS, n_atoms, program, keywords_line)
Retrieves atom types and coordinates from QM output files
- cclib_atoms_coords(cclib_data)
Function to convert atomic numbers and coordinate arrays from cclib into a format compatible with QPREP.
- check_run(w_dir)
Determines the folder where input files are gonna be generated in QCORR.
- check_version(self, program, version_line, target_version, n_split, install_cmd)
Check whether the version of xTB/CREST used is compatible with AQME
- command_line_args()
Load default and user-defined arguments specified through command lines. Arrguments are loaded as a dictionary
- format_lists(value, arg_name)
Transforms strings into a list
- get_conf_RMS(mol1, mol2, c1, c2, heavy, max_matches_rmsd)
Takes in two rdkit.Chem.Mol objects and calculates the RMSD between them. (As side efect mol1 is left in the aligned state, if heavy is specified the side efect will not happen)
Parameters
- mol1rdkit.Chem.Mol
Probe molecule
- mol2rdkit.Chem.Mol
Target molecule. The probe is aligned to the target to compute the RMSD
- c1int
Conformation of mol1 to use for the RMSD
- c2int
Conformation of mol2 to use for the RMSD
- heavybool
If True it will ignore the H atoms when computing the RMSD
- max_matches_rmsdint
Max number of matches found in a SubstructMatch()
Returns
- float
Returns the best RMSD found
- get_info_input(file)
Takes an input file and retrieves the coordinates of the atoms and the total charge.
Parameters
- filestr or pathlib.Path
A path pointing to a valid .com or .gjf file
Returns
- coordinateslist
A list of strings (without n) that contain the xyz coordinates of the .gjf or .com file
- chargestr
A str with the number corresponding to the total charge of the .com or .gjf file
- load_from_yaml(self)
Loads the parameters for the calculation from a yaml if specified. Otherwise does nothing.
- load_sdf(input_file)
Get mols from SDF files
- load_variables(kwargs, aqme_module, create_dat=True)
Load default and user-defined variables
- mol_from_sdf_or_mol_or_mol2(input_file, module, args, low_check=None)
mol object from SDF, MOL or MOL2 files
- move_file(destination, source, file)
Moves files from the source folder to the destination folder and creates the destination folders when needed.
Parameters
- destinationstr
Path to the destination folder
- srcstr
Path to the source folder
- filestr
Full name of the file (file + extension)
- read_file(initial_dir, w_dir, file)
Reads through a file and retrieves a list with all the lines.
- read_xyz_charge_mult(file)
Reads charge and multiplicity from XYZ files. These parameters should be defined in the title lines as charge=X and mult=Y (i.e. FILENAME charge=1 mult=1 Eopt -129384.564)
- run_command(command, outfile, cwd=None)
Runs the subprocess command and saves the results in an output file (not shown in the terminal)
- set_destination(self, module)
Sets up the destination folder
- set_metal_atomic_number(mol, metal_idx, metal_sym)
Changes the atomic number of the metal atoms using their indices.
Parameters
- molrdkit.Chem.Mol
RDKit molecule object
- metal_idxlist
sorted list that contains the indices of the metal atoms in the molecule
- metal_symlist
sorted list (same order as metal_idx) that contains the symbols of the metals in the molecule