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 other small molecules as typed entities
  • Analyze: DSSP secondary structure, hydrogen bonds, covalent bonds, disulfide bridges, SASA, contacts
  • Transform: Kabsch alignment and superposition RMSD
  • Serialize: compact binary wire 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)

asm.recompute_ss()       # opt-in DSSP secondary structure

# Per-atom numpy columns (no Biotite required) come from PyAtomTable:
table = molex.PyAtomTable.from_assembly_bytes(asm.to_assembly_bytes())
coords = table.coords    # (N, 3) float32

Atom completion (filling missing heavy atoms) happens at parse time, during file ingest; the default is Completion.Heavy. 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.2.tar.gz (895.3 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.2-cp314-cp314-macosx_11_0_arm64.whl (653.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

molex-0.7.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (731.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: molex-0.7.2.tar.gz
  • Upload date:
  • Size: 895.3 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.2.tar.gz
Algorithm Hash digest
SHA256 865de86ca69cd66b1e02e7e8bba82eaf051766f8cfb6e63205c65c82bf362919
MD5 b62e2eae8e9a38b1b3bd95d92dc37608
BLAKE2b-256 92096c13333f84184bed3b1334101c2ce00be2d4a7ea2d9790344d99381d4ce4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for molex-0.7.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47d234a9dd8dfa94ab600c75bdb1eef547e986d5dba3930a4632c9acedf3c372
MD5 38cafc9951a090d9526745923060fe5a
BLAKE2b-256 e9a7c5996f89238570b87878f737a97c2e8d4332027321a0b32ad026bba14c39

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: molex-0.7.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5caec51a0b91627ad2c4c0f64eadaeaa03fdc880b39e54006a149ce33d02d1b
MD5 d104be3d909c1f5a49e4707efdcaf13b
BLAKE2b-256 685323c5374b5c1b17f83c83f260ff0049078699be3d3df52a9280fa86dbd0ce

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for molex-0.7.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e6d18892a9af5b5e2d0598a1f4b17fb7f9abd7fdc7fc593769c4b4e0ac6b5205
MD5 04a337622cabd9882f58020fb72e3812
BLAKE2b-256 ecb1ba088e50a983ce5ee910702bb435cc19c1c6e8f31d916834a89ff2c44f71

See more details on using hashes here.

Provenance

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