Skip to main content

Hierarchical reaction templates

Project description

SynEPD

SynEPD is a hierarchical electron-pushing database for polar organic reaction mechanisms. It combines clean reaction records, a POLAR taxonomy, reaction-center templates, atom-mapped reaction graphs, and electron-pushing diagram (EPD) arrows in a local SQLite database with a web explorer.

Official web server: https://synepd.bioinf.uni-leipzig.de

SynEPD Explorer preview showing the search, taxonomy, statistics, and reaction graph interface

Current Data

The current local build uses the cleaned POLAR dataset:

Item Count
Clean records 1,901
Database reactions 1,887
RC templates 1,501
EPD arrows 7,095
Taxon rows 1,112
Molecules 2,125

Important files:

Path Purpose
data/polar.json Clean reaction records, IDs starting at 1
data/hierarchy.md Clean hierarchy consumed by the database builder
data/epdb.sqlite Built SQLite database used by the app

Environment

Create or update the Conda environment:

conda env create -f env.yaml
conda activate synepd

For an existing environment:

conda activate synepd
python -m pip install -r requirements.txt

The project metadata lives in pyproject.toml. Runtime dependencies are declared there, and developer tools are available through the dev extra:

python -m pip install -e ".[dev]"

Build The Data

Build the SQLite database:

PYTHONPATH=. python synepd/construct/build_release_db.py

The builder writes data/epdb.sqlite.

Run The Explorer

Use the hosted explorer at:

https://synepd.bioinf.uni-leipzig.de

For local development, start the app with:

./run_server.sh

Open:

http://127.0.0.1:8000/

By default the server reads:

SYNEPD_DATABASE_URL=data/epdb.sqlite

To use another database:

SYNEPD_DATABASE_URL=/path/to/other.sqlite ./run_server.sh

Query Examples

Find reactions that share a reaction-center template:

from pathlib import Path
from synepd.core import find_reactions_by_template

db_path = Path("data/epdb.sqlite")
template_smiles = "[H:2][NH3+:3].[O-:1][CH3:4]>>[NH3:3].[O:1]([H:2])[CH3:4]"

reactions = find_reactions_by_template(template_smiles, db_path=db_path)
print(f"Found {len(reactions)} matching reactions")

Query EPD arrows by reaction SMILES:

from pathlib import Path
from synepd.core import query_epd_by_reaction

db_path = Path("data/epdb.sqlite")
rsmi = "CC[O-].[NH4+]>>CCO"

result = query_epd_by_reaction(rsmi, db_path=db_path)
print(result["success"])
print(result.get("path"))
for arrow in result.get("arrows", []):
    print(arrow["arrow_index"], arrow["arrow_type_code"], arrow["source_atoms"], "->", arrow["target_atoms"])

Checks

Useful focused checks:

python -m py_compile synepd/core/ingest.py synepd/construct/build_release_db.py synepd/web/server.py
python -m pytest -q test/construct/test_build_release_db.py test/database/test_database_models.py
python -m pip check

Database Architecture

SynEPD stores reaction metadata, molecules, taxonomy assignments, reaction-center templates, ITS graphs, and EPD arrows in a normalized SQLite database.

Database Architecture Schema

Publishing Notes

For a public package release, upload data/epdb.sqlite to Zenodo and update DEFAULT_ZENODO_RECORD_ID in synepd/core/data.py. The package itself can then be built and uploaded with:

python -m build
python -m twine upload dist/*

License

This project is licensed under the MIT License. See LICENSE.

Acknowledgments

This project has received funding from the European Union's Horizon Europe Doctoral Network programme under the Marie Skłodowska-Curie grant agreement No. 101072930 (TACsy -- Training Alliance for Computational Systems Chemistry).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synepd-0.1.0.tar.gz (68.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synepd-0.1.0-py3-none-any.whl (73.4 kB view details)

Uploaded Python 3

File details

Details for the file synepd-0.1.0.tar.gz.

File metadata

  • Download URL: synepd-0.1.0.tar.gz
  • Upload date:
  • Size: 68.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synepd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12c6064ac9da885fa040cb7addfd96541114847f1e0fdd6c74cf3c2931b2f73e
MD5 018ab66f2cbfc1102b081a3e7b850640
BLAKE2b-256 bc46e99763531b4f955749276e1239b5f7cdee0e9e3ad9e87ba130332e782098

See more details on using hashes here.

Provenance

The following attestation bundles were made for synepd-0.1.0.tar.gz:

Publisher: publish-package.yml on TieuLongPhan/SynEPD

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synepd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: synepd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 73.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synepd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e90c6a7367d8308abfefd02464fd0a3b80c29c9b4c73b7d38b11b03e5da0c4e
MD5 267bb449f715d745b61d3c3f26f35e7f
BLAKE2b-256 8cc11b99ed7bab41ca2769af3bf52488038c46d1750395910bc466e2d5883da7

See more details on using hashes here.

Provenance

The following attestation bundles were made for synepd-0.1.0-py3-none-any.whl:

Publisher: publish-package.yml on TieuLongPhan/SynEPD

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page