from pharmaforge.recipes.GeneralDatabase import GeneralRecipe
[docs]
class QDPi2Recipe(GeneralRecipe):
""" A subclass of GeneralRecipe to generate the QDPi1 database"""
def __init__(self, input_dir=None, client="mongodb://localhost:27017/"):
self.kwargs = {
"spin": 0,
"level_of_theory": "wB97XM-D3(BJ)/def2-TZVPPD",
"basis_set": "def2-TZVPPD",
"functional": "wB97XM-D3(BJ)",
"low_level": None,
"base_model": None,
"data_source": "QDPi2",
}
self.database_name = "QDPi2_Database"
self.open_client(client)
self.clear_db()
if input_dir is not None:
self.process_hdf5(input_dir)
else:
# Check if the database exists
self.db = self.client[self.database_name]
self.check_collections()
self.confirm_collections()
[docs]
def confirm_collections(self):
""" Check if the collections are present in the database
Parameters
----------
None
Returns
-------
None
"""
collections = self.check_collections()
expected_collections=['ani_qdpi', 'comp6_qdpi', 'freesolvmd_qdpi', 'geom_qdpi', 're_qdpi', 'spice_qdpi']
for collection in expected_collections:
if collection not in collections:
print(f"Collection {collection} not found in database {self.database_name}.")