Skip to main content

Prism Pruner

Project description

Prism Pruner

License Powered by: Pixi Code style: ruff GitHub Workflow Status Codecov PyPI - Version

PRISM (Pruning Interface for Similar Molecules) is the modular similarity pruning code originally from FIRECODE, in a polished standalone package. It filters out duplicate structures from conformational ensembles, leaving behind non-redundant states.

The code implements a cached, iterative, divide-and-conquer approach on increasingly large subsets of the ensemble and removes duplicates as assessed by one of three metrics:

  • Relative deviation of the moments of inertia on the principal axes
  • Heavy-atom RMSD and maximum deviation
  • Rotamer-corrected heavy-atom RMSD and maximum deviation

Installation

The package is distributed through PyPI.

pip install prism_pruner

Usage

The main pruning functions are in prism_pruner.pruning, and a wrapper that chains up to all three is also available. The functions return the pruned ensemble structures and the relative boolean mask.

from prism_pruner.conformer_ensemble import ConformerEnsemble
from prism_pruner.pruner import prune

ensemble = ConformerEnsemble.from_xyz("ensemble.xyz")

ensemble.coords.shape # (1086, 136, 3)

pruned, mask = prune(
    ensemble.coords,
    ensemble.atoms,

    # the third pruning routine can be
    # slow and is often not necessary,
    # so it's off by default
    rot_corr_rmsd_pruning=False,

    debugfunction=print,
)

pruned.shape # (387, 136, 3)
mask.shape # (1086,)
# where pruned is ensemble.coords[mask]

For additional performance, it is also possible to read/provide energies to only evaluate the similarity of structures that are energetically close.

For additional usage, see the examples folder.

Credits

This package was created with Cookiecutter and the jevandezande/pixi-cookiecutter project template.

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

prism_pruner-0.0.5.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

prism_pruner-0.0.5-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file prism_pruner-0.0.5.tar.gz.

File metadata

  • Download URL: prism_pruner-0.0.5.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for prism_pruner-0.0.5.tar.gz
Algorithm Hash digest
SHA256 fd1142eae096cae42d68b855017665c0cbe1b4d2e7dbc84277cff2ec97262507
MD5 91d6ef962d77d3d044bc44a3fda0b741
BLAKE2b-256 863733850fc35f721e25da7a43e96dfc424011977aac2ebff64e600398cbf4c8

See more details on using hashes here.

File details

Details for the file prism_pruner-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: prism_pruner-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for prism_pruner-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4c390a08820209b06d124e8233b2592b2505a019fa7b52ef6f92f66ee2f426b1
MD5 8d233076496f6a7ae5b66f30ec81f79b
BLAKE2b-256 7694a6823246708ee9c75e35ee1eaeacb6eb6b1b7a437008710a6df58f3eddfb

See more details on using hashes here.

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