{"id":17306553,"url":"https://github.com/rmeli/spyrmsd","last_synced_at":"2025-04-04T09:06:29.441Z","repository":{"id":43688894,"uuid":"214157073","full_name":"RMeli/spyrmsd","owner":"RMeli","description":"📐 Symmetry-corrected RMSD in Python","archived":false,"fork":false,"pushed_at":"2024-11-18T08:20:10.000Z","size":792,"stargazers_count":93,"open_issues_count":4,"forks_count":8,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-03-28T08:04:42.132Z","etag":null,"topics":["cadd","computational-biology","computational-chemistry","computer-aided-drug-design","docking","drug-discovery","molecular-docking","rmsd","symmetry"],"latest_commit_sha":null,"homepage":"https://spyrmsd.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RMeli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-10-10T10:47:35.000Z","updated_at":"2025-03-11T19:44:16.000Z","dependencies_parsed_at":"2023-10-14T20:07:42.450Z","dependency_job_id":"9c5067ee-8931-42ea-a894-efc2516925a5","html_url":"https://github.com/RMeli/spyrmsd","commit_stats":{"total_commits":516,"total_committers":5,"mean_commits":103.2,"dds":0.03875968992248058,"last_synced_commit":"2547581b6eaad7d9d3dfbbfee9194a56c7868d51"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMeli%2Fspyrmsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMeli%2Fspyrmsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMeli%2Fspyrmsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMeli%2Fspyrmsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RMeli","download_url":"https://codeload.github.com/RMeli/spyrmsd/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149500,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cadd","computational-biology","computational-chemistry","computer-aided-drug-design","docking","drug-discovery","molecular-docking","rmsd","symmetry"],"created_at":"2024-10-15T11:58:45.305Z","updated_at":"2025-04-04T09:06:29.434Z","avatar_url":"https://github.com/RMeli.png","language":"Python","readme":"# sPyRMSD\n\n[![pytest](https://github.com/RMeli/spyrmsd/actions/workflows/pytest.yml/badge.svg?branch=develop)](https://github.com/RMeli/spyrmsd/actions/workflows/pytest.yml)\n![flake8](https://github.com/RMeli/spyrmsd/workflows/flake8/badge.svg)\n![mypy](https://github.com/RMeli/spyrmsd/workflows/mypy/badge.svg)\n[![codecov](https://codecov.io/gh/RMeli/spyrmsd/branch/develop/graph/badge.svg)](https://codecov.io/gh/RMeli/spyrmsd/branch/master)\n\n[![Docs](https://img.shields.io/badge/docs-spyrmsd.readthedocs.io-blueviolet)](https://spyrmsd.readthedocs.io)\n[![Documentation Status](https://readthedocs.org/projects/spyrmsd/badge/?version=develop)](https://spyrmsd.readthedocs.io/en/develop/?badge=develop)\n\n[![License](https://img.shields.io/github/license/RMeli/pyrmsd?color=%2333BBFF)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/badge/PyPI-v0.8.0%20-ff69b4)](https://pypi.org/project/spyrmsd/)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/spyrmsd.svg)](https://anaconda.org/conda-forge/spyrmsd)\n\n[![J. Cheminform.](https://img.shields.io/badge/J.%20Cheminform.-10.1186%2Fs13321--020--00455--2-blue)](https://doi.org/10.1186/s13321-020-00455-2)\n[![Zenodo](https://zenodo.org/badge/214157073.svg)](https://zenodo.org/badge/latestdoi/214157073)\n\nPython tool for symmetry-corrected RMSD calculations.\n\n---\n\nIf you find `spyrmsd` useful, please consider citing the following paper:\n\n```text\n@article{spyrmsd2020,\n  Author = {Meli, Rocco and Biggin, Philip C.},\n  Journal = {Journal of Cheminformatics},\n  Number = {1},\n  Pages = {49},\n  Title = {spyrmsd: symmetry-corrected RMSD calculations in Python},\n  Volume = {12},\n  Year = {2020}\n}\n```\n\n## Installation\n\n`spyrmsd` is available on [PyPI](https://pypi.org/project/spyrmsd/) and [conda-forge](https://github.com/conda-forge/spyrmsd-feedstock) and can be easily installed from source. See [Dependencies](###Dependencies) for a description of all the dependencies.\n\n\u003e [!NOTE]\n\u003e `spyrmsd` will install [rustworkx] (multi-platform) when using `pip` or `conda`. You can install other backends manually.\n\n\u003e [!WARNING]\n\u003e If `spyrmsd` is used as a standalone tool, it is required to install either [RDKit](https://rdkit.org/) or [Open Babel](http://openbabel.org/). Neither is automatically installed with `pip` nor `conda`.\n\n### PyPI\n\n```bash\npip install spyrmsd\n```\n\n### conda\n\n```bash\nconda install spyrmsd -c conda-forge\n```\n\n### GitHub\n\n```bash\ngit clone https://github.com/RMeli/spyrmsd.git\ncd spyrmsd\npip install .\n```\n\n### Dependencies\n\n`spyrmsd` can be used both as a module or as a standalone tool.\n\n#### Module\n\nThe following packages are required to use `spyrmsd` as a module:\n\n* [numpy](https://numpy.org/)\n* [scipy](https://www.scipy.org/)\n\nOne of the following graph libraries is required:\n* [graph-tool]\n* [rustworkx]\n* [NetworkX]\n\n\u003e [!NOTE]\n\u003e `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.*\n\n#### Standalone Tool\n\nAdditionally, one of the following packages is required to use `spyrmsd` as a standalone tool:\n\n* [Open Babel](http://openbabel.org/)\n* [RDKit](https://rdkit.org/)\n\n## Usage\n\n### Standalone Tool\n\n`spyrmsd` provides a convenient CLI tool. See `spyrmsd`'s `--help` for the usage:\n\n```bash\npython -m spyrmsd -h\n```\n\n### Module\n\n```python\nfrom spyrmsd import rmsd\n```\n\n#### RMSD\n\nThe 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).\n\n```python\ndef rmsd(\n    coords1: np.ndarray,    # Coordinates of molecule 1\n    coords2: np.ndarray,    # Coordinates of molecule 2\n    aprops1: np.ndarray,    # Atomic properties of molecule 1\n    aprops2: np.ndarray,    # Atomic properties of molecule 2\n    center: bool = False,   # Flag to center molecules at origin\n    minimize: bool = False, # Flag to compute minimum RMSD\n    atol: float = 1e-9,     # Numerical tolerance for QCP method\n)\n```\n\n\u003e [!NOTE]\n\u003e Atomic properties (`aprops`) can be any Python object when using [NetworkX] and [rustworkx], or integers, floats, or strings when using [graph-tool].\n\n#### Symmetry-Corrected RMSD\n\nThe 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.\n\nAtom 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).\n\n```python\ndef symmrmsd(\n    coordsref: np.ndarray,                       # Reference coordinated\n    coords: Union[np.ndarray, List[np.ndarray]], # Coordinates (one set or multiple sets)\n    apropsref: np.ndarray,                       # Reference atomic properties\n    aprops: np.ndarray,                          # Atomic properties\n    amref: np.ndarray,                           # Reference adjacency matrix\n    am: np.ndarray,                              # Adjacency matrix\n    center: bool = False,                        # Flag to center molecules at origin\n    minimize: bool = False,                      # Flag to compute minimum RMSD\n    cache: bool = True,                          # Cache graph isomorphisms\n    atol: float = 1e-9,                          # Numerical tolerance for QCP method\n)\n```\n\n\u003e [!NOTE]\n\u003e Atomic properties (`aprops`) can be any Python object when using [NetworkX] and [rustworkx], or integers, floats, or strings when using [graph-tool](https://graph-tool.skewed.de/).\n\n#### Select Backend\n\n`spyrmsd` supports the following graph libraries for the calculation of graph isomorphisms:\n* [graph-tool]\n* [NetworkX]\n* [rustworkx]\n\n You can check which backend is being used with\n\n```python\nspyrmsd.get_backend()\n```\n\nYou can also manually select your preferred backend with\n\n```python\nspyrmsd.set_backend(\"networkx\")\n# spyrmsd uses NetworkX\nspyrmsd.set_backend(\"graph_tool\")\n# spyrmsd uses graph_tool\n```\n\nThe available backends (which depend on the installed dependencies) are stored in `spyrmsd.available_backends`.\n\n## Development\n\nTo ensure code quality and consistency the following tools are used during development:\n\n* [black](https://black.readthedocs.io/en/stable/)\n* [Flake 8](http://flake8.pycqa.org/en/latest/) (CI)\n* [isort](https://pycqa.github.io/isort/)\n* [mypy](http://mypy-lang.org/) (CI)\n\nPre-commit `git` hooks can be installed with [pre-commit].\n\n## Copyright\n\nCopyright (c) 2019-2024, Rocco Meli.\n\n## References\n\nReferences are tracked with [duecredit](https://github.com/duecredit/duecredit/). Run the `credits.sh` script in order to print up-to-date references.\n\n### Acknowledgements\n\nProject based on the [Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version `1.1`.\n\n[rustworkx]: https://www.rustworkx.org\n[NetworkX]: https://networkx.github.io/\n[graph-tool]: https://graph-tool.skewed.de/\n[pre-commit]: https://pre-commit.com/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmeli%2Fspyrmsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmeli%2Fspyrmsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmeli%2Fspyrmsd/lists"}