RetroMol is retrosynthetic analysis tool for modular natural products
Project description
RetroMol
RetroMol is retrosynthetic parsing and fingerprinting tool for modular natural products.
RetroMol is designed to facilitate clustering modular natural products based on biosynthetic similarity, and to enable cross-modal retrieval between modular natural products and their coding biosynthetic gene clusters.
RetroMol powers the RetroMol webapp, available at here. The webapp can be used to query NPAtlas, MIBiG, and antiSMASH database entries for modular natural products based on biosynthetic similarity.
Installation
The most recent code and data can be installed directly from GitHub with:
pip install git+https://github.com/MolTools/RetroMol.git
The latest stable release can be installed from PyPI with:
pip install retromol
RetroMol has been developed for Linux and MacOS.
Getting started
The retromol command line tool is automatically installed alongside installation of the package. The command line tool can be used from the shell with the --help flag to show all subcommands:
python3 -m retromol --help
The RetroMol CLI has two modes, single and batch:
single: process a single compound at a time.batch: process multiple compounds in a single command.
In either case a the output folder will contain a log file together with the results in either JSON or JSONL format. JSONL is standard output mode for batch mode to allow for easy parsing of large result sets. Batch mode also supports parallel processing.
Any column, field, or property in the input file, either CSV, TSV, SDF, or JSON, is preserved as props in the output JSON or JSONL.
Stereochemistry parsing is supported by supplying the --matchstereochem flag. This flag annotates the identifier of every identified monomer with R/S and E/Z annotation where applicable.
Result JSONs or lines from a JSONL file can be loaded into Python using RetroMol's Result class for further downstream analyses:
from retromol.io import Result
result = Result.from_serialized(<json_dict>)
# e.g., calculate coverage
coverage = result.best_total_coverage()
Check out the examples folder for example scripts demonstrating how to use RetroMol as a library:
Using custom rules
RetroMol comes with a default set of retrosynthetic rules for modular natural products.
You can also provide your own custom rules and configurations. See the custom rules documentation for details on the YAML formats supported.
Attribution
License
The code in this package is licensed under the MIT License.
For Developers
The final section of the README is for if you want to get involved by making a code contribution.
Development installation
First fork the repository on GitHub, then clone your fork locally and install the package in "editable" mode with the development dependencies:
git clone git+https://github.com/MolTools/RetroMol.git
cd RetroMol
pip install -e .[dev]
pip install hatch # if you don't have hatch installed yet; needed for building the package
hatch env create dev # create the development environment
You can now make code changes locally and have them immediately available for testing.
After testing your changes, you can commit and push them to your fork, and then open a pull request on the main repository explaining your changes.
Testing
After cloning the repository, the unit tests in the tests/ folder can be run
reproducibly with:
pytest tests
Additionally, these tests are automatically re-run with each push and pull request on main in a
GitHub Action.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file retromol-1.0.0.tar.gz.
File metadata
- Download URL: retromol-1.0.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a0b6a1eba7ee2537d70755d9ef592aca0dd1ac680ca5fd9fe9120f88c34d81b
|
|
| MD5 |
a583f382f83c9f3a7e640ccf0a66167d
|
|
| BLAKE2b-256 |
87702c6d8b5c231ec1f45c14c03b391e48d6aba9fdd6e9c6b657945d6ecf73aa
|
File details
Details for the file retromol-1.0.0-py3-none-any.whl.
File metadata
- Download URL: retromol-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e48de8484ada438725f5080d25fe3992170b8e40bec429ceb46fbf75e53919d0
|
|
| MD5 |
d5bce6186aa13c86ec5c3e7ef499b5b9
|
|
| BLAKE2b-256 |
4b1a40ceaa33f8d79c400b54baf345d688ae9ca00fe7b86a85381208bec8cdc8
|