SynRecon
Reconstruct molecular formulas from exact (monoisotopic) mass.
Given a neutral exact (monoisotopic) mass, SynRecon searches for a non-negative integer composition over a chosen element set that matches the mass within a configurable tolerance (default 1e-5 Da). Enumeration is performed using integer scaling with a fast DFS enumeration and an optional ILP backend. Scope: basic single best formula; optional chemistry filters (DBE ≥ 0, even-electron rule, nitrogen rule) can be enabled to tighten results.
Highlights
- Integer-weight DFS enumeration for raw candidate formulas.
- Optional chemical filters: DBE, even-electron rule, nitrogen rule.
- Optional simple isotopologue expansion (e.g. D for H).
- Small, dependency-light core; optional ILP backend for constrained searches.
Install
pip install synrecon
Quick examples
Python API (recommended)
from synrecon.solver import solve_formula, enumerate_formulas
# single best solution (or None)
sol = solve_formula(
180.063388104,
elements=["C", "H", "O"],
abs_tol_da=1e-5,
enforce_dbe=True,
)
if sol is None:
print("No solution found within tolerance.")
else:
print("Best formula:", sol.formula)
print("Calculated mass:", sol.mass_calc)
print("Absolute error (Da):", sol.abs_error)
print("DBE:", sol.dbe)
# enumerate several candidates (more verbose)
candidates = enumerate_formulas(
180.063388104,
elements=["C", "H", "O"],
abs_tol_da=1e-5,
enforce_dbe=True,
max_candidates=20,
sort_by="abs_error",
)
print("\nTop candidates:")
for s in candidates[:10]:
print(f"{s.formula:12s} mass={s.mass_calc:.6f} err={s.abs_error:.6e} dbe={s.dbe}")
CLI
synrecon solve --mass 180.063388104 \
--elements "C H O" \
--tol 1e-5 \
--dbe \
--allow-isotopes \
--labels "D T"
Contributing
Publication
License
This project is licensed under MIT License - see the License file for details.
Acknowledgments
This project has received funding from the European Unions Horizon Europe Doctoral Network programme under the Marie-Skłodowska-Curie grant agreement No 101072930 (TACsy -- Training Alliance for Computational)
Metadata
Release files for synrecon 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| synrecon-0.0.1.tar.gz | 23.9 kB | With provenance | Details for synrecon-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| synrecon-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for synrecon-0.0.1-py3-none-any.whl |
Total release size: 42.8 kB
Release files / synrecon-0.0.1.tar.gz
| Download URL | synrecon-0.0.1.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3be21a5a8edc055e7d8a1cacff92b051759dc00b1cf8243017f54e3124ef55c5
|
|
BLAKE2b-256 checksum How to use checksums |
0b07218514d380af8616e2abb3b075fa5d733823d3559b3d4f540319465beb96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2025.
Transparency logRelease files / synrecon-0.0.1-py3-none-any.whl
| Download URL | synrecon-0.0.1-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0d7bbde33305255fec795759b5f89b465ecdc93ce4879832c21cb8a2087a6f9
|
|
BLAKE2b-256 checksum How to use checksums |
32f2869d194cc19326f60d39e7bd51389a69ce6d82e56c2c835f9628356644ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2025.
Transparency logSecurity for synrecon 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for synrecon-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.