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.7.0.tar.gz (878.7 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.7.0-cp314-cp314-macosx_11_0_arm64.whl (648.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

molex-0.7.0-cp312-cp312-win_amd64.whl (544.7 kB view details)

Uploaded CPython 3.12Windows x86-64

molex-0.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (726.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for molex-0.7.0.tar.gz
Algorithm Hash digest
SHA256 dbcbbb77ae3c04e81be23d7ae201f5c087c675ec452db5b48a1340cca7222c16
MD5 993b9e2cf2f3edbd6dcd01b77a432016
BLAKE2b-256 7fe3dc85c75e00ea179f9470faa5ab17b314c35960202267b22f36915eda4fda

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.7.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.7.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for molex-0.7.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa8a60dea89ec0d3059c1cef47640d5a154e0ca948d2d8a0056021f5fa392abb
MD5 4c8bd70df03a3a4968b7c1081df063a4
BLAKE2b-256 1f5e49da0f94acb2e047961d60486f3c25261a8a4e46528416488280d385b257

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.7.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.7.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: molex-0.7.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 544.7 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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b744b1a98680dd1124df00854398556d420904636f8f21365e61841ac6a0ad82
MD5 99f7c586f65fce6e668a7bf5a68906ea
BLAKE2b-256 b44174329ccc2605eaebbc1a1afb341e8e66ffcb7c496ac20dfdf15be87ba982

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.7.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.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for molex-0.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f6d0546632b642e8c805e3c062685c822d781fdc4d6e6a416d19f0f01adb1f8
MD5 bc974fa4b086932c87f89836cb25b78a
BLAKE2b-256 fc33ae95dc9723de328afc00a764f3d85cd45f0e0a5e5be89610fbfc83fbc9c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for molex-0.7.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