Skip to main content

Parse, analyze, and transform molecular structure data (PDB, mmCIF, BinaryCIF, MRC)

Project description

molex

Molecular exchange — a Rust library for parsing, analyzing, and serializing molecular structure data.

Features

  • Parse PDB, mmCIF, BinaryCIF, MRC/CCP4 density maps, and DCD trajectories
  • Entity model — proteins, nucleic acids, ligands, ions, waters, and cofactors as typed entities
  • Analyze — DSSP secondary structure, hydrogen bonds, covalent bonds, disulfide bridges
  • Transform — Kabsch alignment, CA extraction, backbone segments
  • Serialize — compact binary assembly format for FFI and IPC
  • Python bindings — PyO3 module with AtomWorks/Biotite interop

Quick start

use molex::adapters::pdb::pdb_file_to_entities;

let entities = pdb_file_to_entities("1ubq.pdb".as_ref())?;
for e in &entities {
    println!("{}: {} atoms", e.label(), e.atom_count());
}

Python

pip install molex

The Python API is object-centric: parse a structure into an Assembly, walk its entities and residues, and read atoms as numpy columns.

import molex

asm = molex.Assembly.from_pdb(open("1ubq.pdb").read())
for e in asm.entities():
    print(e.kind, e.chain_id, e.residue_count)

arr = asm.to_arrays()    # per-atom numpy columns, no Biotite required
asm.recompute_ss()       # opt-in DSSP secondary structure

Atom completion (filling missing heavy atoms) happens at parse time, during file ingest. from_mmcif and from_bcif parse the other formats. The *_to_assembly_bytes / assembly_bytes_to_* free functions are transport helpers for the wire protocol, not the default path. Type stubs (molex.pyi) ship with the wheel.

Optional features

Feature Description
python PyO3 bindings for use from Python

Documentation

License

MIT

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

molex-0.6.0.tar.gz (862.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

molex-0.6.0-cp314-cp314-macosx_11_0_arm64.whl (655.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

molex-0.6.0-cp312-cp312-win_amd64.whl (555.1 kB view details)

Uploaded CPython 3.12Windows x86-64

molex-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (727.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file molex-0.6.0.tar.gz.

File metadata

  • Download URL: molex-0.6.0.tar.gz
  • Upload date:
  • Size: 862.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for molex-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f5d8973e851bac1d68fbebf90219942feb3bf13b50b7afae3475bde4dfbd48d9
MD5 462953875b283417a399a1dc5a8211bc
BLAKE2b-256 426998e444b9a415ab24001155169ac9d073e0800f3f611a7becf348e5166f84

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.6.0.tar.gz:

Publisher: release.yml on foldit-org/molex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molex-0.6.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for molex-0.6.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 877501993b6657cf7edbb66fc884bc64f18c6186d09d01a6138387481b24925f
MD5 a1b12420e92c4c3e3c903863ab4fb8ce
BLAKE2b-256 88601fe2d72c71fa53ffe5ab8c9294755416c3ad6e11e2d0cc07fa9dbf38cff7

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.6.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on foldit-org/molex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molex-0.6.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: molex-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 555.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for molex-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b4bf065f79e9967192923f27767961d2a361eb3f2bc5614a2ed4a7781ab4cadc
MD5 3b690c67e8715fc3acafb85a3b6ecbeb
BLAKE2b-256 202132c43c9d18dff8c6507c5dd0db6adddfbbe28c3e4012b038678c1741f12b

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.6.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on foldit-org/molex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molex-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for molex-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f927f98a6899404dfd2c45fef466633abf572fcc20009cd1f5eb415463df17fb
MD5 ebd986656412b617d79f08338c362eac
BLAKE2b-256 dfa463a47c4d88c785e2190473f194d67e543eb032a9682808bafa9816c6afa9

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on foldit-org/molex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page