mispr.gaussian package

Subpackages

Submodules

mispr.gaussian.database module

Define the Gaussian database class.

class mispr.gaussian.database.GaussianCalcDb(host, port=None, name=None, username=None, password=None, uri_mode=False, **kwargs)[source]

Bases: object

Class to help manage database insertions of molecules and Gaussian calculations.

abstract build_indexes(background=True)[source]

Build indexes for the database.

Parameters:
background : bool, optional

If True, this index should be created.

delete_molecule(inchi)[source]

Delete a molecule from the molecules collection.

Parameters:
inchi : str

The inchi representation of the molecule to delete.

classmethod from_db_file(db_file, admin=True)[source]

Create a new database object from a database file.

Parameters:
db_file : str

The path to the database file.

admin : bool, optional

Whether to use admin credentials; defaults to True.

Returns:

GaussianCalcDb.

insert_derived_mol(derived_mol, update_duplicates)[source]

Insert a derived molecule into the derived_molecules collection.

Parameters:
derived_mol : Molecule

pymatgen.Molecule object.

update_duplicates : bool

Whether to update duplicates if the molecule already exists.

insert_fg(fg_file)[source]

Insert functional groups into their collection using a json file. The file can contain one or more functional groups.

Parameters:
fg_file : str

The path to the json file.

insert_molecule(mol, update_duplicates=False)[source]

Insert a molecule into the molecules collection.

Parameters:
mol : Molecule

A pymatgen Molecule object to insert.

update_duplicates : bool, optional

If True, update the existing molecule in the db with the new one. Defaults to False.

insert_property(collection_name, property_dict, index, **kwargs)[source]

Insert a document into a property collection in the database.

Parameters:
collection_name : str

The name of the collection to insert the property into; e.g. bde, binding_energy, etc.

property_dict : dict

The property dictionary to insert.

index : str, list[tuple]

The indexes to use for fast lookup.

**kwargs

Additional kwargs to pass to pymongo.collection.create_index.

insert_run(grun)[source]

Insert a Gaussian run into the runs collection.

Parameters:
grun : dict

A dictionary containing the Gaussian run.

move_runs(new_collection, inchi=None, smiles=None, functional=None, basis=None, **kwargs)[source]

Move documents from the runs collection to another collection.

Parameters:
new_collection : str

The name of the collection to move the runs to.

inchi : str, optional

The inchi representation of the molecule.

smiles : str, optional

The smiles representation of the molecule.

functional : str, optional

The name of the density functional.

basis : str, optional

The name of the basis set.

**kwargs

Other kwargs that can be used to query the collection.

query_molecules(query)[source]

Query the molecules collection.

Parameters:
query : dict

A query document that selects which documents to include in the result set; e.g. keys can be inchi, smiles, chemsys, etc.

Returns:

A dataframe of documents that match the query.

Return type:

pd.DataFrame

retrieve_doc(collection_name, inchi=None, smiles=None, functional=None, basis=None, **kwargs)[source]

Retrieve a document from any collection of the database.

Parameters:
collection_name : str

The name of the collection, e.g. bde, molecules, runs, etc.

inchi : str, optional

The inchi representation of the molecule.

smiles : str, optional

The smiles representation of the molecule.

functional : str, optional

The name of the density functional.

basis : str, optional

The name of the basis set.

**kwargs

Other kwargs that can be used to query the collection.

Returns:

A list of documents that match the query

Return type:

list

retrieve_fg(name)[source]

Retrieve a functional group from the functional_groups collection.

Parameters:
name : str

The name of the functional group to retrieve.

Returns:

dict

retrieve_molecule(inchi)[source]

Retrieve a molecule from the molecules collection.

Parameters:
inchi : str

The inchi representation of the molecule.

Returns:

dict

retrieve_run(inchi=None, smiles=None, functional=None, basis=None, **kwargs)[source]

Retrieve a run from the runs collection.

Parameters:
inchi : str, optional

The inchi representation of the molecule.

smiles : str, optional

The smiles representation of the molecule.

functional : str, optional

The name of the density functional.

basis : str, optional

The name of the basis set.

**kwargs

Other kwargs that can be used to query the collection.

Returns:

A list of documents that match the query.

Return type:

list

update_run(new_values, inchi=None, smiles=None, job_type=None, functional=None, basis=None, phase=None, **kwargs)[source]

Update a document in the runs collection. If multiple documents match the query criteria, will select the first one.

Parameters:
new_values : dict

The new output values to update the document with, e.g.

code-block: : ..

python: {“polarizability”: 3.5}

inchi : str, optional

The inchi representation of the molecule.

smiles : str, optional

The smiles representation of the molecule.

job_type : str, optional

The type of job, e.g. “opt”, “freq”.

functional : str, optional

The name of the density functional.

basis : str, optional

The name of the basis set.

phase : str, optional

The phase of the job, e.g. “gas”, “solution”.

**kwargs

Other kwargs that can be used to query the collection.

mispr.gaussian.defaults module

Module contents