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.1.tar.gz (879.6 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.1-cp314-cp314-macosx_11_0_arm64.whl (653.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

molex-0.7.1-cp312-cp312-win_amd64.whl (550.0 kB view details)

Uploaded CPython 3.12Windows x86-64

molex-0.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (731.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: molex-0.7.1.tar.gz
  • Upload date:
  • Size: 879.6 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.1.tar.gz
Algorithm Hash digest
SHA256 3ce5f904b18d02f2606be3bda1f9fae84737c22fe7ae55bfc7085282a46fa059
MD5 6081aab25ee987b78278b5589de3fa87
BLAKE2b-256 73519e292745286f0fd2ea8a798002c2e587a0f7104cd929618052fd993fecc9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for molex-0.7.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da03e1de4ea5f3d652259ec2291cf17eda530b4e4974bc38ee9a84b9a7e2e6d8
MD5 067d8284bac6ea21f6e31e1905b6c4ec
BLAKE2b-256 6d84af924fa1336a9d32ca6977cbb322cfbbd0900ae8995031fa0ae0b946f29d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: molex-0.7.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 550.0 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c8e9e4989d0d8e00851fb14e91c2a28e201a0037992f312b6f8b3b426d53a88d
MD5 c92d75f7d5514840e32a9010564b8fbb
BLAKE2b-256 96f477380edb21bbb33181cc63a72dc706cc12da929e9adc8f0fa405212ace2f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for molex-0.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f076f6a568d5930c3abe6953998255e85221d6e1f3ad3a6230bf9b65e110a9f
MD5 943a517531013c5bc0b640f96bc98488
BLAKE2b-256 724ed379323e02b5fc8a3803a06b5608d8737b1d89ed80c9f4c83223e0c39ecb

See more details on using hashes here.

Provenance

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