macromolecular structures (.pdb/.mmCIF) as pandas dataframes
Project description
MacroMolecular DataFrames (mmdf)
MacroMolecular DataFrames (mmdf) is a small package for reading and writing macromolecular structure files
(.pdb/.mmCIF) using pandas dataframes.
The heavy lifting of reading structure files is performed by gemmi.
Usage
import mmdf
# Read a PDBx/mmCIF file into a dataframe
df = mmdf.read('4v6x.cif')
df.head()
Out[3]:
model chain residue residue_id ... z charge occupancy b_isotropic
0 1 Az ASN 3 ... -54.829 0 1.0 10.0
1 1 Az ASN 3 ... -54.691 0 1.0 10.0
2 1 Az ASN 3 ... -53.642 0 1.0 10.0
3 1 Az ASN 3 ... -53.007 0 1.0 10.0
4 1 Az ASN 3 ... -54.239 0 1.0 10.0
[5 rows x 13 columns]
# Other dataframe manipulation...
# Write dataframe to a PDBx/mmCIF file
mmdf.write('4v6x_new.cif', df)
You can also fetch structures by their PDB ID, they will be cached in your home directory.
import mmdf
df = mmdf.read("pdb:1crn")
Changelog
v0.0.4 (05/12/25)
- add pdb download functionality
v0.0.3 (12/12/24)
- added basic write functionality
- resolved gemmi 0.7.0 incompatibility issues
v0.0.2 (20/01/24)
- added atomic properties to dataframe output
- added support for
Patharguments inmmdf.read() - moved to
pyproject.tomlbased packaging
v0.0.1
- first release
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
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 mmdf-0.0.5.tar.gz.
File metadata
- Download URL: mmdf-0.0.5.tar.gz
- Upload date:
- Size: 5.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af2c12bc22d1a5d0f36cfb1823209d61aa0813e2bd1f545554869e8139277b6a
|
|
| MD5 |
029673f8e52b57253fa134da964a6ad5
|
|
| BLAKE2b-256 |
b14cee31a4f8404347990d91090c327667ff43e439f4f1648e061236aba27eaf
|
Provenance
The following attestation bundles were made for mmdf-0.0.5.tar.gz:
Publisher:
ci.yml on teamtomo/mmdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mmdf-0.0.5.tar.gz -
Subject digest:
af2c12bc22d1a5d0f36cfb1823209d61aa0813e2bd1f545554869e8139277b6a - Sigstore transparency entry: 744368539
- Sigstore integration time:
-
Permalink:
teamtomo/mmdf@3969c839cbefe887db46ea1f9c8c2baed240fede -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/teamtomo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@3969c839cbefe887db46ea1f9c8c2baed240fede -
Trigger Event:
push
-
Statement type:
File details
Details for the file mmdf-0.0.5-py3-none-any.whl.
File metadata
- Download URL: mmdf-0.0.5-py3-none-any.whl
- Upload date:
- Size: 7.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 |
6164718171ee9789dea17818ff82a6b901a891b5b001ecba58adb669f3add645
|
|
| MD5 |
a52493f44ce8d91d6bdff0d6d54d8549
|
|
| BLAKE2b-256 |
d78b9d613d2ed8056f1e179fd0a897797338a726b8a583cdcf5559694777f6db
|
Provenance
The following attestation bundles were made for mmdf-0.0.5-py3-none-any.whl:
Publisher:
ci.yml on teamtomo/mmdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mmdf-0.0.5-py3-none-any.whl -
Subject digest:
6164718171ee9789dea17818ff82a6b901a891b5b001ecba58adb669f3add645 - Sigstore transparency entry: 744368587
- Sigstore integration time:
-
Permalink:
teamtomo/mmdf@3969c839cbefe887db46ea1f9c8c2baed240fede -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/teamtomo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@3969c839cbefe887db46ea1f9c8c2baed240fede -
Trigger Event:
push
-
Statement type: