{"id":20904503,"url":"https://github.com/sudo-rushil/odachi","last_synced_at":"2025-05-13T05:30:41.492Z","repository":{"id":57447790,"uuid":"243114729","full_name":"sudo-rushil/odachi","owner":"sudo-rushil","description":"Advanced deep learning-based organic retrosynthesis engine.","archived":false,"fork":false,"pushed_at":"2020-05-11T21:43:02.000Z","size":25827,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T11:31:34.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.retrosynthesis.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudo-rushil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-25T22:18:54.000Z","updated_at":"2022-07-20T19:48:22.000Z","dependencies_parsed_at":"2022-09-16T22:20:45.679Z","dependency_job_id":null,"html_url":"https://github.com/sudo-rushil/odachi","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-rushil%2Fodachi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-rushil%2Fodachi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-rushil%2Fodachi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-rushil%2Fodachi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudo-rushil","download_url":"https://codeload.github.com/sudo-rushil/odachi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253882648,"owners_count":21978526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T13:17:29.440Z","updated_at":"2025-05-13T05:30:37.876Z","avatar_url":"https://github.com/sudo-rushil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Odachi\n\nAdvanced deep learning-based organic retrosynthesis engine.\n\n# Overview\n\nThe Odachi Retrosynthesis Engine provides a platform for predicting organic retrosynthetic disconnections\nusing a graph convolutional network. It also exposes two custom Tensorflow layers for performing spectral\ngraph convolutions. The engine powers the [retrosynthesis.com](retrosynthesis.com) website, which provides a clean and intuitive interface to run retrosynthetic predictions.\n\n## Requirements\n\nThe Odachi Engine is built in Python 3. It has only three requirements to run:\n\n    - TensorFlow 2.x\n    - Scikit-Learn\n    - Numpy\n\n# Reference\n\n## Installation\n\nTo download dgaintel, simply use Pypi via pip.\n```sh\n$ pip install odachi\n```\n\nAlternatively, you could install from source.\n```sh\n$ git clone https://github.com/sudo-rushil/odachi\n$ cd odachi\n$ python setup.py install\n```\n\nVerify your installation by running\n```Python\n\u003e\u003e\u003e import odachi\n\u003e\u003e\u003e odachi.engine.model.Odachi()\n'\u003codachi.engine.model.Odachi object at 0x7f9ec80b3bd0\u003e''\n```\n\n# Examples\n\n### Predict bond disconnection\nThis is simple way of finding a retrosynthetic disconnection in a molecule. The input to the model is the SMILES string of the molecule (Ex. Aspirin).\n\n```Python\nfrom odachi.engine.model import Odachi\n\nodachi = Odachi() # instantiates engine and load up TensorFlow model in backend.\n\nresults = odachi('O=C(C)Oc1ccccc1C(=O)O') # call prediction function on an input molecule.\nprint(results)\n```\n\u003e {'bonds': [2], 'smiles': 'O=C(C)Oc1ccccc1C(=O)O', 'svg':...}\n\n\n# Documentation\nThe Odachi package exposes four main objects: the GraphConv and ConvEmbed TensorFlow layers for spectral graph convolutions with knockdown, the Conv object for representing molecules as graphs, and the Odachi object for top-level predictions.\n\n## Layers\n\n### GraphConv\n\n```Python\ngraph_conv = odachi.engine.layers.GraphConv(n,\n                                            num_feat = 41,\n                                            num_atoms = 130,\n                                            activation = tf.nn.elu,\n                                            knockdown = 0.1,\n                                            BATCH_SIZE = 1)\n```\nLayer for performing single-phase spectral graph convolutions. Inherits from `tensorflow.keras.layers.Layer` and has access to all associated methods.\n\n#### Parameters\n\n- n - Layer index for labeling purpose.\n- num_feat - Number of features for each node in graph.\n- num_atoms - Maximum number of nodes over all graphs.\n- activation - Activation function for layer.\n- knockdown - Convolutional knockdown threshold for spectral regularization.\n- BATCH_SIZE - Number of batches in input\n\n### Call\n\n```Python\nA, X = graph_conv([A, X])\n```\n\n#### Parameters\n\n- A - Adjacency matrix of graph. Has dimensions (BATCH_SIZE, num_atoms, num_atoms).\n- X - Features matrix of graph. Has dimensions (BATCH_SIZE, num_atoms, num_feat).\n\n#### Returns\n\n- A - Adjacency matrix of graph. Unchanged from input.\n- X - Convolved features matrix of graph.\n\n### ConvEmbed\n\n```Python\nconv_embed = odachi.engine.layers.ConvEmbed(num_feat = 41,\n                                            num_atoms = 130,\n                                            depth = 10,\n                                            knock = 0.2,\n                                            BATCH_SIZE = 1)\n```\nModel object for performing stacked graph convolutions with the number of features staying constant across layers. Inherits from `tensorflow.keras.Model`.\n\n#### Parameters\n\n- num_feat - Number of features for each node in graph.\n- num_atoms - Maximum number of nodes over all graphs.\n- depth - Number of stacked convolutional layers.\n- knock - Convolutional knockdown threshold.\n- BATCH_SIZE - Number of batches in input.\n\n### Call\n\n```Python\nX = conv_embed([A, X])\n```\n\n#### Parameters\n\n- A - Initial adjacency matrix of graph. Has dimensions (BATCH_SIZE, num_atoms, num_atoms).\n- X - Initial features matrix of graph. Has dimensions (BATCH_SIZE, num_atoms, num_feat).\n\n#### Returns\n\n- X - Fully convolved features matrix of graph.\n\n## Molecular Graph Representation\n\n### Conv\n```Python\nconv = odachi.data.conv.Conv(smiles)\n```\nConvolutional molecule (Conv) object for storing and representing molecules as featurized graphs upon which graph convolutional methods can be applied.\n\n#### Parameters\n\n- smiles - SMILES string representing the molecule to be stored as a featurized graph.\n\n#### Attributes\n\n- smiles - SMILES string of the molecule stored in the object.\n- num_atoms - Number of atoms in the stored molecule.\n- num_feat - Number of features per each atom (default 41).\n- adj_matrix - Adjacency matrix of molecular graph. Padded up to 130 nodes by default.\n- atom_features - Features matrix of molecular graph. Padded up to 130 nodes by default.\n\n\n## Engine\n\n### Odachi\n\n```Python\nodachi = odachi.engine.models.Odachi(knock = 0.0)\n```\nEngine implementation that wraps all three phases of the retrosynthetic prediction process\nto allow for predictions to be made and streamed to the [retrosynthesis.com](retrosynthesis.com) website.\n\n#### Parameters\n\n- knock - Convolutional knockdown threshold for loading saved models.\n\n### Call\n\n```Python\nresult_dict = odachi(smiles,\n                     clusters = 2,\n                     version = 9)\n```\n\n#### Parameters\n\n- smiles - SMILES string of the query target molecule.\n- clusters - number of synthons to cluster the target molecule into.\n- version - Version edition of the convolutional embedding to use for prediction. Latest version is 9.\n\n#### Returns\n\n- result_dict - Dictionary containing prediction data.\n    - smiles - Original smiles string of target molecule.\n    - bonds - List of bonds which are predicted to be disconnected.\n    - svg - Raw SVG for rendering the predicted retrosynthetic disconnection.\n    - time - Total prediction runtime.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudo-rushil%2Fodachi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudo-rushil%2Fodachi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudo-rushil%2Fodachi/lists"}