.. _hello-water: Hello Water =========== Starting with an empty database:: $ bee molecule list | id | canonical_smiles | multiplicity | charge | molecular_formula | recipe_ids | identifiers | tags | +----+------------------+--------------+--------+-------------------+------------+-------------+------+ .. note:: Tip: All ``bee`` sub-commands may be abbreviated as long as it is unique. E.g. above command can be abbreviated as ``bee mol l``. Add Water to the Database ------------------------- Single molecules can be added to the database using ``bee mol create`` and specifying the SMILES string. The following adds water as a **Molecule** with ``id=1``:: $ bee mol create --smiles O 1 $ bee mol list | id | canonical_smiles | multiplicity | charge | molecular_formula | recipe_ids | identifiers | tags | +----+------------------+--------------+--------+-------------------+------------+-------------+------+ | 1 | O | 1 | 0 | H2O | | | | Alternatively, we could use the REST-API: .. code-block:: sh $ curl -X 'POST' \ 'http://localhost:8000/api/v1/molecule' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "smiles": "O" }' .. code-block:: json { "id": 1, "canonical_smiles": "O", "original_smiles": "O", "inchi": "InChI=1S/H2O/h1H2", "multiplicity": 1, "ambiguous_input": false, "charge": 0, "mass": 18.015, "molecular_formula": "H2O", "number_of_atoms": 3, "atoms": [ "H", "H", "O" ], "bonds": [ { "atom_indices": [ 0, 2 ], "type": "SINGLE" }, { "atom_indices": [ 1, 2 ], "type": "SINGLE" } ], "identifiers": [], "tags": [], "initial_conformers": [ { "id": 1, "coordinates": [ [ 0.7903084630389962, -0.19728968119872656, 0 ], [ -0.7870020412828991, -0.1999835515539665, -0 ], [ -0.0033064217560969445, 0.3972732327526928, -0 ] ], "trajectory_step": 0, "tags": null, "properties": [], "conformer_generations": [], "optimisations": [], "nms": [] } ], "recipes": [] } Run Weasel confSearch workflow on water --------------------------------------- Running Weasel manually can be quite cumbersome because it requires to add a **Workflow** by hand, but we would like to present it nevertheless once for easier understanding. In the next subsection we present an easier method using **Recipes**. .. asciinema:: water_confsearch.cast :preload: 1 .. PS1='/tmp $ ' bee workflow create -h bee workflow create --name 'aiqu_confSearch' --command 'weasel -W aiqu_confSearch -bee-conf 1 -bee-workflow {id}' --software 'WEASEL' bee workflow get 1 weasel -W aiqu_confSearch -bee-conf 1 -bee-workflow 1 bee workflow overview 1 .. _browsing: Browsing the results -------------------- As shown above, we now have the following simulations from this Weasel run: .. code-block:: $ bee workflow overview 1 Workflow 1 (aiqu_confsearch) has FINISHED on 2022-06-21 10:37:23 [ 18s] 1 #1 CONFORMER_GENERATION (CREST-RDKIT) on Conformer 1 generating Conformers 3, 2 [ 0s] 2 #1 SIMULATION (XTB) on Conformer 3 [ 0s] 3 #1 SIMULATION (XTB) on Conformer 2 [ 0s] 4 #2 OPTIMISATION (XTB) on Conformer 2 generating Conformers 4@0 [ 1s] 5 #3 OPTIMISATION (r2SCAN-3c) on Conformer 4 generating Conformers 5@3 [ 10s] 6 #4 OPTIMISATION (wB97M-V) on Conformer 5 generating Conformers 9@5, 8@4, 7@2, 6@0 Starting with the **Molecule's** initial conformer, **Bee** stores the origin of each **Conformer** in a tree of alternating **Conformers** and **Simulations**. The CLI allows to print it:: $ bee mol tree --show-methods 1 Molecule 1: O └── Conformer 1 └── Conformer Generation (CREST-RDKIT) 1 ├── Conformer 2 │ ├── Simulation (XTB) 3 │ └── Optimisation (XTB) 4 │ └── Conformer 4 │ └── Optimisation (r2SCAN-3c) 5 │ └── Conformer 5 │ └── Optimisation (wB97M-V) 6 │ ├── Conformer 6 │ ├── Conformer 7 │ ├── Conformer 8 │ └── Conformer 9 └── Conformer 3 └── Simulation (XTB) 2 .. code-block:: yaml Molecule: id: 1 smiles: O initial_conformers: - Conformer: id: 1 coordinates: ... conformer_generations: - Simulation: id: 1 type: CONFORMER_GENERATION generated_conformers: - Conformer: id: 2 coordinates: ... properties: [ ... ] conformer_generations: [] optimisations: - Simulation: id: 4 type: OPTIMISATION generated_conformers: - Conformer: id: 4 coordinates: [] properties: [ ... ] ... - Conformer: id: 3 coordinates: ... properties: [ ... ] conformer_generations: [] optimisations: - Simulation: id: 136 type: OPTIMISATION generated_conformers: - Conformer: id: 23 coordinates: [] properties: [ ... ] ... optimisations: [] Here is the original JSON dump from the Weasel run which can be obtained via ``bee mol get --depth=-1 1`` or directly in a browser: `http://localhost:8000/api/v1/molecule/1?depth=-1 `_ (:download:`json `): .. literalinclude:: water_confsearch.json :language: json