.. search: Querying the database ===================== Finding *Molecules* ------------------- The REST-API endpoint ``GET /api/v1/molecule`` supports filtering the database's molecules for **SMARTS**, **tags**, and **Identifier**. Here are some examples: * SMARTS search for ``COC``:: $ bee mol list --output=id,canonical_smiles SOC | id | canonical_smiles | +-----+---------------------------------------------------+ | 23 | O=C(Nc1ccccc1)c1ccccc1OS(=O)(=O)c1ccccc1 | | 100 | COc1cccc(N2CCN(C(=O)Nc3ccc(OS(N)(=O)=O)cc3)CC2)c1 | * Search for the tag ``secret``:: $ bee mol list --output=id,canonical_smiles,tags --tag=secret | id | canonical_smiles | tags | +----+--------------------------------------------------------+--------------+ | 24 | Cc1c2c(cc3oc(C(=O)O)cc(=O)c13)OC(C)(C)c1ccccc1-2 | secret, aiqu | | 42 | COc1c(Cl)cc(-c2cc(F)c(F)cc2-c2ccc(S(N)(=O)=O)cc2)cc1Cl | secret, aiqu | | 52 | Cc1cc(C)cc(NC(=O)c2cnn(-c3ccc(C)c(C)c3)c2C2CCNCC2)c1 | secret, aiqu | * Search for the identifier ``CHEMBL1364480``:: $ bee mol list --brief --identifier=CHEMBL1364480 | id | canonical_smiles | recipe_ids | identifiers | tags | +----+------------------+------------+---------------+-----------+ | 10 | Cc1nccn1CC(=O)O | 10 | CHEMBL1364480 | aiqu, pub | The different filters may be combined to narrow down the results. Retrieving a *Molecule*'s data ------------------------------ The REST-API endpoint for receiving a molecule's contents in the database as JSON is ``GET /api/v1/molecule/?depth=`` where ```` is the unique molecule id in the database and the optional parameter ```` allows to restrict the number of layers of the nested tree structure to be retrieved. By setting this value to ``-1``, **Bee** sends the entire tree. For an explanation of how the nested tree of **Conformers** and **Simulations** describes the dependency of **Conformers** being a **Simulation's** source and **Simulations** being the origin of new **Conformers**, see :ref:`browsing`. Here is an example tree for the full **Recipe** ``aiqu-large`` running ``COOC``:: $ bee mol tree --show-workflows --show-methods --show-solvents 101 Molecule 101: COOC └── Conformer 103 └── Conformer Generation (CREST-RDKIT) in Gas 2 [Workflow 2: aiqu_confsearch] ├── Conformer 104 │ └── Simulation (XTB) in GAS 8 [Workflow 2: aiqu_confsearch] ├── Conformer 105 │ ├── Simulation (XTB) in GAS 3 [Workflow 2: aiqu_confsearch] │ └── Optimisation (XTB) in GAS 9 [Workflow 2: aiqu_confsearch] │ └── Conformer 110 │ └── Optimisation (r2SCAN-3c) in GAS 15 [Workflow 2: aiqu_confsearch] │ └── Conformer 116 │ └── Optimisation (wB97M-V) in GAS 18 [Workflow 2: aiqu_confsearch] │ ├── Conformer 119 │ ├── Conformer 120 │ ├── Conformer 121 │ └── Conformer 122 │ ├── Simulation (wB97M-V) in Water 67 [Workflow 4: aiqu_sp_water] │ ├── Simulation (wB97M-V) in Acetonitrile 81 [Workflow 6: aiqu_sp_acetonitrile] │ ├── Simulation (wB97M-V) in Chloroform 85 [Workflow 7: aiqu_sp_chloroform] │ ├── Simulation (wB97M-V) in Benzene 89 [Workflow 8: aiqu_sp_benzene] │ ├── Simulation (B3LYP) in GAS 93 [Workflow 9: aiqu_sp_excitedstate] │ └── NMS (wB97M-V) in GAS 22 [Workflow 3: aiqu_nms] │ ├── Conformer 136 │ └── Conformer 137 ├── Conformer 106 │ ├── Simulation (XTB) in GAS 4 [Workflow 2: aiqu_confsearch] │ └── Optimisation (XTB) in GAS 11 [Workflow 2: aiqu_confsearch] │ └── Conformer 112 │ └── Optimisation (r2SCAN-3c) in GAS 16 [Workflow 2: aiqu_confsearch] │ └── Conformer 117 │ └── Optimisation (wB97M-V) in GAS 20 [Workflow 2: aiqu_confsearch] │ ├── Conformer 127 │ ├── Conformer 128 │ ├── Conformer 129 │ └── Conformer 130 │ ├── Simulation (wB97M-V) in Water 69 [Workflow 4: aiqu_sp_water] │ ├── Simulation (wB97M-V) in Acetonitrile 83 [Workflow 6: aiqu_sp_acetonitrile] │ ├── Simulation (wB97M-V) in Chloroform 87 [Workflow 7: aiqu_sp_chloroform] │ ├── Simulation (wB97M-V) in Benzene 91 [Workflow 8: aiqu_sp_benzene] │ └── NMS (wB97M-V) in GAS 24 [Workflow 3: aiqu_nms] │ ├── Conformer 140 │ └── Conformer 141 ├── Conformer 107 │ ├── Simulation (XTB) in GAS 5 [Workflow 2: aiqu_confsearch] │ └── Optimisation (XTB) in GAS 12 [Workflow 2: aiqu_confsearch] │ └── Conformer 113 ├── Conformer 108 │ ├── Simulation (XTB) in GAS 6 [Workflow 2: aiqu_confsearch] │ └── Optimisation (XTB) in GAS 13 [Workflow 2: aiqu_confsearch] │ └── Conformer 114 │ └── Optimisation (r2SCAN-3c) in GAS 17 [Workflow 2: aiqu_confsearch] │ └── Conformer 118 │ └── Optimisation (wB97M-V) in GAS 21 [Workflow 2: aiqu_confsearch] │ ├── Conformer 131 │ ├── Conformer 132 │ ├── Conformer 133 │ └── Conformer 134 │ ├── Simulation (wB97M-V) in Water 70 [Workflow 4: aiqu_sp_water] │ ├── Simulation (wB97M-V) in Acetonitrile 84 [Workflow 6: aiqu_sp_acetonitrile] │ ├── Simulation (wB97M-V) in Chloroform 88 [Workflow 7: aiqu_sp_chloroform] │ ├── Simulation (wB97M-V) in Benzene 92 [Workflow 8: aiqu_sp_benzene] │ └── NMS (wB97M-V) in GAS 25 [Workflow 3: aiqu_nms] │ ├── Conformer 142 │ └── Conformer 143 └── Conformer 109 ├── Simulation (XTB) in GAS 7 [Workflow 2: aiqu_confsearch] └── Optimisation (XTB) in GAS 10 [Workflow 2: aiqu_confsearch] └── Conformer 111 └── Optimisation (r2SCAN-3c) in GAS 14 [Workflow 2: aiqu_confsearch] └── Conformer 115 └── Optimisation (wB97M-V) in GAS 19 [Workflow 2: aiqu_confsearch] ├── Conformer 123 ├── Conformer 124 ├── Conformer 125 └── Conformer 126 ├── Simulation (wB97M-V) in Water 68 [Workflow 4: aiqu_sp_water] ├── Simulation (wB97M-V) in Acetonitrile 82 [Workflow 6: aiqu_sp_acetonitrile] ├── Simulation (wB97M-V) in Chloroform 86 [Workflow 7: aiqu_sp_chloroform] ├── Simulation (wB97M-V) in Benzene 90 [Workflow 8: aiqu_sp_benzene] └── NMS (wB97M-V) in GAS 23 [Workflow 3: aiqu_nms] ├── Conformer 138 └── Conformer 139 Properties ---------- Each **Conformer** has the attribute *properties* which may contain a list of *properties collections* each having a distinguished **Simulation** as its *source*. E.g. after optimising a conformer, the properties obtained by this optimisation (i.e. a **Simulation**) are added to the optimised **Conformer**. If afterwards another **Simulation** just calculates more properties, e.g. using a different method or in another solvent, those are added as well. As an example, here is the original JSON dump of the lowest energy conformer 122 in above example of ``COOC`` which can be obtained via ``bee conformer get 122`` or directly in a browser: `http://localhost:8000/api/v1/conformer/122 `_ (:download:`json `): .. literalinclude:: properties_COOC.json :language: json