Skip to main content

PyXYZ - A Python Library for Conformer Ensemble Manipulation

pyxyz is a Python library written in C++ using Pybind11. This library provides several operations that can be performed on an ensemble of molecular conformations stored in the XYZ format. Typically, programs for conformational search provide results in the form of XYZ files, which need to be converted to input files for subsequent quantum chemical optimization. Before doing this, one might want to perform the following operations before generating the input files:

  • Discard conformations with excessively high energy
  • Remove duplicates
  • Check for the preservation of geometry constraints and discard structures where they are violated
  • Analyze the ensemble and identify weak interactions (hydrogen bonds, etc.) that can form in the molecule. The identified contacts can be included in additional runs of the conformational search with constraints to better explore the possibilities of these interactions.

One of the biggest strengths of the pyxyz library is its ability to accurately compute the RMSD by considering all molecular graph automorphisms. This means that the calculation takes into account the equivalence of atoms, allowing for a more precise measurement of geometry similarity. For each identified automorphism, the library utilizes the Kabsch algorithm to compute RMSD. With pyxyz, you can trust that your RMSD calculations are taking into account all relevant information for a more accurate result.

The pyxyz library allows solving these problems in a few lines of Python code. This library is also useful for analyzing XYZ files obtained from various molecular simulations, such as optimizations, scans, IRC, etc. Here is a basic example of how to use pyxyz:

pip install --upgrade pyxyz24
from pyxyz import Confpool, KC2H, smallest_rmsd_pair

p = Confpool()
p.include_from_file("initial_set.xyz")
print(f"Initial number of conformers = {p.size}")

n_del = 0
p["Energy"] = lambda m: float(m.descr.strip())
p.sort("Energy")
n_del += p.upper_cutoff("Energy", 10.0 * KC2H)
p.generate_connectivity(0, mult=1.3, ignore_elements=[], sdf_name='connectivity_check.sdf')
niso = p.generate_isomorphisms()
print(f"Number of isomorphisms = {niso}")

rmsd_status = p.rmsd_filter(0.2, energy_threshold=1.0 * KC2H, energy_key='Energy', mirror_match=True, print_status=False)
n_del += rmsd_status['DelCount']
print(f"{n_del} conformers were filtered in total")

min_rmsd, min_pair = smallest_rmsd_pair(p.get_rmsd_matrix())
newp = Confpool()
newp.include_subset(p, min_pair)
newp.save_xyz("rmsd_test.xyz")
print(f"The minimal accepted rmsd was {min_rmsd}")
print(f"Number of conformers after filtering = {p.size}")
p.save_xyz('full_set.xyz')

The library also provides functionality for analyzing geometric features of the conformations.

Documentation

pipeline status

Available here

Gitlab home page

PyPi page

Metadata

Release files for pyxyz24 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyxyz24 2.0.2
File Size Uploaded Provenance Actions
pyxyz24-2.0.2.tar.gz 4.9 MB Without provenance Details for pyxyz24-2.0.2.tar.gz

Release files / pyxyz24-2.0.2.tar.gz

Download URL pyxyz24-2.0.2.tar.gz
Size 4.9 MB
Tags Source
SHA-256 checksum
How to use checksums
98498ab851123548d78ac82016c67877f09c2e4bd3fb591f8c1c123df7f2be5d
BLAKE2b-256 checksum
How to use checksums
c3212036fa9f683158b6b32b9e5c7cb40cb86bdf18962faad04272762421d9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for pyxyz24 2.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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