phm-molcheck
Deterministic physical-validity gate for AI-generated molecular and
protein structures (PDB-level). Pure checks, no learnable parameters,
no RDKit dependency — just numpy.
The checker does not trust the generating model's internal state; it reads only the output structure file and answers one question: is this structure physically plausible?
Battle-tested as an independent QC layer on AI-generated protein-binder structures; generalized here as a model-agnostic tool.
Checks (all deterministic)
| ID | Check | Rule |
|---|---|---|
| C1 | atomic clashes | non-bonded pair with overlap r_vdw_i + r_vdw_j - d >= 0.4 A (MolProbity-style, grid-accelerated) |
| C2 | bond-length sanity | covalent distance vs standard covalent radii, deviation > 25% flagged |
| C3 | cross clashes | generated structure vs a reference (ligand/target), when supplied |
| C4 | packing density | atoms per 1000 A^3 (observational) |
Parser hygiene: crystal waters (HOH/WAT), altloc B+ conformations, and hydrogens are filtered — the classic false-clash sources in PDB files.
Every input file gets a SHA-256 digest; every batch report carries an audit digest. Same input → same report, always.
Install
pip install numpy
pip install git+https://github.com/PHM-Audit/phm-molcheck
Use as a library
from phm_molcheck import qc_structure, batch_qc
r = qc_structure("generated_binder.pdb", ref_pdb="target_complex.pdb")
print(r["verdict"]) # PASS / FAIL / NO_ATOMS
print(r["C1_clash_pairs"]) # number of severe non-bonded overlaps
print(r["C2_bad_bonds"]) # unreasonable covalent distances
rep = batch_qc("./out/**/*.pdb", ref_pdb="target_complex.pdb",
out_json="report.json")
print(rep["summary"]) # {'PASS': .., 'FAIL': .., 'pass_rate': ..}
Use as a CLI
python -m phm_molcheck.checker "./generated/*.pdb" target.pdb report.json
Scope and limits
- This package contains deterministic PDB-level geometric checks only. It does not perform force-field minimization, learned quality prediction, or chemistry-aware graph validation (that would require RDKit or heavier machinery).
- Verdicts are mechanical: C1/C3 clashes drive FAIL; C4 is observational.
- Hydrogens are ignored (crystal structures typically omit them).
Tests
pip install pytest numpy
pytest tests/ -q
License
MIT
Metadata
Release files for phm-molcheck 1.0.0
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 |
|---|---|---|---|---|
| phm_molcheck-1.0.0.tar.gz | 9.1 kB | Without provenance | Details for phm_molcheck-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phm_molcheck-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for phm_molcheck-1.0.0-py3-none-any.whl |
Total release size: 17.1 kB
Release files / phm_molcheck-1.0.0.tar.gz
| Download URL | phm_molcheck-1.0.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf86af8a1800b8daa2f630e5fdd7a6d6686b7f36ffe895c2ea16c7087f3c68ee
|
|
BLAKE2b-256 checksum How to use checksums |
4c734020873ced64383004dccf7025ac4467c85963467687070a15e542e01e03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / phm_molcheck-1.0.0-py3-none-any.whl
| Download URL | phm_molcheck-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
178c2f3a5c18a09f7fbc0af5b63d0f798de7f98118f0e28d612e67d81cfb209a
|
|
BLAKE2b-256 checksum How to use checksums |
f9d253a0ca753a2e9fb6a246281b0be2a19ea77dea7a4bf90586c57801bca7e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for phm-molcheck 1.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.