Contact Molecular Surface calculation for protein design — a Python port of Longxing Cao's C++ implementation
Project description
Longxing Cao's Contact Molecular Surface has been ported to python to allow the next generation of protein designers to use it with ease. Contact Molecular Surface (contact ms) is based on Lawrence and Colman's 1993 paper where they calculate Shape Complementarity. The difference is that instead of returning a singular value denoting the shape complementarity, contact ms instead returns a distance-weighted surface area of the target molecule.
At it's core, contact ms is based on the following formula:
contact_ms = area * exp( -0.5 * distance**2)
Where area is the interfacial area on the target and distance is the distance between the binder and the target (from the molecular surfaces) at that point.
Perhaps the coolest new thing the python version brings is per-atom contact ms! I always thought this was a dubious idea but it actually turns out its very straightforward based on the math.
Here's an image from my PhD explaining why contact ms is better than SASA or Shape Complementarity:
(Look up Brian Coventry Dissertation if you want the full story about it's pros and cons)
In terms of using this library, there are really only two functions you need:
from py_contact_ms import calculate_contact_ms, get_radii_from_names
# You'll have to figure out how to generate the following arrays
binder_xyz = xyz of binder heavy-atoms (non-hydrogen)
binder_res_names = list of residue name3 for each xyz (so like [ARG, ARG, ARG, LYS])
binder_atom_names = list of atom names for each xyz, stripped (so like [N, CA, C, O])
target_xyz = ...
target_res_names = ...
target_atom_names = ...
# Do not supply your own radii! CMS requires specific radii
binder_radii = get_radii_from_names(binder_res_names, binder_atom_names)
target_radii = get_radii_from_names(target_res_names, target_atom_names)
# Remember, contact_ms is only on the target side by convention
contact_ms, per_target_atom_cms, calc = calculate_contact_ms(binder_xyz, binder_radii, target_xyz, target_radii)
# If you also want the binder-side, you can do this (avoids recomputing everything)
binder_cms, per_binder_atom_cms = calc.calc_contact_molecular_surface(target_side=False)
# If you are doing small-molecule design, you may also want to know the maximum CMS possible (basically the surface area)
from py_contact_ms import calculate_maximum_possible_contact_ms
max_target_cms, max_target_cms_per_atom = calculate_maximum_possible_contact_ms(target_xyz, target_radii)
Many thanks the Claude and ChatGPT for making this herculean effort possible (in like 20 hours which is insane)
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 py_contact_ms-0.1.0.tar.gz.
File metadata
- Download URL: py_contact_ms-0.1.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
246d00c4b97cf24c96e28133d6659db4c01f8b0a2065a8cf04ff2b6f558901b4
|
|
| MD5 |
2ecd030c0d1009757227a21a6a4b0459
|
|
| BLAKE2b-256 |
fd7cf6be4b1c6405f18ad492aafb78914d306ab05d356234de4243a2ab68bdfe
|
Provenance
The following attestation bundles were made for py_contact_ms-0.1.0.tar.gz:
Publisher:
publish.yml on ullahsamee/py_contact_ms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_contact_ms-0.1.0.tar.gz -
Subject digest:
246d00c4b97cf24c96e28133d6659db4c01f8b0a2065a8cf04ff2b6f558901b4 - Sigstore transparency entry: 1101040437
- Sigstore integration time:
-
Permalink:
ullahsamee/py_contact_ms@7158689c5e140d0a36c7f24483cbf017c022d747 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ullahsamee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7158689c5e140d0a36c7f24483cbf017c022d747 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py_contact_ms-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py_contact_ms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5658080c660407bb66f5e2da55ac2248983a16ce4827ff8b023cafe262f6022
|
|
| MD5 |
a85491076bae7d9d705484e69718190f
|
|
| BLAKE2b-256 |
9730606d25d4975b77643ef03361866c84851f58680cbbd2be935dda30142717
|
Provenance
The following attestation bundles were made for py_contact_ms-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ullahsamee/py_contact_ms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_contact_ms-0.1.0-py3-none-any.whl -
Subject digest:
f5658080c660407bb66f5e2da55ac2248983a16ce4827ff8b023cafe262f6022 - Sigstore transparency entry: 1101040440
- Sigstore integration time:
-
Permalink:
ullahsamee/py_contact_ms@7158689c5e140d0a36c7f24483cbf017c022d747 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ullahsamee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7158689c5e140d0a36c7f24483cbf017c022d747 -
Trigger Event:
release
-
Statement type: