hbat 2.2.11__tar.gz → 2.2.11.dev29__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 (153) hide show
  1. {hbat-2.2.11 → hbat-2.2.11.dev29}/PKG-INFO +25 -8
  2. {hbat-2.2.11 → hbat-2.2.11.dev29}/README.md +24 -7
  3. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/cli.rst +79 -26
  4. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/_version.py +2 -2
  5. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/cli/main.py +309 -13
  6. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat.egg-info/SOURCES.txt +1 -0
  7. hbat-2.2.11.dev29/tests/cli/test_cli_output_formats.py +387 -0
  8. {hbat-2.2.11 → hbat-2.2.11.dev29}/.github/workflows/cleanup-prereleases.yml +0 -0
  9. {hbat-2.2.11 → hbat-2.2.11.dev29}/.github/workflows/release.yml +0 -0
  10. {hbat-2.2.11 → hbat-2.2.11.dev29}/.github/workflows/test.yml +0 -0
  11. {hbat-2.2.11 → hbat-2.2.11.dev29}/CITATION.cff +0 -0
  12. {hbat-2.2.11 → hbat-2.2.11.dev29}/CODE_OF_CONDUCT.md +0 -0
  13. {hbat-2.2.11 → hbat-2.2.11.dev29}/CONTRIBUTING.md +0 -0
  14. {hbat-2.2.11 → hbat-2.2.11.dev29}/LICENSE +0 -0
  15. {hbat-2.2.11 → hbat-2.2.11.dev29}/MANIFEST.in +0 -0
  16. {hbat-2.2.11 → hbat-2.2.11.dev29}/Makefile +0 -0
  17. {hbat-2.2.11 → hbat-2.2.11.dev29}/build_standalone.py +0 -0
  18. {hbat-2.2.11 → hbat-2.2.11.dev29}/build_standalone_linux.py +0 -0
  19. {hbat-2.2.11 → hbat-2.2.11.dev29}/build_standalone_windows.py +0 -0
  20. {hbat-2.2.11 → hbat-2.2.11.dev29}/conda/meta.yaml +0 -0
  21. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/Makefile +0 -0
  22. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/requirements.txt +0 -0
  23. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/_static/custom.css +0 -0
  24. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/_static/light-theme.css +0 -0
  25. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/ccd/ccd_analyzer.rst +0 -0
  26. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/ccd/constants_generator.rst +0 -0
  27. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/ccd/generate_ccd_constants.rst +0 -0
  28. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/ccd/index.rst +0 -0
  29. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/cli/index.rst +0 -0
  30. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/constants/app.rst +0 -0
  31. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/constants/atomic_data.rst +0 -0
  32. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/constants/index.rst +0 -0
  33. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/constants/misc.rst +0 -0
  34. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/constants/parameters.rst +0 -0
  35. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/constants/pdb_constants.rst +0 -0
  36. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/index.rst +0 -0
  37. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/interactions.rst +0 -0
  38. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/np_analyzer.rst +0 -0
  39. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/np_vector.rst +0 -0
  40. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/pdb_fixer.rst +0 -0
  41. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/pdb_parser.rst +0 -0
  42. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/core/structure.rst +0 -0
  43. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/examples/index.rst +0 -0
  44. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/gui/index.rst +0 -0
  45. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/index.rst +0 -0
  46. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/utilities/atom_utils.rst +0 -0
  47. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/utilities/graphviz_utils.rst +0 -0
  48. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/api/utilities/index.rst +0 -0
  49. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/conf.py +0 -0
  50. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/development.rst +0 -0
  51. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/index.rst +0 -0
  52. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/installation.rst +0 -0
  53. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/license.rst +0 -0
  54. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/logic.rst +0 -0
  55. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/parameters.rst +0 -0
  56. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/pdbfixing.rst +0 -0
  57. {hbat-2.2.11 → hbat-2.2.11.dev29}/docs/source/quickstart.rst +0 -0
  58. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/1bhl.pdb +0 -0
  59. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/1gai.pdb +0 -0
  60. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/1ubi.pdb +0 -0
  61. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/2izf.pdb +0 -0
  62. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/4jsv.pdb +0 -0
  63. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/4laz.pdb +0 -0
  64. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/4ub7.pdb +0 -0
  65. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/4x21.pdb +0 -0
  66. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_pdb_files/6rsa.pdb +0 -0
  67. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/drug_design_strict.hbat +0 -0
  68. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/high_resolution.hbat +0 -0
  69. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/low_resolution.hbat +0 -0
  70. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/membrane_proteins.hbat +0 -0
  71. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/nmr_structures.hbat +0 -0
  72. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/standard_resolution.hbat +0 -0
  73. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/strong_interactions_only.hbat +0 -0
  74. {hbat-2.2.11 → hbat-2.2.11.dev29}/example_presets/weak_interactions_permissive.hbat +0 -0
  75. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/__init__.py +0 -0
  76. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/ccd/__init__.py +0 -0
  77. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/ccd/ccd_analyzer.py +0 -0
  78. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/ccd/constants_generator.py +0 -0
  79. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/ccd/generate_ccd_constants.py +0 -0
  80. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/cli/__init__.py +0 -0
  81. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/__init__.py +0 -0
  82. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/app.py +0 -0
  83. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/atomic_data.py +0 -0
  84. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/misc.py +0 -0
  85. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/parameters.py +0 -0
  86. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/pdb_constants.py +0 -0
  87. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/constants/residue_bonds.py +0 -0
  88. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/__init__.py +0 -0
  89. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/analysis.py +0 -0
  90. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/analyzer.py +0 -0
  91. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/app_config.py +0 -0
  92. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/atom_classifier.py +0 -0
  93. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/interactions.py +0 -0
  94. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/np_analyzer.py +0 -0
  95. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/np_vector.py +0 -0
  96. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/pdb_fixer.py +0 -0
  97. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/pdb_parser.py +0 -0
  98. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/core/structure.py +0 -0
  99. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/__init__.py +0 -0
  100. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/chain_visualization.py +0 -0
  101. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/export_manager.py +0 -0
  102. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/graphviz_preferences_dialog.py +0 -0
  103. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/graphviz_renderer.py +0 -0
  104. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/main_window.py +0 -0
  105. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/matplotlib_renderer.py +0 -0
  106. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/parameter_panel.py +0 -0
  107. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/results_panel.py +0 -0
  108. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/gui/visualization_renderer.py +0 -0
  109. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/utilities/__init__.py +0 -0
  110. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/utilities/atom_utils.py +0 -0
  111. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat/utilities/graphviz_utils.py +0 -0
  112. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat.icns +0 -0
  113. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat.ico +0 -0
  114. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat.png +0 -0
  115. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat.svg +0 -0
  116. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat_cli.py +0 -0
  117. {hbat-2.2.11 → hbat-2.2.11.dev29}/hbat_gui.py +0 -0
  118. {hbat-2.2.11 → hbat-2.2.11.dev29}/pyproject.toml +0 -0
  119. {hbat-2.2.11 → hbat-2.2.11.dev29}/pytest.ini +0 -0
  120. {hbat-2.2.11 → hbat-2.2.11.dev29}/requirements-dev.txt +0 -0
  121. {hbat-2.2.11 → hbat-2.2.11.dev29}/requirements.txt +0 -0
  122. {hbat-2.2.11 → hbat-2.2.11.dev29}/setup.cfg +0 -0
  123. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/README.md +0 -0
  124. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/__init__.py +0 -0
  125. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/cli/__init__.py +0 -0
  126. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/cli/test_cli_main.py +0 -0
  127. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/conftest.py +0 -0
  128. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/e2e/__init__.py +0 -0
  129. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/e2e/test_cli_workflows.py +0 -0
  130. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/e2e/test_complete_workflows.py +0 -0
  131. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/e2e/test_graphviz_workflows.py +0 -0
  132. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/e2e/test_gui_workflows.py +0 -0
  133. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/gui/__init__.py +0 -0
  134. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/gui/test_gui_components.py +0 -0
  135. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/integration/__init__.py +0 -0
  136. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/integration/test_analyzer_components.py +0 -0
  137. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/integration/test_cli_integration.py +0 -0
  138. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/integration/test_graphviz_renderer.py +0 -0
  139. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/integration/test_molecular_validation.py +0 -0
  140. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/integration/test_pdb_parsing.py +0 -0
  141. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/performance/__init__.py +0 -0
  142. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/performance/test_ccd_performance.py +0 -0
  143. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/performance/test_performance_workflows.py +0 -0
  144. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/run_tests.py +0 -0
  145. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/__init__.py +0 -0
  146. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_cli_parsing.py +0 -0
  147. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_graphviz_utils.py +0 -0
  148. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_gui_components.py +0 -0
  149. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_interactions.py +0 -0
  150. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_parameters.py +0 -0
  151. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_scrollable_canvas.py +0 -0
  152. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_structures.py +0 -0
  153. {hbat-2.2.11 → hbat-2.2.11.dev29}/tests/unit/test_vector_math.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hbat
3
- Version: 2.2.11
3
+ Version: 2.2.11.dev29
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
@@ -220,26 +220,43 @@ Basic usage:
220
220
  hbat input.pdb
221
221
  ```
222
222
 
223
- With custom parameters:
223
+ #### Output Format Options
224
+
225
+ HBAT supports multiple output formats with automatic detection based on file extension:
224
226
 
225
227
  ```bash
226
- hbat input.pdb -o results.txt --hb-distance 3.0 --mode local
228
+ # Single file outputs (format auto-detected from extension)
229
+ hbat input.pdb -o results.txt # Text format
230
+ hbat input.pdb -o results.csv # CSV format (single file with all data)
231
+ hbat input.pdb -o results.json # JSON format (single file with all data)
232
+
233
+ # Multiple file outputs (separate files per interaction type)
234
+ hbat input.pdb --csv results # Creates results_h_bonds.csv, results_x_bonds.csv, etc.
235
+ hbat input.pdb --json results # Creates results_h_bonds.json, results_x_bonds.json, etc.
227
236
  ```
228
237
 
238
+ With custom parameters:
239
+
240
+ ```bash
241
+ hbat input.pdb -o results.csv --hb-distance 3.0 --mode local
229
242
  ```
243
+
244
+ #### List Available Presets
245
+
246
+ ```bash
230
247
  hbat --list-presets
231
248
  ```
232
249
 
233
250
  #### Use a specific preset
234
251
 
235
- ```
252
+ ```bash
236
253
  hbat protein.pdb --preset high_resolution
237
254
  hbat membrane_protein.pdb --preset membrane_proteins
238
255
  ```
239
256
 
240
257
  #### Use preset with custom overrides
241
258
 
242
- ```
259
+ ```bash
243
260
  hbat protein.pdb --preset drug_design_strict --hb-distance 3.0 --verbose
244
261
  ```
245
262
 
@@ -252,9 +269,9 @@ positional arguments:
252
269
  optional arguments:
253
270
  -h, --help show this help message and exit
254
271
  -o OUTPUT, --output OUTPUT
255
- Output text file for results
256
- --json JSON Output JSON file for structured results
257
- --csv CSV Output CSV file for tabular results
272
+ Output file (format auto-detected from extension: .txt, .csv, .json)
273
+ --json JSON Export to multiple JSON files (base name for files)
274
+ --csv CSV Export to multiple CSV files (base name for files)
258
275
 
259
276
  Preset Options:
260
277
  --preset PRESET Load parameters from preset file (.hbat or .json)
@@ -152,26 +152,43 @@ Basic usage:
152
152
  hbat input.pdb
153
153
  ```
154
154
 
155
- With custom parameters:
155
+ #### Output Format Options
156
+
157
+ HBAT supports multiple output formats with automatic detection based on file extension:
156
158
 
157
159
  ```bash
158
- hbat input.pdb -o results.txt --hb-distance 3.0 --mode local
160
+ # Single file outputs (format auto-detected from extension)
161
+ hbat input.pdb -o results.txt # Text format
162
+ hbat input.pdb -o results.csv # CSV format (single file with all data)
163
+ hbat input.pdb -o results.json # JSON format (single file with all data)
164
+
165
+ # Multiple file outputs (separate files per interaction type)
166
+ hbat input.pdb --csv results # Creates results_h_bonds.csv, results_x_bonds.csv, etc.
167
+ hbat input.pdb --json results # Creates results_h_bonds.json, results_x_bonds.json, etc.
159
168
  ```
160
169
 
170
+ With custom parameters:
171
+
172
+ ```bash
173
+ hbat input.pdb -o results.csv --hb-distance 3.0 --mode local
161
174
  ```
175
+
176
+ #### List Available Presets
177
+
178
+ ```bash
162
179
  hbat --list-presets
163
180
  ```
164
181
 
165
182
  #### Use a specific preset
166
183
 
167
- ```
184
+ ```bash
168
185
  hbat protein.pdb --preset high_resolution
169
186
  hbat membrane_protein.pdb --preset membrane_proteins
170
187
  ```
171
188
 
172
189
  #### Use preset with custom overrides
173
190
 
174
- ```
191
+ ```bash
175
192
  hbat protein.pdb --preset drug_design_strict --hb-distance 3.0 --verbose
176
193
  ```
177
194
 
@@ -184,9 +201,9 @@ positional arguments:
184
201
  optional arguments:
185
202
  -h, --help show this help message and exit
186
203
  -o OUTPUT, --output OUTPUT
187
- Output text file for results
188
- --json JSON Output JSON file for structured results
189
- --csv CSV Output CSV file for tabular results
204
+ Output file (format auto-detected from extension: .txt, .csv, .json)
205
+ --json JSON Export to multiple JSON files (base name for files)
206
+ --csv CSV Export to multiple CSV files (base name for files)
190
207
 
191
208
  Preset Options:
192
209
  --preset PRESET Load parameters from preset file (.hbat or .json)
@@ -41,15 +41,29 @@ Input/Output Options
41
41
 
42
42
  .. option:: -o OUTPUT, --output OUTPUT
43
43
 
44
- Output text file for saving analysis results.
44
+ Output file for saving analysis results. The format is automatically detected from the file extension:
45
+
46
+ - ``.txt`` - Text format (human-readable summary)
47
+ - ``.csv`` - CSV format (single file with all interactions)
48
+ - ``.json`` - JSON format (single file with structured data)
45
49
 
46
- .. option:: --json JSON_FILE
50
+ .. option:: --json JSON_BASE
47
51
 
48
- Export results to JSON format for programmatic access.
52
+ Export results to multiple JSON files. Creates separate files for each interaction type:
53
+
54
+ - ``{base}_h_bonds.json`` - Hydrogen bonds
55
+ - ``{base}_x_bonds.json`` - Halogen bonds
56
+ - ``{base}_pi_interactions.json`` - π interactions
57
+ - ``{base}_cooperativity_chains.json`` - Cooperativity chains
49
58
 
50
- .. option:: --csv CSV_FILE
59
+ .. option:: --csv CSV_BASE
51
60
 
52
- Export results to CSV format for spreadsheet analysis.
61
+ Export results to multiple CSV files. Creates separate files for each interaction type:
62
+
63
+ - ``{base}_h_bonds.csv`` - Hydrogen bonds
64
+ - ``{base}_x_bonds.csv`` - Halogen bonds
65
+ - ``{base}_pi_interactions.csv`` - π interactions
66
+ - ``{base}_cooperativity_chains.csv`` - Cooperativity chains
53
67
 
54
68
  Analysis Parameters
55
69
  ~~~~~~~~~~~~~~~~~~~
@@ -166,11 +180,35 @@ Basic analysis with default parameters:
166
180
 
167
181
  hbat protein.pdb
168
182
 
169
- Save results to a CSV file (default format):
183
+ Single File Output Formats
184
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
185
+
186
+ Save results to different formats (auto-detected from extension):
170
187
 
171
188
  .. code-block:: bash
172
189
 
173
- hbat protein.pdb -o results.csv
190
+ hbat protein.pdb -o results.txt # Text format
191
+ hbat protein.pdb -o results.csv # CSV format (single file)
192
+ hbat protein.pdb -o results.json # JSON format (single file)
193
+
194
+ Multiple File Outputs
195
+ ~~~~~~~~~~~~~~~~~~~~~~
196
+
197
+ Export to separate files for each interaction type:
198
+
199
+ .. code-block:: bash
200
+
201
+ hbat protein.pdb --csv results # Creates multiple CSV files
202
+ hbat protein.pdb --json results # Creates multiple JSON files
203
+
204
+ This creates files like:
205
+ - ``results_h_bonds.csv``
206
+ - ``results_x_bonds.csv``
207
+ - ``results_pi_interactions.csv``
208
+ - ``results_cooperativity_chains.csv``
209
+
210
+ Custom Analysis Parameters
211
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
212
 
175
213
  Use custom hydrogen bond criteria:
176
214
 
@@ -233,31 +271,46 @@ The default text output includes:
233
271
  - Detailed lists of each interaction type
234
272
  - Cooperativity chain information
235
273
 
236
- JSON Output
237
- ~~~~~~~~~~~
274
+ Single File JSON Output
275
+ ~~~~~~~~~~~~~~~~~~~~~~~
276
+
277
+ When using ``-o results.json``, HBAT creates a single JSON file containing all interactions with:
278
+
279
+ - Metadata section with version and file information
280
+ - Complete summary statistics
281
+ - All interaction types in one structured file
282
+
283
+ Multiple File JSON Output
284
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
285
+
286
+ When using ``--json results``, HBAT creates separate JSON files for each interaction type:
287
+
288
+ - ``results_h_bonds.json`` - Hydrogen bonds with donor-acceptor properties
289
+ - ``results_x_bonds.json`` - Halogen bonds with geometric data
290
+ - ``results_pi_interactions.json`` - π interactions with distance/angle data
291
+ - ``results_cooperativity_chains.json`` - Cooperativity chain networks
292
+
293
+ Each file includes metadata and structured arrays with all geometric parameters and atom coordinates.
238
294
 
239
- The JSON format automatically generates separate files for each interaction type with structured data:
295
+ Single File CSV Output
296
+ ~~~~~~~~~~~~~~~~~~~~~~~
240
297
 
241
- - Metadata section with version and file information
242
- - Complete statistics for each interaction type
243
- - Arrays of interactions with all geometric parameters
244
- - Atom coordinates and structural properties for further processing
298
+ When using ``-o results.csv``, HBAT creates a single CSV file with all interactions organized in sections:
245
299
 
246
- When using ``--json results.json``, HBAT creates:
247
- - ``results_h_bonds.json``
248
- - ``results_halogen_bonds.json``
249
- - ``results_pi_interactions.json``
250
- - ``results_cooperativity_chains.json``
300
+ - Hydrogen bonds with D-A Properties and B/S classification
301
+ - Halogen bonds with enhanced property columns
302
+ - π interactions with structural information
303
+ - Cooperativity chains with interaction networks
251
304
 
252
- CSV Output
253
- ~~~~~~~~~~
305
+ Multiple File CSV Output
306
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
254
307
 
255
- The CSV format automatically generates separate files for each interaction type:
308
+ When using ``--csv results``, HBAT creates separate CSV files for each interaction type:
256
309
 
257
- - Hydrogen bonds with donor-acceptor properties and backbone/sidechain classification
258
- - Halogen bonds with geometric data and structural properties
259
- - π interactions with distance and angle information
260
- - Cooperativity chains showing interaction networks
310
+ - ``results_h_bonds.csv`` - Hydrogen bonds with complete donor-acceptor properties
311
+ - ``results_x_bonds.csv`` - Halogen bonds with geometric and structural data
312
+ - ``results_pi_interactions.csv`` - π interactions with distance and angle information
313
+ - ``results_cooperativity_chains.csv`` - Cooperativity chains showing interaction networks
261
314
 
262
315
  When using ``--csv results.csv``, HBAT creates:
263
316
  - ``results_h_bonds.csv``
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.2.11'
21
- __version_tuple__ = version_tuple = (2, 2, 11)
20
+ __version__ = version = '2.2.11.dev29'
21
+ __version_tuple__ = version_tuple = (2, 2, 11, 'dev29')
@@ -74,13 +74,15 @@ def create_parser() -> argparse.ArgumentParser:
74
74
  epilog="""
75
75
  Examples:
76
76
  %(prog)s input.pdb # Basic analysis
77
- %(prog)s input.pdb -o results.txt # Save results to file
77
+ %(prog)s input.pdb -o results.txt # Save results to text file
78
+ %(prog)s input.pdb -o results.csv # Save results to CSV file (single file)
79
+ %(prog)s input.pdb -o results.json # Save results to JSON file (single file)
80
+ %(prog)s input.pdb --csv results # Export to multiple CSV files (one per interaction type)
81
+ %(prog)s input.pdb --json results # Export to multiple JSON files (one per interaction type)
78
82
  %(prog)s input.pdb --hb-distance 3.0 # Custom H-bond distance cutoff
79
83
  %(prog)s input.pdb --mode local # Local interactions only
80
- %(prog)s input.pdb --json results.json # Export to JSON format
81
84
  %(prog)s --list-presets # List available presets
82
85
  %(prog)s input.pdb --preset high_resolution # Use preset with custom overrides
83
- %(prog)s input.pdb --preset drug_design_strict --hb-distance 3.0
84
86
  """,
85
87
  )
86
88
 
@@ -93,9 +95,9 @@ Examples:
93
95
  parser.add_argument("input", nargs="?", help="Input PDB file")
94
96
 
95
97
  # Output options
96
- parser.add_argument("-o", "--output", help="Output text file for results")
97
- parser.add_argument("--json", help="Output JSON file for structured results")
98
- parser.add_argument("--csv", help="Output CSV file for tabular results")
98
+ parser.add_argument("-o", "--output", help="Output file (format auto-detected from extension: .txt, .csv, .json)")
99
+ parser.add_argument("--json", help="Export to multiple JSON files (base name for files)")
100
+ parser.add_argument("--csv", help="Export to multiple CSV files (base name for files)")
99
101
 
100
102
  # Preset options
101
103
  preset_group = parser.add_argument_group("Preset Options")
@@ -774,6 +776,267 @@ def export_to_json(
774
776
  json.dump(data, f, indent=2)
775
777
 
776
778
 
779
+ def detect_output_format(filename: str) -> str:
780
+ """Detect output format from file extension.
781
+
782
+ :param filename: Output filename
783
+ :type filename: str
784
+ :returns: Format type ('text', 'csv', 'json')
785
+ :rtype: str
786
+ :raises ValueError: If file extension is not supported
787
+ """
788
+ import os
789
+ _, ext = os.path.splitext(filename)
790
+ ext_lower = ext.lower()
791
+
792
+ if ext_lower == '.txt':
793
+ return 'text'
794
+ elif ext_lower == '.csv':
795
+ return 'csv'
796
+ elif ext_lower == '.json':
797
+ return 'json'
798
+ else:
799
+ raise ValueError(f"Unsupported output format '{ext}'. Use .txt, .csv, or .json")
800
+
801
+
802
+ def export_to_csv_files(analyzer: NPMolecularInteractionAnalyzer, base_filename: str) -> None:
803
+ """Export results to multiple CSV files.
804
+
805
+ Creates separate CSV files for each interaction type.
806
+
807
+ :param analyzer: Analysis results to export
808
+ :type analyzer: NPMolecularInteractionAnalyzer
809
+ :param base_filename: Base filename (extension will be removed)
810
+ :type base_filename: str
811
+ :returns: None
812
+ :rtype: None
813
+ """
814
+ import csv
815
+ import math
816
+ import os
817
+ from pathlib import Path
818
+
819
+ base_path = Path(base_filename)
820
+ base_name = base_path.stem
821
+ directory = base_path.parent
822
+
823
+ # Export hydrogen bonds
824
+ if analyzer.hydrogen_bonds:
825
+ hb_file = directory / f"{base_name}_h_bonds.csv"
826
+ with open(hb_file, 'w', newline='', encoding='utf-8') as csvfile:
827
+ writer = csv.writer(csvfile)
828
+ writer.writerow([
829
+ "Donor_Residue", "Donor_Atom", "Hydrogen_Atom",
830
+ "Acceptor_Residue", "Acceptor_Atom", "Distance_Angstrom",
831
+ "Angle_Degrees", "Donor_Acceptor_Distance_Angstrom",
832
+ "Bond_Type", "B/S_Interaction", "D-A_Properties"
833
+ ])
834
+ for hb in analyzer.hydrogen_bonds:
835
+ writer.writerow([
836
+ hb.donor_residue, hb.donor.name, hb.hydrogen.name,
837
+ hb.acceptor_residue, hb.acceptor.name,
838
+ f"{hb.distance:.3f}", f"{math.degrees(hb.angle):.1f}",
839
+ f"{hb.donor_acceptor_distance:.3f}", hb.bond_type,
840
+ hb.get_backbone_sidechain_interaction(),
841
+ hb.donor_acceptor_properties
842
+ ])
843
+
844
+ # Export halogen bonds
845
+ if analyzer.halogen_bonds:
846
+ xb_file = directory / f"{base_name}_x_bonds.csv"
847
+ with open(xb_file, 'w', newline='', encoding='utf-8') as csvfile:
848
+ writer = csv.writer(csvfile)
849
+ writer.writerow([
850
+ "Halogen_Residue", "Halogen_Atom", "Acceptor_Residue",
851
+ "Acceptor_Atom", "Distance_Angstrom", "Angle_Degrees",
852
+ "Bond_Type", "B/S_Interaction", "D-A_Properties"
853
+ ])
854
+ for xb in analyzer.halogen_bonds:
855
+ writer.writerow([
856
+ xb.halogen_residue, xb.halogen.name,
857
+ xb.acceptor_residue, xb.acceptor.name,
858
+ f"{xb.distance:.3f}", f"{math.degrees(xb.angle):.1f}",
859
+ xb.bond_type,
860
+ xb.get_backbone_sidechain_interaction(),
861
+ xb.donor_acceptor_properties
862
+ ])
863
+
864
+ # Export π interactions
865
+ if analyzer.pi_interactions:
866
+ pi_file = directory / f"{base_name}_pi_interactions.csv"
867
+ with open(pi_file, 'w', newline='', encoding='utf-8') as csvfile:
868
+ writer = csv.writer(csvfile)
869
+ writer.writerow([
870
+ "Donor_Residue", "Donor_Atom", "Hydrogen_Atom",
871
+ "Pi_Residue", "Distance_Angstrom", "Angle_Degrees",
872
+ "B/S_Interaction", "D-A_Properties"
873
+ ])
874
+ for pi in analyzer.pi_interactions:
875
+ writer.writerow([
876
+ pi.donor_residue, pi.donor.name, pi.hydrogen.name,
877
+ pi.pi_residue, f"{pi.distance:.3f}",
878
+ f"{math.degrees(pi.angle):.1f}",
879
+ pi.get_backbone_sidechain_interaction(),
880
+ pi.donor_acceptor_properties
881
+ ])
882
+
883
+ # Export cooperativity chains
884
+ if analyzer.cooperativity_chains:
885
+ chains_file = directory / f"{base_name}_cooperativity_chains.csv"
886
+ with open(chains_file, 'w', newline='', encoding='utf-8') as csvfile:
887
+ writer = csv.writer(csvfile)
888
+ writer.writerow(["Chain_ID", "Chain_Length", "Chain_Type", "Interactions"])
889
+ for i, chain in enumerate(analyzer.cooperativity_chains):
890
+ interactions_str = " -> ".join([
891
+ f"{interaction.get_donor_residue()}({interaction.get_donor_atom().name if interaction.get_donor_atom() else '?'})"
892
+ for interaction in chain.interactions
893
+ ])
894
+ writer.writerow([
895
+ i + 1, chain.chain_length, chain.chain_type, interactions_str
896
+ ])
897
+
898
+
899
+ def export_to_json_files(analyzer: NPMolecularInteractionAnalyzer, base_filename: str, input_file: str) -> None:
900
+ """Export results to multiple JSON files.
901
+
902
+ Creates separate JSON files for each interaction type.
903
+
904
+ :param analyzer: Analysis results to export
905
+ :type analyzer: NPMolecularInteractionAnalyzer
906
+ :param base_filename: Base filename (extension will be removed)
907
+ :type base_filename: str
908
+ :param input_file: Path to the input file analyzed
909
+ :type input_file: str
910
+ :returns: None
911
+ :rtype: None
912
+ """
913
+ import json
914
+ import math
915
+ from pathlib import Path
916
+
917
+ base_path = Path(base_filename)
918
+ base_name = base_path.stem
919
+ directory = base_path.parent
920
+
921
+ # Export hydrogen bonds
922
+ if analyzer.hydrogen_bonds:
923
+ hb_file = directory / f"{base_name}_h_bonds.json"
924
+ data = {
925
+ "metadata": {
926
+ "input_file": input_file,
927
+ "analysis_engine": "HBAT",
928
+ "version": __version__,
929
+ "interaction_type": "Hydrogen Bonds"
930
+ },
931
+ "interactions": []
932
+ }
933
+ for hb in analyzer.hydrogen_bonds:
934
+ data["interactions"].append({
935
+ "donor_residue": hb.donor_residue,
936
+ "donor_atom": hb.donor.name,
937
+ "hydrogen_atom": hb.hydrogen.name,
938
+ "acceptor_residue": hb.acceptor_residue,
939
+ "acceptor_atom": hb.acceptor.name,
940
+ "distance_angstrom": round(hb.distance, 3),
941
+ "angle_degrees": round(math.degrees(hb.angle), 1),
942
+ "donor_acceptor_distance_angstrom": round(hb.donor_acceptor_distance, 3),
943
+ "bond_type": hb.bond_type,
944
+ "backbone_sidechain_interaction": hb.get_backbone_sidechain_interaction(),
945
+ "donor_acceptor_properties": hb.donor_acceptor_properties
946
+ })
947
+ with open(hb_file, 'w', encoding='utf-8') as jsonfile:
948
+ json.dump(data, jsonfile, indent=2, ensure_ascii=False)
949
+
950
+ # Export halogen bonds
951
+ if analyzer.halogen_bonds:
952
+ xb_file = directory / f"{base_name}_x_bonds.json"
953
+ data = {
954
+ "metadata": {
955
+ "input_file": input_file,
956
+ "analysis_engine": "HBAT",
957
+ "version": __version__,
958
+ "interaction_type": "Halogen Bonds"
959
+ },
960
+ "interactions": []
961
+ }
962
+ for xb in analyzer.halogen_bonds:
963
+ data["interactions"].append({
964
+ "halogen_residue": xb.halogen_residue,
965
+ "halogen_atom": xb.halogen.name,
966
+ "acceptor_residue": xb.acceptor_residue,
967
+ "acceptor_atom": xb.acceptor.name,
968
+ "distance_angstrom": round(xb.distance, 3),
969
+ "angle_degrees": round(math.degrees(xb.angle), 1),
970
+ "bond_type": xb.bond_type,
971
+ "backbone_sidechain_interaction": xb.get_backbone_sidechain_interaction(),
972
+ "donor_acceptor_properties": xb.donor_acceptor_properties
973
+ })
974
+ with open(xb_file, 'w', encoding='utf-8') as jsonfile:
975
+ json.dump(data, jsonfile, indent=2, ensure_ascii=False)
976
+
977
+ # Export π interactions
978
+ if analyzer.pi_interactions:
979
+ pi_file = directory / f"{base_name}_pi_interactions.json"
980
+ data = {
981
+ "metadata": {
982
+ "input_file": input_file,
983
+ "analysis_engine": "HBAT",
984
+ "version": __version__,
985
+ "interaction_type": "Pi Interactions"
986
+ },
987
+ "interactions": []
988
+ }
989
+ for pi in analyzer.pi_interactions:
990
+ data["interactions"].append({
991
+ "donor_residue": pi.donor_residue,
992
+ "donor_atom": pi.donor.name,
993
+ "hydrogen_atom": pi.hydrogen.name,
994
+ "pi_residue": pi.pi_residue,
995
+ "distance_angstrom": round(pi.distance, 3),
996
+ "angle_degrees": round(math.degrees(pi.angle), 1),
997
+ "backbone_sidechain_interaction": pi.get_backbone_sidechain_interaction(),
998
+ "donor_acceptor_properties": pi.donor_acceptor_properties
999
+ })
1000
+ with open(pi_file, 'w', encoding='utf-8') as jsonfile:
1001
+ json.dump(data, jsonfile, indent=2, ensure_ascii=False)
1002
+
1003
+ # Export cooperativity chains
1004
+ if analyzer.cooperativity_chains:
1005
+ chains_file = directory / f"{base_name}_cooperativity_chains.json"
1006
+ data = {
1007
+ "metadata": {
1008
+ "input_file": input_file,
1009
+ "analysis_engine": "HBAT",
1010
+ "version": __version__,
1011
+ "interaction_type": "Cooperativity Chains"
1012
+ },
1013
+ "chains": []
1014
+ }
1015
+ for i, chain in enumerate(analyzer.cooperativity_chains):
1016
+ chain_data = {
1017
+ "chain_id": i + 1,
1018
+ "chain_length": chain.chain_length,
1019
+ "chain_type": chain.chain_type,
1020
+ "interactions": []
1021
+ }
1022
+ for interaction in chain.interactions:
1023
+ interaction_data = {
1024
+ "donor_residue": interaction.get_donor_residue(),
1025
+ "acceptor_residue": interaction.get_acceptor_residue(),
1026
+ "interaction_type": interaction.get_interaction_type()
1027
+ }
1028
+ donor_atom = interaction.get_donor_atom()
1029
+ if donor_atom:
1030
+ interaction_data["donor_atom"] = donor_atom.name
1031
+ acceptor_atom = interaction.get_acceptor_atom()
1032
+ if acceptor_atom:
1033
+ interaction_data["acceptor_atom"] = acceptor_atom.name
1034
+ chain_data["interactions"].append(interaction_data)
1035
+ data["chains"].append(chain_data)
1036
+ with open(chains_file, 'w', encoding='utf-8') as jsonfile:
1037
+ json.dump(data, jsonfile, indent=2, ensure_ascii=False)
1038
+
1039
+
777
1040
  def export_to_csv(analyzer: NPMolecularInteractionAnalyzer, output_file: str) -> None:
778
1041
  """Export results to CSV format.
779
1042
 
@@ -842,6 +1105,8 @@ def export_to_csv(analyzer: NPMolecularInteractionAnalyzer, output_file: str) ->
842
1105
  "Distance_A",
843
1106
  "Angle_deg",
844
1107
  "Bond_Type",
1108
+ "D-A_Properties",
1109
+ "B/S",
845
1110
  ]
846
1111
  )
847
1112
 
@@ -855,6 +1120,8 @@ def export_to_csv(analyzer: NPMolecularInteractionAnalyzer, output_file: str) ->
855
1120
  f"{xb.distance:.3f}",
856
1121
  f"{math.degrees(xb.angle):.1f}",
857
1122
  xb.bond_type,
1123
+ xb.donor_acceptor_properties,
1124
+ xb.get_backbone_sidechain_interaction(),
858
1125
  ]
859
1126
  )
860
1127
  writer.writerow([]) # Empty row
@@ -890,6 +1157,23 @@ def export_to_csv(analyzer: NPMolecularInteractionAnalyzer, output_file: str) ->
890
1157
  pi.get_backbone_sidechain_interaction(),
891
1158
  ]
892
1159
  )
1160
+ writer.writerow([]) # Empty row
1161
+
1162
+ # Cooperativity chains section
1163
+ if analyzer.cooperativity_chains:
1164
+ writer.writerow(["# Cooperativity Chains"])
1165
+ writer.writerow(["Chain_ID", "Chain_Length", "Chain_Type", "Interactions"])
1166
+
1167
+ for i, chain in enumerate(analyzer.cooperativity_chains):
1168
+ interactions_str = " -> ".join(
1169
+ [
1170
+ f"{interaction.get_donor_residue()}({interaction.get_donor_atom().name if interaction.get_donor_atom() else '?'})"
1171
+ for interaction in chain.interactions
1172
+ ]
1173
+ )
1174
+ writer.writerow(
1175
+ [i + 1, chain.chain_length, chain.chain_type, interactions_str]
1176
+ )
893
1177
 
894
1178
 
895
1179
  def run_analysis(args: argparse.Namespace) -> int:
@@ -987,17 +1271,29 @@ def run_analysis(args: argparse.Namespace) -> int:
987
1271
 
988
1272
  # Output results
989
1273
  if args.output:
990
- print_progress(f"Writing results to {args.output}", verbose)
991
- with open(args.output, "w") as f:
992
- f.write(format_results_text(analyzer, args.input, args.summary_only))
1274
+ try:
1275
+ output_format = detect_output_format(args.output)
1276
+ if output_format == 'text':
1277
+ print_progress(f"Writing results to {args.output}", verbose)
1278
+ with open(args.output, "w") as f:
1279
+ f.write(format_results_text(analyzer, args.input, args.summary_only))
1280
+ elif output_format == 'csv':
1281
+ print_progress(f"Exporting to CSV: {args.output}", verbose)
1282
+ export_to_csv(analyzer, args.output)
1283
+ elif output_format == 'json':
1284
+ print_progress(f"Exporting to JSON: {args.output}", verbose)
1285
+ export_to_json(analyzer, args.input, args.output)
1286
+ except ValueError as e:
1287
+ print_error(str(e))
1288
+ return 1
993
1289
 
994
1290
  if args.json:
995
- print_progress(f"Exporting to JSON: {args.json}", verbose)
996
- export_to_json(analyzer, args.input, args.json)
1291
+ print_progress(f"Exporting to multiple JSON files: {args.json}", verbose)
1292
+ export_to_json_files(analyzer, args.json, args.input)
997
1293
 
998
1294
  if args.csv:
999
- print_progress(f"Exporting to CSV: {args.csv}", verbose)
1000
- export_to_csv(analyzer, args.csv)
1295
+ print_progress(f"Exporting to multiple CSV files: {args.csv}", verbose)
1296
+ export_to_csv_files(analyzer, args.csv)
1001
1297
 
1002
1298
  # Print to stdout if no output files specified
1003
1299
  if not any([args.output, args.json, args.csv]) and not args.quiet:
@@ -122,6 +122,7 @@ tests/conftest.py
122
122
  tests/run_tests.py
123
123
  tests/cli/__init__.py
124
124
  tests/cli/test_cli_main.py
125
+ tests/cli/test_cli_output_formats.py
125
126
  tests/e2e/__init__.py
126
127
  tests/e2e/test_cli_workflows.py
127
128
  tests/e2e/test_complete_workflows.py