Skip to main content

torch-structure-manipulation

Typed, in-memory utilities for atomic structures:

  • AtomicStructure.from_dataframe converts mmdf-compatible DataFrames into device-aware tensors, with positions stored in (z, y, x) array order.
  • AtomicStructure.from_annotated_dataframe annotates bonding metadata and then constructs the structure in one step.
  • annotate_bonding_environments adds template-derived bonding and protein/rna/other molecule annotations without reading files.
  • classify_structure_composition and get_scattering_provider_keys expose aggregate composition labels and per-atom Peng provider keys respectively.
  • Centering, rotation, translation, atom selection, and coordinate conversion helpers are re-exported from the package root (also available under structure_transforms).
import mmdf

from torch_structure_manipulation import (
    AtomicStructure,
    annotate_bonding_environments,
    center_structure,
)

# File I/O belongs to the caller; mmdf is not a runtime dependency.
atoms = mmdf.read("structure.cif")
structure = AtomicStructure.from_annotated_dataframe(atoms, include_hydrogens=False)

# Or annotate first when you still need the DataFrame:
annotated = annotate_bonding_environments(atoms)
centered = center_structure(annotated, center_point=(0.0, 0.0, 0.0), zyx=False)
structure = AtomicStructure.from_dataframe(centered)

License

This project is licensed under the BSD 3-Clause License; see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_structure_manipulation-0.6.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

torch_structure_manipulation-0.6.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for torch_structure_manipulation-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b49dbdb6d69fcbce354ddb2c168b2c420ce16d9c9ec3ad77333fe5363d1b9af6
MD5 a411bddba5d582bf5bfd4676e920a542
BLAKE2b-256 27f2229ba2fee850c44c53f579f066437152f22510c32013715db6664e855cc8

See more details on using hashes here.

Provenance

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

Publisher: deploy.yml on teamtomo/teamtomo

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

File details

Details for the file torch_structure_manipulation-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_structure_manipulation-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70300bb7c2f1d0b96e9ba6a8fa8912bcea7c7e7e15737388d17bf1abffbfe462
MD5 f7ee163dfdee8b9df0c8787e4993055c
BLAKE2b-256 002d6917d0bf1e9ee85bb75722f880b74a793522a1adcae3552cd93a3a23f392

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_structure_manipulation-0.6.0-py3-none-any.whl:

Publisher: deploy.yml on teamtomo/teamtomo

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

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page