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.
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)
- added basic write functionality
- resolved gemmi 0.7.0 incompatibility issues
- added atomic properties to dataframe output
- added support for
Path
arguments inmmdf.read()
- moved to
pyproject.toml
based packaging
- first release