hbat 2.2.8.dev26__tar.gz → 2.2.9.dev27__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 (158) hide show
  1. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/.github/workflows/test.yml +5 -0
  2. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/PKG-INFO +30 -9
  3. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/README.md +25 -0
  4. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/ccd/constants_generator.rst +6 -21
  5. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/cli/index.rst +1 -6
  6. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/constants/atomic_data.rst +0 -11
  7. hbat-2.2.9.dev27/docs/source/api/constants/misc.rst +12 -0
  8. hbat-2.2.9.dev27/docs/source/api/constants/parameters.rst +12 -0
  9. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/core/pdb_fixer.rst +20 -129
  10. hbat-2.2.9.dev27/docs/source/api/core/pdb_parser.rst +204 -0
  11. hbat-2.2.9.dev27/docs/source/api/gui/index.rst +81 -0
  12. hbat-2.2.9.dev27/docs/source/api/utilities/graphviz_utils.rst +144 -0
  13. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/utilities/index.rst +32 -1
  14. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/conf.py +2 -16
  15. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/installation.rst +27 -0
  16. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/_version.py +2 -2
  17. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/app_config.py +123 -0
  18. hbat-2.2.9.dev27/hbat/gui/chain_visualization.py +392 -0
  19. hbat-2.2.9.dev27/hbat/gui/export_manager.py +405 -0
  20. hbat-2.2.9.dev27/hbat/gui/graphviz_preferences_dialog.py +429 -0
  21. hbat-2.2.9.dev27/hbat/gui/graphviz_renderer.py +618 -0
  22. hbat-2.2.9.dev27/hbat/gui/matplotlib_renderer.py +408 -0
  23. hbat-2.2.9.dev27/hbat/gui/visualization_renderer.py +398 -0
  24. hbat-2.2.9.dev27/hbat/utilities/graphviz_utils.py +275 -0
  25. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat.egg-info/SOURCES.txt +11 -1
  26. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/pyproject.toml +5 -10
  27. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/requirements.txt +4 -6
  28. hbat-2.2.9.dev27/tests/e2e/test_graphviz_workflows.py +470 -0
  29. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/e2e/test_gui_workflows.py +12 -4
  30. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/gui/test_gui_components.py +13 -4
  31. hbat-2.2.9.dev27/tests/integration/test_graphviz_renderer.py +414 -0
  32. hbat-2.2.9.dev27/tests/unit/test_graphviz_utils.py +365 -0
  33. hbat-2.2.9.dev27/tests/unit/test_scrollable_canvas.py +288 -0
  34. hbat-2.2.8.dev26/CLAUDE.md +0 -41
  35. hbat-2.2.8.dev26/docs/source/api/constants/misc.rst +0 -39
  36. hbat-2.2.8.dev26/docs/source/api/constants/parameters.rst +0 -63
  37. hbat-2.2.8.dev26/docs/source/api/core/pdb_parser.rst +0 -338
  38. hbat-2.2.8.dev26/docs/source/api/gui/index.rst +0 -36
  39. hbat-2.2.8.dev26/hbat/gui/chain_visualization.py +0 -363
  40. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/.github/workflows/cleanup-prereleases.yml +0 -0
  41. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/.github/workflows/release.yml +0 -0
  42. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/CITATION.cff +0 -0
  43. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/CODE_OF_CONDUCT.md +0 -0
  44. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/CONTRIBUTING.md +0 -0
  45. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/LICENSE +0 -0
  46. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/MANIFEST.in +0 -0
  47. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/Makefile +0 -0
  48. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/build_standalone.py +0 -0
  49. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/build_standalone_linux.py +0 -0
  50. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/build_standalone_windows.py +0 -0
  51. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/conda/meta.yaml +0 -0
  52. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/Makefile +0 -0
  53. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/requirements.txt +0 -0
  54. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/_static/custom.css +0 -0
  55. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/_static/light-theme.css +0 -0
  56. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/ccd/ccd_analyzer.rst +0 -0
  57. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/ccd/generate_ccd_constants.rst +0 -0
  58. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/ccd/index.rst +0 -0
  59. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/constants/app.rst +0 -0
  60. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/constants/index.rst +0 -0
  61. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/constants/pdb_constants.rst +0 -0
  62. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/core/index.rst +0 -0
  63. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/core/interactions.rst +0 -0
  64. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/core/np_analyzer.rst +0 -0
  65. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/core/np_vector.rst +0 -0
  66. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/core/structure.rst +0 -0
  67. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/examples/index.rst +0 -0
  68. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/index.rst +0 -0
  69. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/api/utilities/atom_utils.rst +0 -0
  70. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/cli.rst +0 -0
  71. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/development.rst +0 -0
  72. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/index.rst +0 -0
  73. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/license.rst +0 -0
  74. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/logic.rst +0 -0
  75. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/parameters.rst +0 -0
  76. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/pdbfixing.rst +0 -0
  77. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/docs/source/quickstart.rst +0 -0
  78. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/1bhl.pdb +0 -0
  79. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/1gai.pdb +0 -0
  80. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/1ubi.pdb +0 -0
  81. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/2izf.pdb +0 -0
  82. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/4jsv.pdb +0 -0
  83. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/4laz.pdb +0 -0
  84. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/4ub7.pdb +0 -0
  85. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/4x21.pdb +0 -0
  86. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_pdb_files/6rsa.pdb +0 -0
  87. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/drug_design_strict.hbat +0 -0
  88. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/high_resolution.hbat +0 -0
  89. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/low_resolution.hbat +0 -0
  90. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/membrane_proteins.hbat +0 -0
  91. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/nmr_structures.hbat +0 -0
  92. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/standard_resolution.hbat +0 -0
  93. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/strong_interactions_only.hbat +0 -0
  94. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/example_presets/weak_interactions_permissive.hbat +0 -0
  95. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/__init__.py +0 -0
  96. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/ccd/__init__.py +0 -0
  97. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/ccd/ccd_analyzer.py +0 -0
  98. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/ccd/constants_generator.py +0 -0
  99. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/ccd/generate_ccd_constants.py +0 -0
  100. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/cli/__init__.py +0 -0
  101. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/cli/main.py +0 -0
  102. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/__init__.py +0 -0
  103. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/app.py +0 -0
  104. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/atomic_data.py +0 -0
  105. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/misc.py +0 -0
  106. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/parameters.py +0 -0
  107. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/pdb_constants.py +0 -0
  108. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/constants/residue_bonds.py +0 -0
  109. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/__init__.py +0 -0
  110. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/analysis.py +0 -0
  111. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/analyzer.py +0 -0
  112. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/atom_classifier.py +0 -0
  113. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/interactions.py +0 -0
  114. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/np_analyzer.py +0 -0
  115. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/np_vector.py +0 -0
  116. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/pdb_fixer.py +0 -0
  117. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/pdb_parser.py +0 -0
  118. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/core/structure.py +0 -0
  119. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/gui/__init__.py +0 -0
  120. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/gui/main_window.py +0 -0
  121. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/gui/parameter_panel.py +0 -0
  122. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/gui/results_panel.py +0 -0
  123. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/utilities/__init__.py +0 -0
  124. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat/utilities/atom_utils.py +0 -0
  125. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat.icns +0 -0
  126. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat.ico +0 -0
  127. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat.png +0 -0
  128. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat.svg +0 -0
  129. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat_cli.py +0 -0
  130. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/hbat_gui.py +0 -0
  131. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/pytest.ini +0 -0
  132. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/requirements-dev.txt +0 -0
  133. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/setup.cfg +0 -0
  134. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/README.md +0 -0
  135. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/__init__.py +0 -0
  136. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/cli/__init__.py +0 -0
  137. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/cli/test_cli_main.py +0 -0
  138. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/conftest.py +0 -0
  139. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/e2e/__init__.py +0 -0
  140. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/e2e/test_cli_workflows.py +0 -0
  141. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/e2e/test_complete_workflows.py +0 -0
  142. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/gui/__init__.py +0 -0
  143. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/integration/__init__.py +0 -0
  144. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/integration/test_analyzer_components.py +0 -0
  145. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/integration/test_cli_integration.py +0 -0
  146. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/integration/test_molecular_validation.py +0 -0
  147. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/integration/test_pdb_parsing.py +0 -0
  148. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/performance/__init__.py +0 -0
  149. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/performance/test_ccd_performance.py +0 -0
  150. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/performance/test_performance_workflows.py +0 -0
  151. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/run_tests.py +0 -0
  152. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/__init__.py +0 -0
  153. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/test_cli_parsing.py +0 -0
  154. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/test_gui_components.py +0 -0
  155. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/test_interactions.py +0 -0
  156. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/test_parameters.py +0 -0
  157. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/test_structures.py +0 -0
  158. {hbat-2.2.8.dev26 → hbat-2.2.9.dev27}/tests/unit/test_vector_math.py +0 -0
@@ -21,6 +21,11 @@ jobs:
21
21
  with:
22
22
  python-version: ${{ matrix.python-version }}
23
23
 
24
+ - name: Install GraphViz
25
+ run: |
26
+ sudo apt-get update
27
+ sudo apt-get install -y graphviz
28
+
24
29
  - name: Install dependencies
25
30
  run: |
26
31
  python -m pip install --upgrade pip
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hbat
3
- Version: 2.2.8.dev26
3
+ Version: 2.2.9.dev27
4
4
  Summary: Hydrogen Bond Analysis Tool for PDB structures
5
5
  Author-email: Abhishek Tiwari <hbat@abhishek-tiwari.com>
6
6
  License-Expression: MIT
@@ -26,11 +26,14 @@ License-File: LICENSE
26
26
  Requires-Dist: pdbreader>=0.1.0
27
27
  Requires-Dist: numpy>=1.20.0
28
28
  Requires-Dist: networkx>=2.5.0
29
+ Requires-Dist: graphviz>=0.20.0
30
+ Requires-Dist: Pillow>=8.0.0
29
31
  Requires-Dist: matplotlib>=3.3.0
30
32
  Requires-Dist: openbabel-wheel>=3.1.1.22
31
33
  Requires-Dist: pybel>=0.15.5
32
34
  Requires-Dist: mmcif-pdbx>=2.0.1
33
35
  Requires-Dist: mmcif>=0.92.0
36
+ Requires-Dist: tkinter-async-execute>=1.4.0
34
37
  Provides-Extra: dev
35
38
  Requires-Dist: pytest>=6.0.0; extra == "dev"
36
39
  Requires-Dist: pytest-cov>=2.8.0; extra == "dev"
@@ -59,15 +62,8 @@ Requires-Dist: sphinx-sitemap>=2.7.2; extra == "docs"
59
62
  Requires-Dist: sphinx-autodoc-typehints>=1.10.0; extra == "docs"
60
63
  Provides-Extra: gui
61
64
  Requires-Dist: tkinter; python_version >= "3.8" and extra == "gui"
62
- Provides-Extra: advanced-viz
63
- Requires-Dist: seaborn>=0.11.0; extra == "advanced-viz"
64
- Requires-Dist: plotly>=5.0.0; extra == "advanced-viz"
65
- Provides-Extra: export
66
- Requires-Dist: pandas>=1.1.0; extra == "export"
67
- Requires-Dist: openpyxl>=3.0.0; extra == "export"
68
- Requires-Dist: xlwt>=1.3.0; extra == "export"
69
65
  Provides-Extra: all
70
- Requires-Dist: hbat[advanced-viz,docs,export,gui]; extra == "all"
66
+ Requires-Dist: hbat[gui]; extra == "all"
71
67
  Dynamic: license-file
72
68
 
73
69
  ![HBAT](https://github.com/abhishektiwari/hbat/raw/main/hbat.svg)
@@ -102,6 +98,9 @@ HBAT v2 is a modern Python re-implementation of the original Perl-based tool de
102
98
 
103
99
  - **Comprehensive Analysis**: Detect and analyze potential hydrogen bonds, halogen bonds, and X-H...π interactions
104
100
  - **Dual Interface**: Both graphical (tkinter) and command-line interfaces
101
+ - **Advanced Visualization**: Choice between NetworkX/matplotlib and GraphViz renderers for cooperativity chain visualization
102
+ - **High-Quality Graphics**: Export visualizations to PNG, SVG, PDF with configurable resolution
103
+ - **Interactive GUI**: Scrollable visualizations with dynamic layout switching and engine selection
105
104
  - **Parameter Presets**: Built-in presets for different structure types (high-resolution, NMR, membrane proteins, etc.)
106
105
  - **Flexible Parameters**: Customizable distance cutoffs, angle thresholds, and analysis modes.
107
106
  - **Multiple Output Formats**: Text, CSV, and JSON export options
@@ -172,6 +171,28 @@ conda install -c hbat hbat
172
171
  brew install python python3-tk
173
172
  ```
174
173
 
174
+ - **GraphViz** (Optional): Required for advanced cooperativity chain visualization with high-quality graph rendering. HBAT will automatically fall back to NetworkX/matplotlib visualization if GraphViz is not available.
175
+
176
+ **Install GraphViz:**
177
+
178
+ On **Ubuntu/Debian**:
179
+ ```bash
180
+ sudo apt-get update
181
+ sudo apt-get install graphviz
182
+ ```
183
+
184
+ On **macOS** (using Homebrew):
185
+ ```bash
186
+ brew install graphviz
187
+ ```
188
+
189
+ On **Windows**:
190
+ - Download and install from [GraphViz official website](https://graphviz.org/download/)
191
+ - Or using Chocolatey: `choco install graphviz`
192
+ - Or using conda: `conda install -c conda-forge graphviz`
193
+
194
+ **Note**: After installing GraphViz, restart your terminal/command prompt before running HBAT to ensure the GraphViz executables are available in your PATH.
195
+
175
196
  ## Usage
176
197
 
177
198
  ### Graphical Interface
@@ -30,6 +30,9 @@ HBAT v2 is a modern Python re-implementation of the original Perl-based tool de
30
30
 
31
31
  - **Comprehensive Analysis**: Detect and analyze potential hydrogen bonds, halogen bonds, and X-H...π interactions
32
32
  - **Dual Interface**: Both graphical (tkinter) and command-line interfaces
33
+ - **Advanced Visualization**: Choice between NetworkX/matplotlib and GraphViz renderers for cooperativity chain visualization
34
+ - **High-Quality Graphics**: Export visualizations to PNG, SVG, PDF with configurable resolution
35
+ - **Interactive GUI**: Scrollable visualizations with dynamic layout switching and engine selection
33
36
  - **Parameter Presets**: Built-in presets for different structure types (high-resolution, NMR, membrane proteins, etc.)
34
37
  - **Flexible Parameters**: Customizable distance cutoffs, angle thresholds, and analysis modes.
35
38
  - **Multiple Output Formats**: Text, CSV, and JSON export options
@@ -100,6 +103,28 @@ conda install -c hbat hbat
100
103
  brew install python python3-tk
101
104
  ```
102
105
 
106
+ - **GraphViz** (Optional): Required for advanced cooperativity chain visualization with high-quality graph rendering. HBAT will automatically fall back to NetworkX/matplotlib visualization if GraphViz is not available.
107
+
108
+ **Install GraphViz:**
109
+
110
+ On **Ubuntu/Debian**:
111
+ ```bash
112
+ sudo apt-get update
113
+ sudo apt-get install graphviz
114
+ ```
115
+
116
+ On **macOS** (using Homebrew):
117
+ ```bash
118
+ brew install graphviz
119
+ ```
120
+
121
+ On **Windows**:
122
+ - Download and install from [GraphViz official website](https://graphviz.org/download/)
123
+ - Or using Chocolatey: `choco install graphviz`
124
+ - Or using conda: `conda install -c conda-forge graphviz`
125
+
126
+ **Note**: After installing GraphViz, restart your terminal/command prompt before running HBAT to ensure the GraphViz executables are available in your PATH.
127
+
103
128
  ## Usage
104
129
 
105
130
  ### Graphical Interface
@@ -8,7 +8,7 @@ This module provides functionality to generate Python constants files from CCD d
8
8
  Classes
9
9
  -------
10
10
 
11
- .. autoclass:: ConstantsGenerator
11
+ .. autoclass:: CCDConstantsGenerator
12
12
  :members:
13
13
  :undoc-members:
14
14
  :show-inheritance:
@@ -19,9 +19,7 @@ Classes
19
19
  .. autosummary::
20
20
  :nosignatures:
21
21
 
22
- extract_residue_bonds
23
- generate_constants_file
24
- write_constants_file
22
+ write_residue_bonds_constants
25
23
 
26
24
  .. rubric:: Attributes
27
25
 
@@ -30,13 +28,6 @@ Classes
30
28
 
31
29
  Instance of CCDDataManager for accessing CCD data
32
30
 
33
- Functions
34
- ---------
35
-
36
- .. autofunction:: main
37
-
38
- Command-line interface for generating residue bond constants.
39
-
40
31
  Usage:
41
32
  .. code-block:: bash
42
33
 
@@ -102,22 +93,16 @@ Usage Example
102
93
 
103
94
  .. code-block:: python
104
95
 
105
- from hbat.ccd.constants_generator import ConstantsGenerator
96
+ from hbat.ccd.constants_generator import CCDConstantsGenerator
106
97
  from hbat.ccd.ccd_analyzer import CCDDataManager
107
98
 
108
99
  # Initialize generator
109
100
  ccd_manager = CCDDataManager()
110
- generator = ConstantsGenerator(ccd_manager)
101
+ generator = CCDConstantsGenerator(ccd_manager)
111
102
 
112
- # Extract bonds for specific residues
103
+ # Generate constants file for specific residues
113
104
  residue_list = ["ALA", "GLY", "VAL"]
114
- bonds_data = generator.extract_residue_bonds(residue_list)
115
-
116
- # Generate full constants file
117
- generator.generate_constants_file("my_constants.py")
118
-
119
- # Or write specific data
120
- generator.write_constants_file(bonds_data, "partial_constants.py")
105
+ success = generator.write_residue_bonds_constants(residue_list, "my_constants.py")
121
106
 
122
107
  Performance Benefits
123
108
  --------------------
@@ -4,9 +4,4 @@ Main CLI Module
4
4
  .. automodule:: hbat.cli.main
5
5
  :members:
6
6
  :undoc-members:
7
- :show-inheritance:
8
-
9
- Functions
10
- ~~~~~~~~~
11
-
12
- .. autofunction:: hbat.cli.main.main
7
+ :show-inheritance:
@@ -7,17 +7,6 @@ Module Overview
7
7
  ---------------
8
8
 
9
9
  .. automodule:: hbat.constants.atomic_data
10
- :members:
11
- :undoc-members:
12
- :show-inheritance:
13
-
14
- Classes
15
- -------
16
-
17
- Atomic Data
18
- ~~~~~~~~~~~
19
-
20
- .. autoclass:: hbat.constants.atomic_data.AtomicData
21
10
  :members:
22
11
  :undoc-members:
23
12
  :show-inheritance:
@@ -0,0 +1,12 @@
1
+ Miscellaneous Constants
2
+ =======================
3
+
4
+ Contains GUI defaults, file formats, and other miscellaneous constants.
5
+
6
+ Module Overview
7
+ ---------------
8
+
9
+ .. automodule:: hbat.constants.misc
10
+ :members:
11
+ :undoc-members:
12
+ :show-inheritance:
@@ -0,0 +1,12 @@
1
+ Analysis Parameters
2
+ ===================
3
+
4
+ Contains analysis parameters, default values, and validation ranges for molecular interaction analysis.
5
+
6
+ Module Overview
7
+ ---------------
8
+
9
+ .. automodule:: hbat.constants.parameters
10
+ :members:
11
+ :undoc-members:
12
+ :show-inheritance:
@@ -183,150 +183,41 @@ Exception Classes
183
183
  Core Fixing Methods
184
184
  -------------------
185
185
 
186
- Hydrogen Addition
187
- ~~~~~~~~~~~~~~~~~
188
-
189
- .. automethod:: hbat.core.pdb_fixer.PDBFixer.add_missing_hydrogens
190
-
191
- Add missing hydrogen atoms using chemical bonding rules and geometric optimization.
192
-
193
- **Algorithm Details:**
194
-
195
- 1. **Identify Missing Hydrogens**: Compare with expected atom counts
196
- 2. **Determine Bonding Geometry**: Analyze local chemical environment
197
- 3. **Calculate Positions**: Use ideal bond lengths and angles
198
- 4. **Geometric Optimization**: Minimize steric clashes
199
- 5. **Validation**: Check for reasonable H-bond geometries
200
-
201
- **Chemical Rules:**
202
-
203
- - **sp³ Carbons**: Tetrahedral geometry (109.5°)
204
- - **sp² Carbons**: Trigonal planar geometry (120°)
205
- - **Nitrogens**: Pyramidal or planar based on hybridization
206
- - **Oxygens**: Bent geometry for alcohols, linear for carbonyls
207
-
208
- Heavy Atom Reconstruction
209
- ~~~~~~~~~~~~~~~~~~~~~~~~~
210
-
211
- .. automethod:: hbat.core.pdb_fixer.PDBFixer.add_missing_heavy_atoms
212
-
213
- Reconstruct missing heavy atoms in standard protein and nucleic acid residues.
186
+ The PDBFixer class provides comprehensive structure fixing capabilities through its member methods. All methods are documented through the class autodocumentation above.
214
187
 
215
- **Reconstruction Strategy:**
216
-
217
- 1. **Template Matching**: Use ideal residue geometries
218
- 2. **Coordinate Transformation**: Align existing atoms with templates
219
- 3. **Position Calculation**: Place missing atoms using transformations
220
- 4. **Clash Resolution**: Adjust positions to avoid overlaps
221
- 5. **Energy Minimization**: Optimize local geometry
222
-
223
- Residue Standardization
224
- ~~~~~~~~~~~~~~~~~~~~~~~
225
-
226
- .. automethod:: hbat.core.pdb_fixer.PDBFixer.convert_nonstandard_residues
227
-
228
- Convert non-standard and modified residues to their standard equivalents.
229
-
230
- **Conversion Rules:**
231
-
232
- - **Modified Amino Acids**: Map to parent amino acid (e.g., MSE → MET)
233
- - **Protonation States**: Standardize histidine variants (HIS, HID, HIE)
234
- - **Post-translational Modifications**: Convert to unmodified forms
235
- - **Non-standard Nucleotides**: Map to canonical bases
236
-
237
- **Database Integration:**
238
-
239
- Uses comprehensive substitution tables from the constants module:
240
-
241
- .. code-block:: python
188
+ **Key Method Categories:**
242
189
 
243
- from hbat.constants import PROTEIN_SUBSTITUTIONS
190
+ - **Hydrogen Addition**: `add_missing_hydrogens()` - Uses chemical bonding rules and geometric optimization
191
+ - **Heavy Atom Reconstruction**: `add_missing_heavy_atoms()` - Reconstructs missing heavy atoms in standard residues
192
+ - **Residue Standardization**: `convert_nonstandard_residues()` - Converts non-standard and modified residues
193
+ - **Hetrogen Management**: `remove_heterogens()` - Manages hetrogen retention based on analysis requirements
194
+ - **File Operations**: `fix_structure_file()` - High-level interface for comprehensive PDB fixing
244
195
 
245
- # Example conversions
246
- conversions = {
247
- "MSE": "MET", # Selenomethionine → Methionine
248
- "CSO": "CYS", # Cysteine sulfenic acid → Cysteine
249
- "HYP": "PRO", # Hydroxyproline → Proline
250
- "PCA": "GLU" # Pyroglutamic acid → Glutamic acid
251
- }
252
-
253
- Hetrogen Management
254
- ~~~~~~~~~~~~~~~~~~~
255
-
256
- .. automethod:: hbat.core.pdb_fixer.PDBFixer.remove_heterogens
257
-
258
- Remove or retain specific heterogens based on analysis requirements.
259
-
260
- **Hetrogen Categories:**
261
-
262
- - **Waters**: HOH, WAT, DOD molecules
263
- - **Ions**: Metal ions and simple salts
264
- - **Cofactors**: Essential prosthetic groups
265
- - **Ligands**: Small molecule binding partners
266
- - **Crystallographic Additives**: PEG, glycerol, buffer components
267
-
268
- **Retention Strategies:**
269
-
270
- - **Keep All**: Retain all heterogens for comprehensive analysis
271
- - **Keep Essential**: Retain only biologically relevant heterogens
272
- - **Remove All**: Remove all heterogens for protein-only analysis
273
- - **Custom Filtering**: User-defined retention criteria
274
-
275
- File-Level Operations
276
- ---------------------
196
+ Standalone Functions
197
+ --------------------
277
198
 
278
- Structure File Fixing
199
+ Module-Level Functions
279
200
  ~~~~~~~~~~~~~~~~~~~~~~
280
201
 
281
- .. automethod:: hbat.core.pdb_fixer.PDBFixer.fix_structure_file
282
-
283
- High-level interface for fixing PDB files with comprehensive options.
284
-
285
- **Process Flow:**
286
-
287
- 1. **Parse Input**: Load and validate input PDB structure
288
- 2. **Apply Fixes**: Execute requested fixing operations in optimal order
289
- 3. **Validate Results**: Check fixed structure for consistency
290
- 4. **Write Output**: Save enhanced structure to output file
291
- 5. **Generate Report**: Provide detailed fixing statistics
292
-
293
- **Output Formats:**
294
-
295
- - **Standard PDB**: Traditional PDB format with fixed structure
296
- - **Enhanced PDB**: PDB with additional metadata and validation info
297
- - **Statistics Report**: Detailed log of all fixing operations
298
-
299
- Convenience Functions
300
- ---------------------
301
-
302
- Quick Fixing Operations
303
- ~~~~~~~~~~~~~~~~~~~~~~~
304
-
305
- .. autofunction:: hbat.core.pdb_fixer.add_hydrogens_to_file
306
-
307
- Convenience function for quick hydrogen addition to PDB files.
202
+ .. autofunction:: hbat.core.pdb_fixer.add_missing_hydrogens
308
203
 
309
- .. autofunction:: hbat.core.pdb_fixer.standardize_residues_in_file
204
+ Standalone function for adding missing hydrogen atoms to atom lists.
310
205
 
311
- Convenience function for residue standardization without other modifications.
206
+ .. autofunction:: hbat.core.pdb_fixer.fix_pdb_file
312
207
 
313
- .. autofunction:: hbat.core.pdb_fixer.clean_structure_file
208
+ Convenience function for fixing PDB files with comprehensive options.
314
209
 
315
- Convenience function for comprehensive structure cleaning and validation.
210
+ .. autofunction:: hbat.core.pdb_fixer.add_missing_heavy_atoms
316
211
 
317
- Structure Validation
318
- ~~~~~~~~~~~~~~~~~~~~~
212
+ Standalone function for reconstructing missing heavy atoms.
319
213
 
320
- .. autofunction:: hbat.core.pdb_fixer.validate_pdb_structure
214
+ .. autofunction:: hbat.core.pdb_fixer.convert_nonstandard_residues
321
215
 
322
- Comprehensive structure validation with detailed quality reporting.
216
+ Standalone function for converting non-standard residues.
323
217
 
324
- **Validation Checks:**
218
+ .. autofunction:: hbat.core.pdb_fixer.remove_heterogens
325
219
 
326
- - **Atomic Completeness**: Missing atoms in standard residues
327
- - **Geometric Consistency**: Bond lengths, angles, and chirality
328
- - **Chemical Validity**: Proper atom types and formal charges
329
- - **Structural Integrity**: Chain continuity and proper termination
220
+ Standalone function for removing heterogens from atom lists.
330
221
 
331
222
  Chemical Intelligence
332
223
  ---------------------
@@ -0,0 +1,204 @@
1
+ PDB File Parser
2
+ ===============
3
+
4
+ High-performance PDB file parsing and molecular structure handling using the pdbreader library.
5
+
6
+ Module Overview
7
+ ---------------
8
+
9
+ .. automodule:: hbat.core.pdb_parser
10
+ :members:
11
+ :undoc-members:
12
+ :show-inheritance:
13
+
14
+ This module provides comprehensive PDB file parsing capabilities with robust error handling, automatic bond detection, and structure validation. It uses the pdbreader library for efficient parsing and provides structured data access through dataclass objects.
15
+
16
+ High-performance PDB file parser with integrated structure analysis capabilities.
17
+
18
+ **Key Features:**
19
+
20
+ - **Robust Parsing**: Handles malformed PDB files with comprehensive error recovery
21
+ - **Automatic Bond Detection**: Identifies covalent bonds using distance criteria and atomic data
22
+ - **Element Mapping**: Uses utility functions for accurate atom type identification
23
+ - **Structure Validation**: Provides comprehensive structure quality assessment
24
+ - **Performance Optimization**: Efficient processing of large molecular complexes
25
+
26
+ **Usage Examples:**
27
+
28
+ .. code-block:: python
29
+
30
+ from hbat.core.pdb_parser import PDBParser
31
+
32
+ # Basic parsing
33
+ parser = PDBParser()
34
+ atoms, residues, bonds = parser.parse_file("protein.pdb")
35
+
36
+ print(f"Parsed {len(atoms)} atoms")
37
+ print(f"Found {len(residues)} residues")
38
+ print(f"Detected {len(bonds)} bonds")
39
+
40
+ # Structure analysis
41
+ stats = parser.get_statistics()
42
+ has_h = parser.has_hydrogens()
43
+
44
+ print(f"Structure statistics: {stats}")
45
+ print(f"Contains hydrogens: {has_h}")
46
+
47
+ **Performance Characteristics:**
48
+
49
+ - Processes ~50,000 atoms per second on modern hardware
50
+ - Memory usage scales linearly with structure size
51
+ - Efficient handling of large protein complexes (>100k atoms)
52
+ - Optimized for both single structures and batch processing
53
+
54
+ Key Features
55
+ ------------
56
+
57
+ **Data Structure Classes:**
58
+
59
+ - **PDBParser**: High-performance PDB file parser with integrated structure analysis
60
+ - **Atom**: Comprehensive atomic data structure with PDB information and calculated properties
61
+ - **Residue**: Residue-level data structure containing atom collections and properties
62
+ - **Bond**: Chemical bond representation with geometric and chemical properties
63
+
64
+ **Core Capabilities:**
65
+
66
+ - **File Parsing**: Robust parsing with comprehensive error handling
67
+ - **Structure Analysis**: Comprehensive statistics and quality assessment
68
+ - **Bond Detection**: Automatic covalent bond identification using distance criteria
69
+ - **Data Access**: Structured access to atoms, residues, and connectivity information
70
+
71
+ All classes and methods are fully documented through the module autodocumentation above.
72
+
73
+ Chemical Intelligence
74
+ ---------------------
75
+
76
+ **Bond Detection Algorithm:**
77
+
78
+ The parser uses sophisticated chemical rules for automatic bond detection:
79
+
80
+ 1. **Distance-Based Detection**: Uses covalent radii and distance cutoffs
81
+ 2. **Element-Specific Rules**: Different criteria for different element pairs
82
+ 3. **Chemical Validation**: Validates bonds against expected chemical properties
83
+ 4. **Performance Optimization**: Efficient spatial indexing for large structures
84
+
85
+ **Atom Type Recognition:**
86
+
87
+ - Automatic element detection from atom names
88
+ - Handling of non-standard atom naming conventions
89
+ - Support for modified residues and heterogens
90
+ - Integration with atomic property databases
91
+
92
+ Performance and Scalability
93
+ ---------------------------
94
+
95
+ **Computational Complexity:**
96
+
97
+ - **File Parsing**: O(n) where n is number of atoms
98
+ - **Bond Detection**: O(n log n) using spatial indexing
99
+ - **Structure Analysis**: O(n) linear operations
100
+ - **Memory Usage**: Minimal overhead beyond raw structure data
101
+
102
+ **Benchmarks:**
103
+
104
+ Typical performance on modern hardware:
105
+
106
+ - **Small proteins** (<1000 atoms): <50 ms parsing time
107
+ - **Medium proteins** (1000-10000 atoms): 50-500 ms parsing time
108
+ - **Large complexes** (10000+ atoms): 500ms-5s parsing time
109
+
110
+ Integration Examples
111
+ --------------------
112
+
113
+ Analysis Pipeline Integration
114
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
+
116
+ .. code-block:: python
117
+
118
+ from hbat.core.pdb_parser import PDBParser
119
+ from hbat.core.analyzer import MolecularInteractionAnalyzer
120
+
121
+ # Complete analysis pipeline
122
+ def analyze_structure(pdb_file):
123
+ # Parse structure
124
+ parser = PDBParser()
125
+ atoms, residues, bonds = parser.parse_file(pdb_file)
126
+
127
+ print(f"Parsed structure with {len(atoms)} atoms")
128
+
129
+ # Get parsing statistics
130
+ stats = parser.get_statistics()
131
+ print(f"Statistics: {stats}")
132
+
133
+ # Check hydrogen content
134
+ has_hydrogens = parser.has_hydrogens()
135
+ if not has_hydrogens:
136
+ print("Warning: Structure lacks hydrogen atoms")
137
+
138
+ return atoms, residues, bonds
139
+
140
+ Batch Processing
141
+ ~~~~~~~~~~~~~~~~
142
+
143
+ .. code-block:: python
144
+
145
+ import os
146
+ from concurrent.futures import ProcessPoolExecutor
147
+
148
+ def parse_structure_batch(pdb_files):
149
+ """Parse multiple PDB structures in parallel."""
150
+
151
+ def parse_single_file(pdb_file):
152
+ parser = PDBParser()
153
+ try:
154
+ atoms, residues, bonds = parser.parse_file(pdb_file)
155
+ return {
156
+ "file": pdb_file,
157
+ "success": True,
158
+ "atom_count": len(atoms),
159
+ "residue_count": len(residues),
160
+ "bond_count": len(bonds)
161
+ }
162
+ except Exception as e:
163
+ return {"file": pdb_file, "success": False, "error": str(e)}
164
+
165
+ # Process files in parallel
166
+ with ProcessPoolExecutor() as executor:
167
+ results = list(executor.map(parse_single_file, pdb_files))
168
+
169
+ # Summarize results
170
+ successful = [r for r in results if r["success"]]
171
+ failed = [r for r in results if not r["success"]]
172
+
173
+ print(f"Successfully parsed {len(successful)} structures")
174
+ print(f"Failed to parse {len(failed)} structures")
175
+
176
+ return results
177
+
178
+ Quality Control
179
+ ---------------
180
+
181
+ **Validation Metrics:**
182
+
183
+ The parser provides comprehensive quality metrics:
184
+
185
+ .. code-block:: python
186
+
187
+ # Quality assessment after parsing
188
+ parser = PDBParser()
189
+ atoms, residues, bonds = parser.parse_file("structure.pdb")
190
+
191
+ stats = parser.get_statistics()
192
+ print(f"Structure Quality Metrics:")
193
+ print(f" Total atoms: {stats['total_atoms']}")
194
+ print(f" Protein atoms: {stats['protein_atoms']}")
195
+ print(f" Water molecules: {stats['water_count']}")
196
+ print(f" Heterogens: {stats['hetrogen_count']}")
197
+
198
+ **Common Issues and Solutions:**
199
+
200
+ - **Missing Atoms**: Detected and reported in statistics
201
+ - **Invalid Coordinates**: Flagged during parsing
202
+ - **Unusual Residues**: Identified and classified appropriately
203
+ - **Bond Detection Issues**: Comprehensive error reporting and recovery
204
+ - **File Format Problems**: Robust error handling with detailed messages