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.5.3.tar.gz (313.0 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.5.3-cp314-cp314-macosx_11_0_arm64.whl (620.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

molex-0.5.3-cp312-cp312-win_amd64.whl (522.0 kB view details)

Uploaded CPython 3.12Windows x86-64

molex-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (694.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for molex-0.5.3.tar.gz
Algorithm Hash digest
SHA256 cc723b4b9ad7b2196b942bc0aa201e9e15955e119a07bf5efc34163e7d5b2173
MD5 f3618def4528c331cf21ddaa16f687f5
BLAKE2b-256 ad380a3befcfbbb257ddd0d62c9ef26cc96b17b17bb92ae2c9d9c03d6fa88df8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for molex-0.5.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c79d1e3c250fe862562619cdbe1293beb16bb84c8622d9dc15eabfcd185bd35d
MD5 c2484541525e0f16a64f77d050b42f0b
BLAKE2b-256 ae9562f55a99d1174c1ea8e7ab7b3c5e9c6e86e0eedbdefd00bc52faa24995a2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: molex-0.5.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 522.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.5.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 883ccb03e2050d4d6d14f48cb7f96160bdeea8ef7a25aa9219ce33c09896460c
MD5 d2e5872cdf6cae3a880e22ce83e5d7db
BLAKE2b-256 5786aa0d807aafafc33673f4764954e4d58cfe76adbbd702e79cce9066b39c18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for molex-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c8201cb2e7eeab726038ca773d96a8e8c6a71bfa86556d1875d9d3a3d5d5320
MD5 ea2218de9e4f076d65b543a0a1111efa
BLAKE2b-256 6fe9d0ce170743db14545e509ffc1bbcd07d8f6b44c4ab61fd5acde8014e5d0a

See more details on using hashes here.

Provenance

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