spyrmsd

📐 Symmetry-corrected RMSD in Python

https://github.com/rmeli/spyrmsd

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.5%) to scientific vocabulary

Keywords

cadd computational-biology computational-chemistry computer-aided-drug-design docking drug-discovery molecular-docking rmsd symmetry

Keywords from Contributors

data-management mesh interpretability sequences generic projection interactive optim hacking network-simulation
Last synced: 6 months ago · JSON representation ·

Repository

📐 Symmetry-corrected RMSD in Python

Basic Info
Statistics
  • Stars: 101
  • Watchers: 6
  • Forks: 9
  • Open Issues: 5
  • Releases: 23
Topics
cadd computational-biology computational-chemistry computer-aided-drug-design docking drug-discovery molecular-docking rmsd symmetry
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing Funding License Code of conduct Citation

README.md

sPyRMSD

pytest flake8 mypy codecov

Docs Documentation Status

License PyPI Conda Version

J. Cheminform. Zenodo

Python tool for symmetry-corrected RMSD calculations.


If you find spyrmsd useful, please consider citing the following paper:

text @article{spyrmsd2020, Author = {Meli, Rocco and Biggin, Philip C.}, Journal = {Journal of Cheminformatics}, Number = {1}, Pages = {49}, Title = {spyrmsd: symmetry-corrected RMSD calculations in Python}, Volume = {12}, Year = {2020} }

Installation

spyrmsd is available on PyPI and conda-forge and can be easily installed from source. See Dependencies for a description of all the dependencies.

[!NOTE] spyrmsd will install rustworkx when using pip or conda. You can install other backends manually.

[!WARNING] If spyrmsd is used as a standalone tool, it is required to install either RDKit or Open Babel. Neither is automatically installed with pip nor conda.

PyPI

bash pip install spyrmsd

conda

bash conda install spyrmsd -c conda-forge

GitHub

bash git clone https://github.com/RMeli/spyrmsd.git cd spyrmsd pip install .

Dependencies

spyrmsd can be used both as a module or as a standalone tool.

Module

The following packages are required to use spyrmsd as a module:

One of the following graph libraries is required: * graph-tool * rustworkx * NetworkX

[!NOTE] spyrmsd uses the following priority when multiple graph libraries are present: graph-tool, rustworkx, NetworkX. This order might change. Use set_backend to ensure you are always using the same backend, if needed.

Standalone Tool

Additionally, one of the following packages is required to use spyrmsd as a standalone tool:

Usage

Standalone Tool

spyrmsd provides a convenient CLI tool. See spyrmsd's --help for the usage:

bash python -m spyrmsd -h

Module

python from spyrmsd import rmsd

RMSD

The function rmsd.rmsd computes RMSD without symmetry correction. The atoms are expected to be in the same order for both molecules being compared (no atom matching is performed).

python def rmsd( coords1: np.ndarray, # Coordinates of molecule 1 coords2: np.ndarray, # Coordinates of molecule 2 aprops1: np.ndarray, # Atomic properties of molecule 1 aprops2: np.ndarray, # Atomic properties of molecule 2 center: bool = False, # Flag to center molecules at origin minimize: bool = False, # Flag to compute minimum RMSD atol: float = 1e-9, # Numerical tolerance for QCP method )

[!NOTE] Atomic properties (aprops) can be any Python object when using NetworkX and rustworkx, or integers, floats, or strings when using graph-tool.

Symmetry-Corrected RMSD

The function rmsd.symmrmsd computes symmetry-corrected RMSD using molecular graph isomorphisms. Symmetry correction requires molecular adjacency matrices describing the connectivity but needs not the atoms to be in the same order.

Atom matching is performed according to the molecular graph. This function should also be used when atoms in the molecules being compared are not in the same order (even if there is not symmetry to be accounted for).

python def symmrmsd( coordsref: np.ndarray, # Reference coordinated coords: Union[np.ndarray, List[np.ndarray]], # Coordinates (one set or multiple sets) apropsref: np.ndarray, # Reference atomic properties aprops: np.ndarray, # Atomic properties amref: np.ndarray, # Reference adjacency matrix am: np.ndarray, # Adjacency matrix center: bool = False, # Flag to center molecules at origin minimize: bool = False, # Flag to compute minimum RMSD cache: bool = True, # Cache graph isomorphisms atol: float = 1e-9, # Numerical tolerance for QCP method )

[!NOTE] Atomic properties (aprops) can be any Python object when using NetworkX and rustworkx, or integers, floats, or strings when using graph-tool.

Select Backend

spyrmsd supports the following graph libraries for the calculation of graph isomorphisms: * graph-tool * NetworkX * rustworkx

You can check which backend is being used with

python spyrmsd.get_backend()

You can also manually select your preferred backend with

```python spyrmsd.set_backend("networkx")

spyrmsd uses NetworkX

spyrmsd.setbackend("graphtool")

spyrmsd uses graph_tool

```

The available backends (which depend on the installed dependencies) are stored in spyrmsd.available_backends.

Development

To ensure code quality and consistency the following tools are used during development:

Pre-commit git hooks can be installed with pre-commit.

Copyright

Copyright (c) 2019-2024, Rocco Meli.

References

References are tracked with duecredit. Run the credits.sh script in order to print up-to-date references.

Acknowledgements

Project based on the Computational Molecular Science Python Cookiecutter version 1.1.

Owner

  • Name: Rocco Meli
  • Login: RMeli
  • Kind: user
  • Location: Zurich, Switzerland
  • Company: @eth-cscs

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Meli"
  given-names: "Rocco"
  orcid: "https://orcid.org/0000-0002-2845-3410"
- family-names: "Nelen"
  given-names: "Jochem"
  orcid: "https://orcid.org/0000-0002-9970-4950"
title: "spyrmsd"
version: 0.9.0
doi: 10.5281/zenodo.3631876
date-released: 2021-06-21
url: "https://github.com/RMeli/spyrmsd"
preferred-citation:
  type: article
  authors:
  - family-names: "Meli"
    given-names: "Rocco"
    orcid: "https://orcid.org/0000-0002-2845-3410"
  - family-names: "Biggin"
    given-names: "Philip C."
    orcid: "https://orcid.org/0000-0001-5100-8836"
  doi: "10.1186/s13321-020-00455-2"
  journal: "J. Cheminform."
  title: "spyrmsd: symmetry-corrected RMSD calculations in Python"
  volume: 12
  year: 2020

GitHub Events

Total
  • Issues event: 1
  • Watch event: 17
  • Delete event: 2
  • Issue comment event: 2
  • Push event: 8
  • Pull request review comment event: 1
  • Pull request review event: 4
  • Pull request event: 8
  • Fork event: 2
  • Create event: 3
Last Year
  • Issues event: 1
  • Watch event: 17
  • Delete event: 2
  • Issue comment event: 2
  • Push event: 8
  • Pull request review comment event: 1
  • Pull request review event: 4
  • Pull request event: 8
  • Fork event: 2
  • Create event: 3

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 521
  • Total Committers: 5
  • Avg Commits per committer: 104.2
  • Development Distribution Score (DDS): 0.017
Past Year
  • Commits: 18
  • Committers: 4
  • Avg Commits per committer: 4.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Rocco Meli r****i@b****h 512
dependabot[bot] 4****] 4
Thomas Kluyver t****l@g****m 2
Jochem Nelen 7****n 2
Franz Goerlich 1****3 1
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 18,952 last-month
  • Total docker downloads: 140
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 7
    (may contain duplicates)
  • Total versions: 25
  • Total maintainers: 1
pypi.org: spyrmsd

Python RMSD tool with symmetry correction.

  • Versions: 16
  • Dependent Packages: 1
  • Dependent Repositories: 6
  • Downloads: 18,952 Last month
  • Docker Downloads: 140
Rankings
Downloads: 1.5%
Average: 4.1%
Docker downloads count: 4.3%
Dependent packages count: 4.8%
Dependent repos count: 6.0%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: spyrmsd

Symmetry-corrected RMSD

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.3%
Stargazers count: 41.5%
Average: 42.4%
Dependent packages count: 51.6%
Forks count: 52.2%
Last synced: 6 months ago

Dependencies

setup.py pypi
  • numpy *
.github/workflows/flake8.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v1 composite
.github/workflows/mypy.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v1 composite
.github/workflows/pre-commit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit-ci/lite-action v1.0.1 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/pypi.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pytest.yml actions
  • actions/checkout v3 composite
  • codecov/codecov-action v3 composite
  • conda-incubator/setup-miniconda v2 composite
pyproject.toml pypi