Skip to main content

Prism Pruner

Project description

Prism Pruner

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

PRISM logo

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. Installation through uv is recommended.

uv 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.

CLI usage

A simple CLI is also provided:

usage: prism_pruner [-h] [-e] [-t TIMEOUT] inputfile

Will write the pruned ensemble to inputfile_pruned.xyz.

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.1.1.tar.gz (29.8 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.1.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prism_pruner-0.1.1.tar.gz
  • Upload date:
  • Size: 29.8 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.1.1.tar.gz
Algorithm Hash digest
SHA256 363c9574ac27f37e6d4d09c973c7f5904ed2c24a86df5379c5e72af19d772f8d
MD5 833704fc69df92e8c9d9baf1085f4418
BLAKE2b-256 5e604b41b2baa82fabd76c984a5df87b2e75878226aa068fd332e8fb6b5bcb3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prism_pruner-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.4 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e67f5989fc49a2d7444934f517a3b81955b81afddd69b1070a641571c076012d
MD5 7c3e5e8695bb9317edeb2c07e55055c1
BLAKE2b-256 fc6d9dd452cd06e66ee91f885080b34edd798ffb236f340b50ee162d6ad35907

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