disvis 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. disvis-3.0.0/CHANGELOG.md +80 -0
  2. disvis-3.0.0/INSTALLATION.md +61 -0
  3. disvis-3.0.0/LICENSE +201 -0
  4. disvis-3.0.0/MANIFEST.in +6 -0
  5. disvis-3.0.0/PKG-INFO +309 -0
  6. disvis-3.0.0/README.md +279 -0
  7. disvis-3.0.0/pyproject.toml +102 -0
  8. disvis-3.0.0/setup.cfg +4 -0
  9. disvis-3.0.0/setup.py +33 -0
  10. disvis-3.0.0/src/disvis/IO/__init__.py +1 -0
  11. disvis-3.0.0/src/disvis/IO/mmcif.py +72 -0
  12. disvis-3.0.0/src/disvis/IO/mrc.py +374 -0
  13. disvis-3.0.0/src/disvis/IO/pdb.py +80 -0
  14. disvis-3.0.0/src/disvis/__init__.py +11 -0
  15. disvis-3.0.0/src/disvis/_extensions.c +220 -0
  16. disvis-3.0.0/src/disvis/data/E.npy +0 -0
  17. disvis-3.0.0/src/disvis/data/c48n309.npy +0 -0
  18. disvis-3.0.0/src/disvis/data/c48n527.npy +0 -0
  19. disvis-3.0.0/src/disvis/data/c48n9.npy +0 -0
  20. disvis-3.0.0/src/disvis/data/c48u1.npy +0 -0
  21. disvis-3.0.0/src/disvis/data/c48u1153.npy +0 -0
  22. disvis-3.0.0/src/disvis/data/c48u1201.npy +0 -0
  23. disvis-3.0.0/src/disvis/data/c48u1641.npy +0 -0
  24. disvis-3.0.0/src/disvis/data/c48u181.npy +0 -0
  25. disvis-3.0.0/src/disvis/data/c48u2219.npy +0 -0
  26. disvis-3.0.0/src/disvis/data/c48u27.npy +0 -0
  27. disvis-3.0.0/src/disvis/data/c48u2947.npy +0 -0
  28. disvis-3.0.0/src/disvis/data/c48u3733.npy +0 -0
  29. disvis-3.0.0/src/disvis/data/c48u4749.npy +0 -0
  30. disvis-3.0.0/src/disvis/data/c48u5879.npy +0 -0
  31. disvis-3.0.0/src/disvis/data/c48u7111.npy +0 -0
  32. disvis-3.0.0/src/disvis/data/c48u815.npy +0 -0
  33. disvis-3.0.0/src/disvis/data/c48u83.npy +0 -0
  34. disvis-3.0.0/src/disvis/data/c48u8649.npy +0 -0
  35. disvis-3.0.0/src/disvis/data/c600v.npy +0 -0
  36. disvis-3.0.0/src/disvis/data/c600vc.npy +0 -0
  37. disvis-3.0.0/src/disvis/disvis.py +923 -0
  38. disvis-3.0.0/src/disvis/elements.py +2672 -0
  39. disvis-3.0.0/src/disvis/gpufft.py +41 -0
  40. disvis-3.0.0/src/disvis/helpers.py +157 -0
  41. disvis-3.0.0/src/disvis/kernels.cl +315 -0
  42. disvis-3.0.0/src/disvis/kernels.py +250 -0
  43. disvis-3.0.0/src/disvis/libdisvis.pyx +284 -0
  44. disvis-3.0.0/src/disvis/main.py +806 -0
  45. disvis-3.0.0/src/disvis/pdb.py +166 -0
  46. disvis-3.0.0/src/disvis/rotations.py +159 -0
  47. disvis-3.0.0/src/disvis/volume.py +138 -0
  48. disvis-3.0.0/src/disvis.egg-info/PKG-INFO +309 -0
  49. disvis-3.0.0/src/disvis.egg-info/SOURCES.txt +61 -0
  50. disvis-3.0.0/src/disvis.egg-info/dependency_links.txt +1 -0
  51. disvis-3.0.0/src/disvis.egg-info/entry_points.txt +2 -0
  52. disvis-3.0.0/src/disvis.egg-info/requires.txt +13 -0
  53. disvis-3.0.0/src/disvis.egg-info/top_level.txt +1 -0
  54. disvis-3.0.0/tests/__init__.py +27 -0
  55. disvis-3.0.0/tests/data/O14250.pdb +2002 -0
  56. disvis-3.0.0/tests/data/Q9UT97.pdb +2107 -0
  57. disvis-3.0.0/tests/data/restraints.dat +11 -0
  58. disvis-3.0.0/tests/data/selection.res +2 -0
  59. disvis-3.0.0/tests/data/single-atom.pdb +1 -0
  60. disvis-3.0.0/tests/test_cpu_vs_gpu.py +288 -0
  61. disvis-3.0.0/tests/test_disvis.py +186 -0
  62. disvis-3.0.0/tests/test_kernels.py +245 -0
  63. disvis-3.0.0/tests/test_volume.py +111 -0
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ ## 3.0.0
4
+
5
+ Changes compared with 2.3.0, the last Python 2 release.
6
+
7
+ ### Requirements and installation
8
+
9
+ - Python 3.11 or newer and NumPy 2; Python 2 is no longer supported.
10
+ - pyFFTW is now a requirement, installed automatically; it is about twice as
11
+ fast as the NumPy FFT.
12
+ - Cython 3 is needed to build; the generated `src/libdisvis.c` was removed.
13
+ - The package metadata, dependencies and build requirements are in
14
+ `pyproject.toml`; `setup.py` only defines the compiled extensions. New `dev`
15
+ extra (`pip install '.[dev]'`: ruff and cython-lint).
16
+ - src layout: the package is in `src/disvis/` (with the extension sources), the
17
+ unit tests in `tests/`; run them from the repository root with
18
+ `python -m unittest`. The sdist includes the tests.
19
+ - GPU FFTs with VkFFT through pyvkfft, instead of clFFT and gpyfft, which had
20
+ to be built by hand. New `gpu` extra (`pip install '.[gpu]'`: pyopencl,
21
+ Mako and pyvkfft). The coarse test cases give byte-identical output with
22
+ VkFFT and clFFT.
23
+ - Docker image based on Python 3.12.
24
+ - The source distribution (sdist) includes the extension sources, so it can
25
+ be built and installed.
26
+ - Published on PyPI (`pip install disvis`), with wheels for Linux (x86_64,
27
+ aarch64), macOS (arm64) and Windows (x86_64), Python 3.11 to 3.14, and a
28
+ WebAssembly wheel for Pyodide (Python 3.14, NumPy FFT instead of pyfftw).
29
+
30
+ ### Fixes and changes
31
+
32
+ - New `--version` option, and `disvis.__version__`.
33
+ - A zero or negative voxel spacing (`-vs`) is rejected; DisVis used to hang.
34
+ - `-p` works with the spawn start method (macOS and Windows).
35
+ - With `-p`, one progress line for all processes, updated in place.
36
+ - `disvis.log` is overwritten instead of appended to, and is also written
37
+ with `-g`.
38
+ - `args.json` (the command-line options) is written to the output directory.
39
+ - Clear error message when `-g` is used without the GPU packages.
40
+ - `-g` uses another OpenCL device (e.g. pocl on the CPU) when there is no
41
+ OpenCL GPU, and writes the device to `disvis.log`.
42
+ - `-np`/`--no-progress` turns off the progress line.
43
+ - GPU: OpenCL kernels are built once, the search no longer waits for the GPU
44
+ after every step, and fused kernels launch fewer per rotation: together
45
+ 1.3–2.6× faster on the fine grid, with the same output.
46
+ - GPU interaction analysis (`-g -is`): the interaction cutoff was 10 grid
47
+ units instead of 10 Å, so with a voxel spacing other than 1 Å the counts
48
+ were wrong (at 2 Å, 6–87× too high, median 13×, for PRE5-PUP2). It now
49
+ agrees with the CPU.
50
+ - MRC files are closed after reading; `MRCFile` closes a file it opened by
51
+ name (`close()` or a `with` block), also when its header cannot be read.
52
+ - `volume.erode` writes the erosion into the given `out` volume.
53
+ - `scripts/analyze.py` and `scripts/analyze_interactions.py` were rewritten
54
+ for the current code and output format.
55
+ - New `scripts/interactions_to_bfactor.py` writes the average number of
56
+ interactions of each residue into the B-factor column of a PDB file, for
57
+ coloring the most contacted residues (#12).
58
+
59
+ ### Results
60
+
61
+ - The CPU output is byte-identical across Python 3.11–3.14, NumPy FFT or
62
+ pyFFTW, and macOS or Linux; the GPU output agrees with it to about 1e-5.
63
+
64
+ ### Documentation and tests
65
+
66
+ - Updated `README.md` and `INSTALLATION.md` (GPU set-up on macOS and Linux).
67
+ - `CITATION.cff`, and the Zenodo DOI of all versions (10.5281/zenodo.7775093)
68
+ in `README.md`.
69
+ - New CPU and GPU reference results for the test cases, and
70
+ `test-cases/README.md` with benchmarks.
71
+ - Fixed the outdated GPU unit tests; they are skipped without pyopencl,
72
+ pyvkfft or an OpenCL GPU.
73
+ - Code formatted and linted with ruff (configuration in `pyproject.toml`),
74
+ with docstrings throughout.
75
+ - GitHub workflow running the linters, the unit tests (Linux, macOS and
76
+ Windows, Python 3.11–3.14), the coarse test cases against the CPU
77
+ references (`test-cases/check_test_cases.py`), and the GPU unit tests on the CPU
78
+ with pocl. Ruff also limits the complexity of functions (C901).
79
+ - Issue and pull-request templates, and `CONTRIBUTING.md` for developers.
80
+ - AI declaration (`aidecl.yaml`, see https://ai-declaration.org/).
@@ -0,0 +1,61 @@
1
+ # Installation instructions for GPU-accelerated DisVis
2
+
3
+ This document shows how to set up GPU-accelerated DisVis using the OpenCL
4
+ framework, with [pyopencl](https://github.com/inducer/pyopencl) and the VkFFT
5
+ library through [pyvkfft](https://github.com/vincefn/pyvkfft) for the Fourier
6
+ transforms. These instructions were tested with Python 3.14 on macOS 15 (Apple
7
+ M2 Pro GPU) and on Rocky Linux 9 (NVIDIA GeForce GTX 1080 Ti and RTX 6000 Ada
8
+ GPUs, NVIDIA driver 555). Note that the speed-up depends on the GPU: a
9
+ power-efficient integrated card may not be much faster than the multi-processor
10
+ CPU version (`-p`).
11
+
12
+ ## Requirements
13
+
14
+ * An OpenCL 1.2+ enabled GPU and its OpenCL driver (included in macOS; on Linux
15
+ with NVIDIA GPUs, part of the NVIDIA driver).
16
+ * A C++ compiler (on macOS, the Xcode command line tools), as pyvkfft is built
17
+ from source.
18
+ * On Linux, the OpenCL headers (`CL/cl.h`) and loader (`libOpenCL.so`), e.g.
19
+ the `opencl-headers` and `ocl-icd-opencl-dev` (Debian/Ubuntu) or
20
+ `opencl-headers` and `ocl-icd-devel` (Rocky/RHEL) packages.
21
+ * DisVis installed in a virtual environment, as described in README.md.
22
+
23
+ On a cluster, the OpenCL headers and libraries may only be installed on the
24
+ GPU nodes: install the GPU requirements there.
25
+
26
+ ## Installation
27
+
28
+ With the virtual environment activated, install the optional GPU requirements
29
+ of DisVis (the `gpu` extra in `pyproject.toml`)
30
+
31
+ ```bash
32
+ pip install 'disvis[gpu]'
33
+ ```
34
+
35
+ (or `pip install '.[gpu]'` from the DisVis directory, for a source install)
36
+
37
+ and check that your GPU is found
38
+
39
+ ```bash
40
+ python -c "import pyopencl as cl; print([d.name for p in cl.get_platforms() for d in p.get_devices()])"
41
+ ```
42
+
43
+ ## Test
44
+
45
+ From the DisVis directory, run the GPU tests
46
+
47
+ ```bash
48
+ python -m unittest tests/test_kernels.py tests/test_cpu_vs_gpu.py
49
+ ```
50
+
51
+ and run DisVis with the `-g` option, e.g. on the PRE5-PUP2 test case
52
+
53
+ ```bash
54
+ cd test-cases/PRE5-PUP2-complex
55
+ disvis O14250.pdb Q9UT97.pdb restraints.dat -a 9.72 -vs 2 -g -d gpu-results
56
+ ```
57
+
58
+ The results should agree with the GPU results in `example-results/gpu/coarse`
59
+ and the CPU results in `example-results/cpu/coarse` to within single-precision
60
+ rounding (relative differences of about 1e-5). Timings on several GPUs are
61
+ listed in `test-cases/README.md`.
disvis-3.0.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2017 Gydo Cornelis Petrus van Zundert
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,6 @@
1
+ # Sources of the compiled extensions, needed to build from the sdist
2
+ include src/disvis/libdisvis.pyx
3
+ include src/disvis/_extensions.c
4
+ include CHANGELOG.md INSTALLATION.md
5
+ # The unit tests, with their data
6
+ recursive-include tests *.py *.pdb *.dat *.res
disvis-3.0.0/PKG-INFO ADDED
@@ -0,0 +1,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: disvis
3
+ Version: 3.0.0
4
+ Summary: Quantifying and visualizing the interaction space of distance-constrained macromolecular complexes
5
+ Author-email: "Gydo C.P. van Zundert" <gvanzundert51@gmail.com>
6
+ Maintainer-email: BonvinLab <bonvinlab.support@uu.nl>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: homepage, https://github.com/haddocking/disvis
9
+ Project-URL: source, https://github.com/haddocking/disvis
10
+ Project-URL: issues, https://github.com/haddocking/disvis/issues
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: numpy
21
+ Requires-Dist: pyfftw; platform_machine != "wasm32"
22
+ Provides-Extra: gpu
23
+ Requires-Dist: pyopencl; extra == "gpu"
24
+ Requires-Dist: mako; extra == "gpu"
25
+ Requires-Dist: pyvkfft; extra == "gpu"
26
+ Provides-Extra: dev
27
+ Requires-Dist: ruff; extra == "dev"
28
+ Requires-Dist: cython-lint; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # DisVis
32
+
33
+ [![PyPI - Version](https://img.shields.io/pypi/v/disvis)](https://pypi.org/project/disvis/)
34
+ [![DOI](https://zenodo.org/badge/30263463.svg)](https://doi.org/10.5281/zenodo.7775093)
35
+ [![ci](https://github.com/haddocking/disvis/actions/workflows/ci.yml/badge.svg)](https://github.com/haddocking/disvis/actions/workflows/ci.yml)
36
+ [![SBGrid Badge](https://img.shields.io/badge/DisVis-blue?label=SBGrid&labelColor=%3D)](https://sbgrid.org/software/titles/disvis)
37
+ [![bio.tools](https://img.shields.io/badge/bio.tools-disvis-orange)](https://bio.tools/disvis)
38
+ [![AI Declaration](https://img.shields.io/badge/AI_Declaration-aidecl.yaml-blue)](aidecl.yaml)
39
+
40
+ ## About DisVis
41
+
42
+ **DisVis** is a Python package and command line tool to visualize and quantify
43
+ the accessible interaction space of distance restrained binary biomolecular complexes.
44
+ It performs a full and systematic 6 dimensional search of the three translational
45
+ and rotational degrees of freedom to determine the number of complexes consistent
46
+ with the restraints. In addition, it outputs the percentage of restraints being violated
47
+ and a density that represents the center-of-mass position of the scanning chain corresponding
48
+ to the highest number of consistent restraints at every position in space.
49
+
50
+
51
+ ## Requirements
52
+
53
+ * Python 3.11+
54
+ * A C compiler (to build the extension modules)
55
+
56
+ The Python packages DisVis needs are listed in `pyproject.toml` and installed
57
+ automatically by *pip*. GPU acceleration also needs an OpenCL 1.2+ enabled GPU
58
+ and the optional `gpu` packages (see INSTALLATION.md).
59
+
60
+
61
+ ## Installation
62
+
63
+ **DisVis** is best installed in a virtual environment. Open a terminal and type
64
+
65
+ ```bash
66
+ python3 -m venv .venv
67
+ source .venv/bin/activate
68
+ pip install disvis
69
+ ```
70
+
71
+ After installation, the command line tool *disvis* should be at your disposal.
72
+ To install from the source instead, clone the repository and run `pip install .`
73
+ in it.
74
+
75
+ For GPU acceleration, install the optional GPU requirements with
76
+
77
+ ```bash
78
+ pip install 'disvis[gpu]'
79
+ ```
80
+
81
+ See INSTALLATION.md for the requirements and for checking the GPU set-up.
82
+
83
+
84
+ ### Linux
85
+
86
+ Make sure git, the Python header files and a C compiler are available, e.g. on
87
+ Debian/Ubuntu
88
+
89
+ ```bash
90
+ sudo apt-get install git python3-dev python3-venv build-essential
91
+ ```
92
+
93
+ If you are working on a Fedora system, use *dnf* and the *python3-devel* and *gcc* packages.
94
+ Follow the general instructions above to install **DisVis**.
95
+
96
+
97
+ ### MacOSX
98
+
99
+ Install the Xcode command line tools, which provide git and a C compiler
100
+
101
+ ```bash
102
+ xcode-select --install
103
+ ```
104
+
105
+ and a recent Python 3, e.g. with [*brew*](https://brew.sh)
106
+
107
+ ```bash
108
+ brew install python
109
+ ```
110
+
111
+ Follow the general instructions above to install **DisVis**.
112
+
113
+
114
+ ### Windows
115
+
116
+ Install [*git*](https://git-scm.com/download) for Windows, a Python 3
117
+ distribution, such as [Anaconda](https://www.anaconda.com/download), and the
118
+ [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
119
+ Follow the general instructions above to install **DisVis**.
120
+
121
+
122
+ ## Usage
123
+
124
+ The general pattern to invoke *disvis* is
125
+
126
+ ```bash
127
+ disvis <pdb1> <pdb2> <distance-restraints-file>
128
+ ```
129
+
130
+ where `<pdb1>` is the fixed chain, `<pdb2>` is the scanning chain and
131
+ `<distance-restraints-file>` is a text-file
132
+ containing the distance restraints in the following format
133
+
134
+ ```text
135
+ <chainid 1> <resid 1> <atomname 1> <chainid 2> <resid 2> <atomname 2> <mindis> <maxdis>
136
+ ```
137
+
138
+ As an example
139
+
140
+ ```text
141
+ A 18 CA F 27 CB 10.0 20.0
142
+ ```
143
+
144
+ This puts a distance restraint between the CA-atom of residue 18 of
145
+ chain A of pdb1 and the CB-atom of residue 27 of chain F of pdb2 that
146
+ should be longer than or equal to 10A and smaller than or equal to 20A.
147
+ Comments can be added by starting the line with the pound sign (#) and empty
148
+ lines are ignored.
149
+
150
+
151
+ ### Options
152
+
153
+ To get a help screen with available options and explanation type
154
+
155
+ ```bash
156
+ disvis --help
157
+ ```
158
+
159
+ Some examples to get you started. To perform a 5.27 degree rotational search and store the results
160
+ in the directory *results/*
161
+
162
+ ```bash
163
+ disvis 1wcm_A.pdb 1wcm_E.pdb restraints.dat -a 5.27 -d results
164
+ ```
165
+
166
+ Note that the directory is created if it doesn't exist.
167
+
168
+ To perform a 9.72 degree rotational search with 16 processors and a voxel spacing of 2A
169
+
170
+ ```bash
171
+ disvis O14250.pdb Q9UT97.pdb restraints.dat -a 9.72 -p 16 -vs 2
172
+ ```
173
+
174
+ To offload computations to the GPU (if the requirements are met) and increase
175
+ the maximum allowed volume of clashes as well as the minimum required volume of
176
+ interaction, and set the interaction radius to 2A
177
+
178
+ ```bash
179
+ disvis 1wcm_A.pdb 1wcm_E.pdb restraints.dat -g -cv 6000 -iv 7000 -ir 2
180
+ ```
181
+
182
+ To perform a grid occupancy analysis for complexes consistent with at least N
183
+ restraints, include the `-oa` or `--occupancy-analysis` flag to the command. By
184
+ default, the analysis is only performed on complexes consistent with
185
+ either *all* and *all - 1* restraints. If you want to perform an occupancy
186
+ analysis for complexes consistent with a lower number of restraints, use the
187
+ `-ic` or `--interaction-restraints-cutoff` option, followed by the minimum
188
+ number of required consistent restraints. Thus the command
189
+
190
+ ```bash
191
+ disvis 1wcm_A.pdb 1wcm_E.pdb restraints.dat -oa -ic 5
192
+ ```
193
+
194
+ will make an occupancy grid for complexes consistent with at least 5
195
+ restraints, and higher.
196
+
197
+ Finally, to perform an interaction analysis to determine which residues
198
+ are most likely at the interface, the `-is` or `--interaction-selection`
199
+ options can be used with an additional file giving the residue numbers of the
200
+ receptor and ligand for which the interaction analysis will be performed. The
201
+ input file consists of two lines, where the two lines are a space separated
202
+ sequence of residue numbers for the receptor and ligand, respectively. As the
203
+ interaction analysis is particularly expensive, only complexes consistent with
204
+ *all*, or *all - 1* are considered. To lower the barrier, the `-ic` option can
205
+ again be used. Also limit the selected residues to only the solvent accessible
206
+ ones. A simple example for the selection-file
207
+
208
+ ```text
209
+ 1 2 3 4
210
+ 101 302 888
211
+ ```
212
+
213
+ This will select residue numbers 1, 2, 3, and 4 for the receptor, and 101, 302,
214
+ and 888 for the ligand.
215
+
216
+
217
+ ### Output
218
+
219
+ Standard *disvis* outputs 5 files:
220
+
221
+ * *accessible_complexes.out*: a text file containing the number of complexes
222
+ consistent with a number of restraints.
223
+ * *violations.out*: a text file showing how often a specific restraint is
224
+ violated for each number of consistent restraints. This helps in identifying
225
+ which restraint is most likely a false-positive if any.
226
+ * *accessible_interaction_space.mrc*: a density file in MRC format. The density
227
+ represents the center of mass of the scanning chain conforming to the maximum
228
+ found consistent restraints at every position in space. The density can be
229
+ inspected by opening it together with the fixed chain in a molecular viewer
230
+ (UCSF Chimera is recommended for its easier manipulation of density
231
+ data, but also PyMol works).
232
+ * *z-score.out*: a text file giving the Z-score for each restraint. The higher
233
+ the score, the more likely the restraint is a false-positive. Z-scores above
234
+ 1.0 are explicitly mentioned in the output.
235
+ * *disvis.log*: a log file showing all the parameters used, together with date
236
+ and time indications.
237
+
238
+ If an occupancy and/or interaction analysis was requested, *disvis* also
239
+ outputs the following files:
240
+
241
+ * *occupancy_N.mrc*: a volume file giving a normalized indication of how
242
+ frequent a grid point is occupied by the ligand, where *N* indicates the minimal
243
+ required number of consistent restraints that resulted in the occupancy grid.
244
+ * *[receptor|ligand]_interactions.txt*: a text file containing the average
245
+ number of interactions per complex each selected residue made, for both the
246
+ receptor and ligand molecule. Each column denotes the minimal number of
247
+ consistent restraints of each complex for which interactions were counted.
248
+
249
+ To visualize the most contacted residues, write the average number of
250
+ interactions into the B-factor column of the receptor or ligand PDB file
251
+
252
+ ```bash
253
+ python scripts/interactions_to_bfactor.py receptor.pdb receptor_interactions.txt N
254
+ ```
255
+
256
+ where *N* is one of the column numbers of the interaction file. This writes
257
+ *receptor_interactions.pdb*, which can be colored on B-factor, e.g. with
258
+ `spectrum b, blue_red` in PyMOL or `color bfactor` in ChimeraX.
259
+
260
+
261
+ Licensing
262
+ ---------
263
+
264
+ If this software was useful to your research please cite us
265
+
266
+ **Van Zundert, G.C.P. and Bonvin, A.M.J.J.** (2015) DisVis: Visualizing and
267
+ quantifying accessible interaction space of distance restrained biomolecular complexes.
268
+ *Bioinformatics 31*, 3222-3224.
269
+
270
+ The software itself can be cited with its Zenodo DOI,
271
+ [10.5281/zenodo.7775093](https://doi.org/10.5281/zenodo.7775093), and
272
+ [`CITATION.cff`](https://github.com/haddocking/disvis/blob/main/CITATION.cff)
273
+ gives both references.
274
+
275
+ Apache License Version 2.0
276
+
277
+ The elements.py module is licenced under the MIT License, Copyright Christoph
278
+ Gohlke.
279
+
280
+
281
+ ## Tested platforms
282
+
283
+ | Operating System| CPU single | CPU multi | GPU |
284
+ | --------------- | ---------- | --------- | --- |
285
+ |Linux | Yes | Yes | Yes |
286
+ |MacOSX | Yes | Yes | Yes |
287
+ |Windows | Yes | Yes | No |
288
+
289
+ The GPU version has been tested on:
290
+ NVIDIA GeForce GTX 1080 Ti and RTX 6000 Ada for Linux, and Apple M2 Pro for
291
+ macOS (and, with the earlier Python 2 version, NVIDIA GeForce GTX 680 and AMD
292
+ Radeon HD 7730M for Linux)
293
+
294
+ Reference results and timings for the test cases, on CPUs and GPUs, are in
295
+ `test-cases/README.md`.
296
+
297
+
298
+ ## Contributing
299
+
300
+ See `CONTRIBUTING.md` for the development setup, code style, tests and pull
301
+ requests.
302
+
303
+
304
+ ## AI Declaration
305
+
306
+ Large language models (LLM) were used in this repository since
307
+ [v3.0.0](CHANGELOG.md), for the port to Python 3 and the later changes. The
308
+ changes were always reviewed by a human before being merged. See
309
+ [aidecl.yaml](aidecl.yaml) for machine-readable details of the LLM usage.