rmgpy.qm.mopac

class rmgpy.qm.mopac.Mopac

A base class for all QM calculations that use MOPAC.

Classes such as MopacMol will inherit from this class.

failure_keys = ['IMAGINARY FREQUENCIES', 'EXCESS NUMBER OF OPTIMIZATION CYCLES', 'NOT ENOUGH TIME FOR ANOTHER CYCLE']

List of phrases that indicate failure NONE of these must be present in a succesful job.

get_parser(output_file)

Returns the appropriate cclib parser.

success_keys = ['DESCRIPTION OF VIBRATIONS', 'MOPAC DONE']

List of phrases to indicate success. ALL of these must be present in a successful job.

verify_output_file()

Check’s that an output file exists and was successful.

Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule with the given (augmented) InChI Key.

The definition of finding a successful simulation is based on these criteria: 1) finding an output file with the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry, when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)

If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.

class rmgpy.qm.mopac.MopacMol(molecule, settings)

A base Class for calculations of molecules using MOPAC.

Inherits from both QMMolecule and Mopac.

calculate_chirality_correction()

Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.

calculate_thermo_data()

Calculate the thermodynamic properties.

Stores and returns a ThermoData object as self.thermo. self.qm_data and self.point_group need to be generated before this method is called.

check_paths()

Check the paths in the settings are OK. Make folders as necessary.

check_ready()

Check that it’s ready to run calculations.

create_geometry()

Creates self.geometry with RDKit geometries

determine_point_group()

Determine point group using the SYMMETRY Program

Stores the resulting PointGroup in self.point_group

failure_keys = ['IMAGINARY FREQUENCIES', 'EXCESS NUMBER OF OPTIMIZATION CYCLES', 'NOT ENOUGH TIME FOR ANOTHER CYCLE']

List of phrases that indicate failure NONE of these must be present in a succesful job.

generate_qm_data()

Calculate the QM data and return a QMData object, or None if it fails.

generate_thermo_data()

Generate Thermo Data via a QM calc.

Returns None if it fails.

get_augmented_inchi_key(backend='rdkit-first')

Returns the augmented InChI from self.molecule

get_file_path(extension, scratch=True)

Returns the path to the file with the given extension.

The provided extension should include the leading dot. If called with scratch=False then it will be in the fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.

get_mol_file_path_for_calculation(attempt)

Get the path to the MOL file of the geometry to use for calculation attempt.

If attempt <= self.script_attempts then we use the refined coordinates, then we start to use the crude coordinates.

get_parser(output_file)

Returns the appropriate cclib parser.

get_thermo_file_path()

Returns the path the thermo data file.

initialize()

Do any startup tasks.

input_file_keywords(attempt)

Return the top, bottom, and polar keywords.

property input_file_path

Get the input file name.

keywords = [{'top': 'precise nosym THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 nonr THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 bfgs THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym recalc=10 dmax=0.10 nonr cycles=2000 t=2000 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}]

Keywords that will be added at the top and bottom of the qm input file

load_thermo_data()

Try loading a thermo data from a previous run.

property max_attempts

The total number of attempts to try

property output_file_path

Get the output file name.

parse()

Parses the results of the Mopac calculation, and returns a QMData object.

save_thermo_data()

Save the generated thermo data.

property script_attempts

The number of attempts with different script keywords

success_keys = ['DESCRIPTION OF VIBRATIONS', 'MOPAC DONE']

List of phrases to indicate success. ALL of these must be present in a successful job.

verify_output_file()

Check’s that an output file exists and was successful.

Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule with the given (augmented) InChI Key.

The definition of finding a successful simulation is based on these criteria: 1) finding an output file with the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry, when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)

If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.

write_input_file(attempt)

Using the Geometry object, write the input file for the attempt.

class rmgpy.qm.mopac.MopacMolPM3(molecule, settings)

Mopac PM3 calculations for molecules

This is a class of its own in case you wish to do anything differently, but for now it’s the same as all the MOPAC PMn calculations, only pm3

calculate_chirality_correction()

Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.

calculate_thermo_data()

Calculate the thermodynamic properties.

Stores and returns a ThermoData object as self.thermo. self.qm_data and self.point_group need to be generated before this method is called.

check_paths()

Check the paths in the settings are OK. Make folders as necessary.

check_ready()

Check that it’s ready to run calculations.

create_geometry()

Creates self.geometry with RDKit geometries

determine_point_group()

Determine point group using the SYMMETRY Program

Stores the resulting PointGroup in self.point_group

failure_keys = ['IMAGINARY FREQUENCIES', 'EXCESS NUMBER OF OPTIMIZATION CYCLES', 'NOT ENOUGH TIME FOR ANOTHER CYCLE']

List of phrases that indicate failure NONE of these must be present in a succesful job.

generate_qm_data()

Calculate the QM data and return a QMData object, or None if it fails.

generate_thermo_data()

Generate Thermo Data via a QM calc.

Returns None if it fails.

get_augmented_inchi_key(backend='rdkit-first')

Returns the augmented InChI from self.molecule

get_file_path(extension, scratch=True)

Returns the path to the file with the given extension.

The provided extension should include the leading dot. If called with scratch=False then it will be in the fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.

get_mol_file_path_for_calculation(attempt)

Get the path to the MOL file of the geometry to use for calculation attempt.

If attempt <= self.script_attempts then we use the refined coordinates, then we start to use the crude coordinates.

get_parser(output_file)

Returns the appropriate cclib parser.

get_thermo_file_path()

Returns the path the thermo data file.

initialize()

Do any startup tasks.

input_file_keywords(attempt)

Return the top, bottom, and polar keywords for attempt number attempt.

NB. attempt begins at 1, not 0.

property input_file_path

Get the input file name.

keywords = [{'top': 'precise nosym THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 nonr THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 bfgs THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym recalc=10 dmax=0.10 nonr cycles=2000 t=2000 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}]

Keywords that will be added at the top and bottom of the qm input file

load_thermo_data()

Try loading a thermo data from a previous run.

property max_attempts

The total number of attempts to try

property output_file_path

Get the output file name.

parse()

Parses the results of the Mopac calculation, and returns a QMData object.

save_thermo_data()

Save the generated thermo data.

property script_attempts

The number of attempts with different script keywords

success_keys = ['DESCRIPTION OF VIBRATIONS', 'MOPAC DONE']

List of phrases to indicate success. ALL of these must be present in a successful job.

verify_output_file()

Check’s that an output file exists and was successful.

Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule with the given (augmented) InChI Key.

The definition of finding a successful simulation is based on these criteria: 1) finding an output file with the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry, when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)

If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.

write_input_file(attempt)

Using the Geometry object, write the input file for the attempt.

class rmgpy.qm.mopac.MopacMolPM6(molecule, settings)

Mopac PM6 calculations for molecules

This is a class of its own in case you wish to do anything differently, but for now it’s the same as all the MOPAC PMn calculations, only pm6

calculate_chirality_correction()

Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.

calculate_thermo_data()

Calculate the thermodynamic properties.

Stores and returns a ThermoData object as self.thermo. self.qm_data and self.point_group need to be generated before this method is called.

check_paths()

Check the paths in the settings are OK. Make folders as necessary.

check_ready()

Check that it’s ready to run calculations.

create_geometry()

Creates self.geometry with RDKit geometries

determine_point_group()

Determine point group using the SYMMETRY Program

Stores the resulting PointGroup in self.point_group

failure_keys = ['IMAGINARY FREQUENCIES', 'EXCESS NUMBER OF OPTIMIZATION CYCLES', 'NOT ENOUGH TIME FOR ANOTHER CYCLE']

List of phrases that indicate failure NONE of these must be present in a succesful job.

generate_qm_data()

Calculate the QM data and return a QMData object, or None if it fails.

generate_thermo_data()

Generate Thermo Data via a QM calc.

Returns None if it fails.

get_augmented_inchi_key(backend='rdkit-first')

Returns the augmented InChI from self.molecule

get_file_path(extension, scratch=True)

Returns the path to the file with the given extension.

The provided extension should include the leading dot. If called with scratch=False then it will be in the fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.

get_mol_file_path_for_calculation(attempt)

Get the path to the MOL file of the geometry to use for calculation attempt.

If attempt <= self.script_attempts then we use the refined coordinates, then we start to use the crude coordinates.

get_parser(output_file)

Returns the appropriate cclib parser.

get_thermo_file_path()

Returns the path the thermo data file.

initialize()

Do any startup tasks.

input_file_keywords(attempt)

Return the top, bottom, and polar keywords for attempt number attempt.

NB. attempt begins at 1, not 0.

property input_file_path

Get the input file name.

keywords = [{'top': 'precise nosym THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 nonr THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 bfgs THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym recalc=10 dmax=0.10 nonr cycles=2000 t=2000 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}]

Keywords that will be added at the top and bottom of the qm input file

load_thermo_data()

Try loading a thermo data from a previous run.

property max_attempts

The total number of attempts to try

property output_file_path

Get the output file name.

parse()

Parses the results of the Mopac calculation, and returns a QMData object.

save_thermo_data()

Save the generated thermo data.

property script_attempts

The number of attempts with different script keywords

success_keys = ['DESCRIPTION OF VIBRATIONS', 'MOPAC DONE']

List of phrases to indicate success. ALL of these must be present in a successful job.

verify_output_file()

Check’s that an output file exists and was successful.

Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule with the given (augmented) InChI Key.

The definition of finding a successful simulation is based on these criteria: 1) finding an output file with the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry, when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)

If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.

write_input_file(attempt)

Using the Geometry object, write the input file for the attempt.

class rmgpy.qm.mopac.MopacMolPM7(molecule, settings)

Mopac PM7 calculations for molecules

This is a class of its own in case you wish to do anything differently, but for now it’s the same as all the MOPAC PMn calculations, only pm7

calculate_chirality_correction()

Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.

calculate_thermo_data()

Calculate the thermodynamic properties.

Stores and returns a ThermoData object as self.thermo. self.qm_data and self.point_group need to be generated before this method is called.

check_paths()

Check the paths in the settings are OK. Make folders as necessary.

check_ready()

Check that it’s ready to run calculations.

create_geometry()

Creates self.geometry with RDKit geometries

determine_point_group()

Determine point group using the SYMMETRY Program

Stores the resulting PointGroup in self.point_group

failure_keys = ['IMAGINARY FREQUENCIES', 'EXCESS NUMBER OF OPTIMIZATION CYCLES', 'NOT ENOUGH TIME FOR ANOTHER CYCLE']

List of phrases that indicate failure NONE of these must be present in a succesful job.

generate_qm_data()

Calculate the QM data and return a QMData object, or None if it fails.

generate_thermo_data()

Generate Thermo Data via a QM calc.

Returns None if it fails.

get_augmented_inchi_key(backend='rdkit-first')

Returns the augmented InChI from self.molecule

get_file_path(extension, scratch=True)

Returns the path to the file with the given extension.

The provided extension should include the leading dot. If called with scratch=False then it will be in the fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.

get_mol_file_path_for_calculation(attempt)

Get the path to the MOL file of the geometry to use for calculation attempt.

If attempt <= self.script_attempts then we use the refined coordinates, then we start to use the crude coordinates.

get_parser(output_file)

Returns the appropriate cclib parser.

get_thermo_file_path()

Returns the path the thermo data file.

initialize()

Do any startup tasks.

input_file_keywords(attempt)

Return the top, bottom, and polar keywords for attempt number attempt.

NB. attempt begins at 1, not 0.

property input_file_path

Get the input file name.

keywords = [{'top': 'precise nosym THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 nonr THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym gnorm=0.0 bfgs THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}, {'top': 'precise nosym recalc=10 dmax=0.10 nonr cycles=2000 t=2000 THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=1 '}]

Keywords that will be added at the top and bottom of the qm input file

load_thermo_data()

Try loading a thermo data from a previous run.

property max_attempts

The total number of attempts to try

property output_file_path

Get the output file name.

parse()

Parses the results of the Mopac calculation, and returns a QMData object.

save_thermo_data()

Save the generated thermo data.

property script_attempts

The number of attempts with different script keywords

success_keys = ['DESCRIPTION OF VIBRATIONS', 'MOPAC DONE']

List of phrases to indicate success. ALL of these must be present in a successful job.

verify_output_file()

Check’s that an output file exists and was successful.

Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule with the given (augmented) InChI Key.

The definition of finding a successful simulation is based on these criteria: 1) finding an output file with the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry, when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)

If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.

write_input_file(attempt)

Using the Geometry object, write the input file for the attempt.