jaxprotsasa 1.4.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 (172) hide show
  1. jaxprotsasa-1.4.0/MANIFEST.in +7 -0
  2. jaxprotsasa-1.4.0/PKG-INFO +336 -0
  3. jaxprotsasa-1.4.0/README.md +286 -0
  4. jaxprotsasa-1.4.0/constraints/jax-0.8.0.txt +4 -0
  5. jaxprotsasa-1.4.0/docs/algorithms.md +374 -0
  6. jaxprotsasa-1.4.0/docs/api.md +1046 -0
  7. jaxprotsasa-1.4.0/docs/architecture.md +213 -0
  8. jaxprotsasa-1.4.0/docs/bulk.md +330 -0
  9. jaxprotsasa-1.4.0/docs/credits.md +30 -0
  10. jaxprotsasa-1.4.0/docs/documentation.md +116 -0
  11. jaxprotsasa-1.4.0/docs/dsasa.md +487 -0
  12. jaxprotsasa-1.4.0/docs/dsasa_1l2y_validation.json +502 -0
  13. jaxprotsasa-1.4.0/docs/dsasa_1ubq_validation.json +206 -0
  14. jaxprotsasa-1.4.0/docs/dsasa_4hhb_validation.json +206 -0
  15. jaxprotsasa-1.4.0/docs/dsasa_implementation.md +263 -0
  16. jaxprotsasa-1.4.0/docs/dsasa_jax_1l2y_validation.json +13229 -0
  17. jaxprotsasa-1.4.0/docs/dsasa_jax_1ubq_validation.json +3144 -0
  18. jaxprotsasa-1.4.0/docs/dsasa_jax_4hhb_validation.json +18163 -0
  19. jaxprotsasa-1.4.0/docs/dsasa_mathematics.md +309 -0
  20. jaxprotsasa-1.4.0/docs/dsasa_native_review.json +4935 -0
  21. jaxprotsasa-1.4.0/docs/dsasa_performance.md +384 -0
  22. jaxprotsasa-1.4.0/docs/examples.md +152 -0
  23. jaxprotsasa-1.4.0/docs/grids.md +194 -0
  24. jaxprotsasa-1.4.0/docs/hpc.md +371 -0
  25. jaxprotsasa-1.4.0/docs/images/README.md +112 -0
  26. jaxprotsasa-1.4.0/docs/images/dsasa-paper-figure-1.png +0 -0
  27. jaxprotsasa-1.4.0/docs/images/dsasa-paper-figure-2.png +0 -0
  28. jaxprotsasa-1.4.0/docs/images/lr-concept-v2.png +0 -0
  29. jaxprotsasa-1.4.0/docs/images/lr-sampling-grid.png +0 -0
  30. jaxprotsasa-1.4.0/docs/images/sasa-sphere-grids.png +0 -0
  31. jaxprotsasa-1.4.0/docs/images/sr-concept-v2.png +0 -0
  32. jaxprotsasa-1.4.0/docs/images/tessellation-concept-v2.png +0 -0
  33. jaxprotsasa-1.4.0/docs/index.md +149 -0
  34. jaxprotsasa-1.4.0/docs/installation.md +223 -0
  35. jaxprotsasa-1.4.0/docs/literature.md +80 -0
  36. jaxprotsasa-1.4.0/docs/performance.md +250 -0
  37. jaxprotsasa-1.4.0/docs/quickstart.md +631 -0
  38. jaxprotsasa-1.4.0/docs/radii.md +150 -0
  39. jaxprotsasa-1.4.0/docs/references.md +63 -0
  40. jaxprotsasa-1.4.0/docs/usage.md +689 -0
  41. jaxprotsasa-1.4.0/docs/validation.md +190 -0
  42. jaxprotsasa-1.4.0/examples/README.md +106 -0
  43. jaxprotsasa-1.4.0/examples/array_sasa.py +59 -0
  44. jaxprotsasa-1.4.0/examples/hpc.slurm +41 -0
  45. jaxprotsasa-1.4.0/examples/trajectories.json +15 -0
  46. jaxprotsasa-1.4.0/examples/trajectory_sasa.py +81 -0
  47. jaxprotsasa-1.4.0/jaxprotsasa/__init__.py +105 -0
  48. jaxprotsasa-1.4.0/jaxprotsasa/__main__.py +7 -0
  49. jaxprotsasa-1.4.0/jaxprotsasa/check_backend.py +204 -0
  50. jaxprotsasa-1.4.0/jaxprotsasa/cli.py +133 -0
  51. jaxprotsasa-1.4.0/jaxprotsasa/data/README.md +15 -0
  52. jaxprotsasa-1.4.0/jaxprotsasa/data/healpix_192.npy +0 -0
  53. jaxprotsasa-1.4.0/jaxprotsasa/data/healpix_192_weights.npy +0 -0
  54. jaxprotsasa-1.4.0/jaxprotsasa/data/icosahedron_162.npy +0 -0
  55. jaxprotsasa-1.4.0/jaxprotsasa/data/icosahedron_162_weights.npy +0 -0
  56. jaxprotsasa-1.4.0/jaxprotsasa/data/icosahedron_42.npy +0 -0
  57. jaxprotsasa-1.4.0/jaxprotsasa/data/icosahedron_42_weights.npy +0 -0
  58. jaxprotsasa-1.4.0/jaxprotsasa/data/sha256.json +8 -0
  59. jaxprotsasa-1.4.0/jaxprotsasa/execution/__init__.py +23 -0
  60. jaxprotsasa-1.4.0/jaxprotsasa/execution/analysis_arguments.py +67 -0
  61. jaxprotsasa-1.4.0/jaxprotsasa/execution/analysis_commands.py +185 -0
  62. jaxprotsasa-1.4.0/jaxprotsasa/execution/arguments.py +296 -0
  63. jaxprotsasa-1.4.0/jaxprotsasa/execution/batch.py +489 -0
  64. jaxprotsasa-1.4.0/jaxprotsasa/execution/dsasa.py +86 -0
  65. jaxprotsasa-1.4.0/jaxprotsasa/execution/hpc.py +469 -0
  66. jaxprotsasa-1.4.0/jaxprotsasa/execution/resources.py +487 -0
  67. jaxprotsasa-1.4.0/jaxprotsasa/execution/workflows.py +69 -0
  68. jaxprotsasa-1.4.0/jaxprotsasa/io/__init__.py +21 -0
  69. jaxprotsasa-1.4.0/jaxprotsasa/io/atlas.py +79 -0
  70. jaxprotsasa-1.4.0/jaxprotsasa/io/topology.py +162 -0
  71. jaxprotsasa-1.4.0/jaxprotsasa/io/trajectory.py +275 -0
  72. jaxprotsasa-1.4.0/jaxprotsasa/msm/__init__.py +69 -0
  73. jaxprotsasa-1.4.0/jaxprotsasa/msm/cavity.py +266 -0
  74. jaxprotsasa-1.4.0/jaxprotsasa/msm/clustering.py +341 -0
  75. jaxprotsasa-1.4.0/jaxprotsasa/msm/comparison.py +272 -0
  76. jaxprotsasa-1.4.0/jaxprotsasa/msm/estimators.py +123 -0
  77. jaxprotsasa-1.4.0/jaxprotsasa/msm/models.py +176 -0
  78. jaxprotsasa-1.4.0/jaxprotsasa/msm/observables.py +89 -0
  79. jaxprotsasa-1.4.0/jaxprotsasa/msm/tpt.py +135 -0
  80. jaxprotsasa-1.4.0/jaxprotsasa/msm/transitions.py +89 -0
  81. jaxprotsasa-1.4.0/jaxprotsasa/msm/umap.py +247 -0
  82. jaxprotsasa-1.4.0/jaxprotsasa/msm/validation.py +153 -0
  83. jaxprotsasa-1.4.0/jaxprotsasa/pocket/__init__.py +53 -0
  84. jaxprotsasa-1.4.0/jaxprotsasa/pocket/accessibility.py +234 -0
  85. jaxprotsasa-1.4.0/jaxprotsasa/pocket/analysis.py +306 -0
  86. jaxprotsasa-1.4.0/jaxprotsasa/pocket/cavity.py +210 -0
  87. jaxprotsasa-1.4.0/jaxprotsasa/pocket/components.py +105 -0
  88. jaxprotsasa-1.4.0/jaxprotsasa/pocket/concavity.py +386 -0
  89. jaxprotsasa-1.4.0/jaxprotsasa/pocket/grid.py +311 -0
  90. jaxprotsasa-1.4.0/jaxprotsasa/pocket/regions.py +153 -0
  91. jaxprotsasa-1.4.0/jaxprotsasa/pocket/surface.py +347 -0
  92. jaxprotsasa-1.4.0/jaxprotsasa/pocket/tracking.py +287 -0
  93. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/__init__.py +44 -0
  94. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/_kernel_validation.py +35 -0
  95. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/__init__.py +33 -0
  96. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/__init__.py +8 -0
  97. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/alpha_complex.py +89 -0
  98. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/api.py +328 -0
  99. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/areas.py +55 -0
  100. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/geometry.py +104 -0
  101. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/jax_alpha.py +323 -0
  102. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/jax_triangulation.py +459 -0
  103. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/jax_validation.py +357 -0
  104. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/regular_triangulation.py +112 -0
  105. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/dsasa/trajectory.py +598 -0
  106. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/analytical/lee_richards.py +169 -0
  107. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/api.py +661 -0
  108. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/bulk.py +175 -0
  109. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/calculator.py +201 -0
  110. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/cell_list.py +299 -0
  111. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/constants.py +73 -0
  112. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/grid_catalog.py +40 -0
  113. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/grids.py +68 -0
  114. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/host_neighbors.py +40 -0
  115. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/kernels.py +16 -0
  116. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/memory_plan.py +167 -0
  117. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/neighbor_cache.py +76 -0
  118. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/neighbour_list.py +111 -0
  119. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/numerical/__init__.py +10 -0
  120. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/numerical/sampling.py +262 -0
  121. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/results.py +229 -0
  122. jaxprotsasa-1.4.0/jaxprotsasa/surface_area/trajectory.py +155 -0
  123. jaxprotsasa-1.4.0/jaxprotsasa/utils.py +161 -0
  124. jaxprotsasa-1.4.0/jaxprotsasa.egg-info/PKG-INFO +336 -0
  125. jaxprotsasa-1.4.0/jaxprotsasa.egg-info/SOURCES.txt +249 -0
  126. jaxprotsasa-1.4.0/jaxprotsasa.egg-info/dependency_links.txt +1 -0
  127. jaxprotsasa-1.4.0/jaxprotsasa.egg-info/entry_points.txt +3 -0
  128. jaxprotsasa-1.4.0/jaxprotsasa.egg-info/requires.txt +51 -0
  129. jaxprotsasa-1.4.0/jaxprotsasa.egg-info/top_level.txt +2 -0
  130. jaxprotsasa-1.4.0/jpsa/__init__.py +59 -0
  131. jaxprotsasa-1.4.0/jpsa/__main__.py +7 -0
  132. jaxprotsasa-1.4.0/pyproject.toml +71 -0
  133. jaxprotsasa-1.4.0/setup.cfg +4 -0
  134. jaxprotsasa-1.4.0/tests/test_alias_reload.py +45 -0
  135. jaxprotsasa-1.4.0/tests/test_atlas_umap.py +62 -0
  136. jaxprotsasa-1.4.0/tests/test_batch_memory.py +355 -0
  137. jaxprotsasa-1.4.0/tests/test_cli.py +413 -0
  138. jaxprotsasa-1.4.0/tests/test_cli_named_inputs.py +165 -0
  139. jaxprotsasa-1.4.0/tests/test_cli_terms.py +70 -0
  140. jaxprotsasa-1.4.0/tests/test_configure_resources.py +428 -0
  141. jaxprotsasa-1.4.0/tests/test_cpu_affinity.py +190 -0
  142. jaxprotsasa-1.4.0/tests/test_device_reconfiguration.py +233 -0
  143. jaxprotsasa-1.4.0/tests/test_dsasa_alpha.py +81 -0
  144. jaxprotsasa-1.4.0/tests/test_dsasa_geometry.py +251 -0
  145. jaxprotsasa-1.4.0/tests/test_dsasa_jax_alpha.py +130 -0
  146. jaxprotsasa-1.4.0/tests/test_dsasa_jax_integration.py +114 -0
  147. jaxprotsasa-1.4.0/tests/test_dsasa_jax_triangulation.py +127 -0
  148. jaxprotsasa-1.4.0/tests/test_dsasa_jax_validation.py +243 -0
  149. jaxprotsasa-1.4.0/tests/test_dsasa_lifting.py +37 -0
  150. jaxprotsasa-1.4.0/tests/test_dsasa_memory.py +166 -0
  151. jaxprotsasa-1.4.0/tests/test_dsasa_resource_configuration.py +173 -0
  152. jaxprotsasa-1.4.0/tests/test_dsasa_trajectory.py +209 -0
  153. jaxprotsasa-1.4.0/tests/test_grid_catalog.py +129 -0
  154. jaxprotsasa-1.4.0/tests/test_method_organization.py +59 -0
  155. jaxprotsasa-1.4.0/tests/test_molecular_run_output.py +80 -0
  156. jaxprotsasa-1.4.0/tests/test_package_alias.py +223 -0
  157. jaxprotsasa-1.4.0/tests/test_resource_inheritance.py +109 -0
  158. jaxprotsasa-1.4.0/tests/test_runner_memory.py +223 -0
  159. jaxprotsasa-1.4.0/tests/test_sasa_memory_plan.py +102 -0
  160. jaxprotsasa-1.4.0/tests/test_sasa_overflow_recovery.py +84 -0
  161. jaxprotsasa-1.4.0/tests/test_saved_grid_sasa.py +179 -0
  162. jaxprotsasa-1.4.0/tests/test_spiral_sampling.py +99 -0
  163. jaxprotsasa-1.4.0/tools/benchmark_dsasa.py +235 -0
  164. jaxprotsasa-1.4.0/tools/benchmark_neighbor_reuse.py +106 -0
  165. jaxprotsasa-1.4.0/tools/benchmark_sasa.py +115 -0
  166. jaxprotsasa-1.4.0/tools/check_grids.py +45 -0
  167. jaxprotsasa-1.4.0/tools/check_sr_accuracy_outputs.py +87 -0
  168. jaxprotsasa-1.4.0/tools/plot_grids.py +162 -0
  169. jaxprotsasa-1.4.0/tools/prototype_weighted_lifting.py +74 -0
  170. jaxprotsasa-1.4.0/tools/validate_dsasa.py +155 -0
  171. jaxprotsasa-1.4.0/tools/validate_dsasa_jax.py +292 -0
  172. jaxprotsasa-1.4.0/tools/validate_sr_accuracy.py +310 -0
@@ -0,0 +1,7 @@
1
+ include README.md
2
+ recursive-include constraints *.txt
3
+ recursive-include docs *.md *.png
4
+ include docs/dsasa_*_validation.json
5
+ include docs/dsasa_native_review.json
6
+ recursive-include examples *.py *.md *.json *.slurm
7
+ recursive-include tools *.py
@@ -0,0 +1,336 @@
1
+ Metadata-Version: 2.4
2
+ Name: jaxprotsasa
3
+ Version: 1.4.0
4
+ Summary: JAX solvent-accessible surface areas, surface samples, pockets, and Markov state models
5
+ Keywords: sasa,molecular-dynamics,surface-area,jax,protein,pocket
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3 :: Only
8
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
9
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: jax>=0.8.0
13
+ Requires-Dist: numpy>=2.0
14
+ Requires-Dist: scipy>=1.13
15
+ Requires-Dist: MDAnalysis>=2.8
16
+ Requires-Dist: h5py>=3.11
17
+ Provides-Extra: cpu
18
+ Requires-Dist: jax>=0.8.0; extra == "cpu"
19
+ Provides-Extra: cuda
20
+ Requires-Dist: jax[cuda13]>=0.8.0; extra == "cuda"
21
+ Provides-Extra: rocm
22
+ Requires-Dist: jax[rocm7]>=0.12.0; extra == "rocm"
23
+ Provides-Extra: tpu
24
+ Requires-Dist: jax[tpu]>=0.8.0; extra == "tpu"
25
+ Provides-Extra: gudhi
26
+ Requires-Dist: gudhi>=3.10; extra == "gudhi"
27
+ Provides-Extra: umap
28
+ Requires-Dist: umap-learn>=0.6; extra == "umap"
29
+ Requires-Dist: scikit-learn>=1.6; extra == "umap"
30
+ Requires-Dist: matplotlib>=3.8; extra == "umap"
31
+ Provides-Extra: cuda12
32
+ Requires-Dist: jax[cuda12]>=0.8.0; extra == "cuda12"
33
+ Provides-Extra: cuda13
34
+ Requires-Dist: jax[cuda13]>=0.8.0; extra == "cuda13"
35
+ Provides-Extra: rocm7
36
+ Requires-Dist: jax[rocm7]>=0.8.0; extra == "rocm7"
37
+ Provides-Extra: rocm10
38
+ Requires-Dist: jax[rocm10]>=0.8.0; extra == "rocm10"
39
+ Provides-Extra: dsasa
40
+ Requires-Dist: gudhi>=3.10; extra == "dsasa"
41
+ Provides-Extra: test
42
+ Requires-Dist: pytest>=8; extra == "test"
43
+ Requires-Dist: gudhi>=3.10; extra == "test"
44
+ Provides-Extra: dev
45
+ Requires-Dist: build>=1; extra == "dev"
46
+ Requires-Dist: pytest>=8; extra == "dev"
47
+ Requires-Dist: MDAnalysis>=2.8; extra == "dev"
48
+ Requires-Dist: gudhi>=3.10; extra == "dev"
49
+ Requires-Dist: h5py>=3.11; extra == "dev"
50
+
51
+ # JAX SASA
52
+
53
+ Calculate solvent-accessible surface area (SASA) for proteins, ligands, and molecular trajectories with JAX. Read atom, residue, component, and system areas from a PDB structure or a matching topology and trajectory.
54
+
55
+ Use this library to identify exposed residues, follow exposure changes through
56
+ a simulation, or compare a ligand on its own with the same ligand in a protein
57
+ complex. It combines molecular-file loading, several SASA methods, annotated
58
+ outputs, and bulk processing in one Python and command-line workflow. JAX
59
+ compiles the numerical calculations for the selected device. A CPU is enough
60
+ to get started. SASA describes exposure and does not by itself give binding energy.
61
+
62
+ Choose Shrake–Rupley or tessellation for surface sampling, Lee–Richards for slice integration, or dSASA for analytical surface formulas. dSASA can also stream a long trajectory to an HDF5 file. The package includes surface-point export, pocket analysis, and Markov state model (MSM) workflows.
63
+
64
+ The repository, Python package, and installed command are named `jaxprotsasa`. The command `jpsa` is an installed alias for `jaxprotsasa`. Both accept the same subcommands and options, with no shell alias setup. Examples use `jpsa` for commands and `import jaxprotsasa as jpsa` in Python. The `jpsa` import alias also supports nested modules. Lengths are in **angstroms (Å)**, areas in **Ų**.
65
+
66
+ For notebook installation and import troubleshooting, see the
67
+ [Google Colab instructions](docs/installation.md#google-colab).
68
+
69
+ ```python
70
+ import jaxprotsasa as jpsa
71
+ ```
72
+
73
+ Start with the [quickstart](docs/quickstart.md) to load a PDB or trajectory and calculate atom/residue SASA. Follow the [command-line tutorial](docs/usage.md) for terminal examples, the [API reference](docs/api.md) for Python parameters, or the [HPC guide](docs/hpc.md) for CPU/GPU batch allocations and RAM planning.
74
+
75
+ ## Install
76
+
77
+ From the repository root, in an activated Python 3.11+ environment:
78
+
79
+ ```sh
80
+ # CPU and molecular-file support.
81
+ python -m pip install '.[cpu]'
82
+ jpsa hpc-check --runtime cpu
83
+ ```
84
+
85
+ For a fresh NVIDIA environment, install `.[cuda]` with a compatible driver and GPU. AMD users should follow the [ROCm installation instructions](docs/installation.md#amd-gpus-rocm), including the path for an existing cluster-provided JAX stack. The [installation guide](docs/installation.md) covers all runtime extras, editable installs, and environment checks.
86
+
87
+ ### Hardware compatibility
88
+
89
+ | Hardware | Runtime and library scope |
90
+ | --- | --- |
91
+ | CPU | The JAX CPU path is implemented and has recorded checks and examples. |
92
+ | NVIDIA GPU | The GPU path uses JAX with CUDA. Select devices with `--gpus` or `--gpu-ids`. Physical NVIDIA validation is not recorded here. |
93
+ | AMD GPU | The GPU path uses a compatible JAX ROCm stack and the same GPU options. Physical AMD validation is not recorded here. |
94
+ | Google Cloud TPU | Install `.[tpu]` and call `configure_resources(cpus=2, tpus=1)` before numerical imports. Python resource selection is implemented. Physical TPU validation is not recorded here. |
95
+
96
+ See the [overview compatibility table](docs/index.md#cpu-gpu-and-tpu-compatibility)
97
+ and [TPU setup notes](docs/installation.md#google-cloud-tpu-experimental-python-path).
98
+ JAX runtime support does not certify every workflow on that hardware.
99
+ Molecular file I/O and GUDHI geometry remain host CPU tasks.
100
+
101
+ ## Choose a SASA method
102
+
103
+ | Family | Method | Geometry and usage |
104
+ | --- | --- | --- |
105
+ | Analytical | Lee–Richards (`lr`) | Analytical circle-arc unions within slices. `n_slices` controls the remaining numerical height integration |
106
+ | Analytical | dSASA (`calculate_dsasa`) | Weighted regular triangulation, alpha-complex classification and analytical areas. CPU reference or experimental native JAX geometry |
107
+ | Numerical | Shrake–Rupley (`sr`) | Exposed saved or spiral sphere samples and solid-angle weights |
108
+ | Numerical | Tessellation (`tessellation`) | Compatibility alias for the same point quadrature as SR. No exact surface-mesh clipping |
109
+
110
+ Method-family imports live in `jaxprotsasa.surface_area.analytical` and `jaxprotsasa.surface_area.numerical`. Existing top-level imports remain supported. LR's `exact` mode describes its slice arcs. dSASA analytically evaluates the three-dimensional union of balls. See [algorithms](docs/algorithms.md).
111
+
112
+ ### Analytical dSASA: arrays and long trajectories
113
+
114
+ ```sh
115
+ python -m pip install '.[cpu,gudhi]'
116
+ ```
117
+
118
+ ```python
119
+ import numpy as np
120
+ import jaxprotsasa as jpsa
121
+
122
+ result = jpsa.calculate_dsasa(
123
+ np.array([[0., 0., 0.], [3., 0., 0.]]),
124
+ np.array([1.70, 1.55]),
125
+ probe_radius=1.4,
126
+ backend="gudhi",
127
+ )
128
+ print(result.atom_sasa, result.total_sasa) # Ų
129
+
130
+ summary = jpsa.process_dsasa_trajectory(
131
+ "system.tpr", "trajectory.xtc",
132
+ selection="protein", batch_size=32, output="dsasa.h5",
133
+ )
134
+ print(summary)
135
+ ```
136
+
137
+ The trajectory processor removes hydrogens using element/topology metadata and uses C/N/O/S radii matching the paper. Supply explicit radii for other elements. It streams frames to HDF5, preserves frame/time identities, and supports restart. Prepare whole, consistently imaged molecules for this nonperiodic calculation. Start with the [analytical dSASA guide](docs/dsasa.md), then see [detailed usage](docs/usage.md#analytical-dsasa) for derivatives, batching, restart, and reading output.
138
+
139
+ For native JAX geometry on one GPU:
140
+
141
+ ```sh
142
+ jpsa dsasa --topology system.tpr --traj trajectory.xtc --output dsasa-jax.h5 \
143
+ --geometry-backend jax --gpus 1 --incremental \
144
+ --geometry-fallback error --batch-size 32
145
+ ```
146
+
147
+ `backend="jax"` builds and validates the sphere-overlap geometry with JAX, then evaluates analytical areas. It can reuse connections between frames after checking them against the current coordinates. If its float64 geometry tests cannot resolve a case, the default fallback rebuilds that frame through CPU GUDHI/CGAL. `--geometry-fallback error` raises instead. This backend is experimental and has been tested on CPU. Physical GPU execution and throughput remain unmeasured. See [JAX geometry usage](docs/usage.md#native-jax-geometry-on-a-gpu), the [implementation guide](docs/dsasa_implementation.md), and the [benchmark guide](docs/dsasa_performance.md).
148
+
149
+ ## Command line
150
+
151
+ The command line provides SASA, trajectory streaming, pocket, and state-model workflows:
152
+
153
+ ```sh
154
+ # One static structure: supply the PDB once (-i and -o are the short names).
155
+ jpsa surf --pdb protein.pdb --output pdb_results --cpus 2 --gpus 0
156
+
157
+ # Selected molecular system defaults to two CPUs and no GPU.
158
+ jpsa surf --pdb system.pdb --traj trajectory.xtc --output sasa_results \
159
+ --selection "protein or resname LIG" --ligand-selection "resname LIG" \
160
+ --method tessellation --grid healpix_192 --save-points
161
+
162
+ # Share work across explicitly requested devices or several trajectories.
163
+ jpsa hpc --input examples/trajectories.json --output batch_results \
164
+ --gpus 2 --cpus 8 --include-cpu
165
+
166
+ # Estimate a state model from an integer NPY label trajectory.
167
+ jpsa msm labels.npy model_results --lag 1
168
+
169
+ # Analyze probe pockets in the first array frame.
170
+ jpsa pocket coordinates.npy radii.npy pocket_results
171
+ ```
172
+
173
+ `-i`/`--pdb`/`--topology` chooses the structure or topology, optional
174
+ `-x`/`--traj` adds trajectory frames, and `-o`/`--output` names the new output.
175
+ For a GROMACS trajectory, use `--topology system.tpr --traj trajectory.xtc`.
176
+ The [quickstart](docs/quickstart.md) includes ligand selections, CPU/GPU/mixed
177
+ Python setups, and expected outputs for each example.
178
+
179
+ Molecular `surf` writes `atom_sasa.npy`, `residue_sasa.npy`,
180
+ `component_sasa.npy`, `system_sasa.npy`, matching `*_info.npy` annotations,
181
+ frame IDs/times, and `metadata.json`. Shapes are `(frames, atoms)`,
182
+ `(frames, residues)`, and `(frames, components)`. A single-model PDB has one row.
183
+ With `--save-points`, `surface/` contains positions and exposure masks.
184
+ `hpc` writes one such folder per input and a root `batch.json`. `dsasa` writes
185
+ the separate HDF5 schema. See [all output formats](docs/usage.md#saved-results).
186
+
187
+ The `surf`, `hpc`, `msm`, and `pocket` commands default to **CPU only with two host CPUs**. Set the CPU limit with `--cpus N` or `--ncpus N`. `--gpus N` requests N visible GPUs, and bare `--gpus` requests one. `surf` processes one trajectory or coordinate array using CPU-only or GPU-only calculation. `hpc` requires an input file with at least two molecular trajectories and shares the calculation across selected CPUs or GPUs. `msm` and `pocket` currently use at most one GPU. Choose either a GPU count or a GPU ID list. CPUs always support host work. `--include-cpu` is available only in `hpc` to add CPU calculation workers to a GPU batch. These flags select within an existing allocation.
188
+
189
+ Run `jpsa COMMAND --help` for options. See the [command aliases](docs/usage.md#command-aliases). `jaxprotsasa COMMAND`, `python -m jaxprotsasa COMMAND`, and `python -m jpsa COMMAND` provide the same interface. `jpsa hpc-check --runtime cuda` or `--runtime rocm` tests an accelerator installation. Follow the [PDB and TPR/XTC command-line tutorial](docs/usage.md) or look up the [Python API reference](docs/api.md).
190
+
191
+ ### ATLAS downloads and SASA clustering
192
+
193
+ ```sh
194
+ jpsa download-atlas 3a1g_B 3bpj_C --output atlas
195
+ jpsa download-atlas --from-file pdb_chains.txt --output atlas
196
+
197
+ python -m pip install '.[umap]'
198
+ jpsa umap sasa_results --output sasa_clusters
199
+ ```
200
+
201
+ The downloader saves and extracts ATLAS analysis bundles by PDB-chain ID and
202
+ reuses existing downloads. A text list takes one ID per line.
203
+ [ATLAS database paper](https://doi.org/10.1093/nar/gkad1084)
204
+
205
+ `jpsa umap` accepts a `surf` results folder or a SASA NPY file with at least
206
+ four frames. It uses a sibling `frame_indices.npy` when present. The new output
207
+ folder contains the embedding plot, frame assignments, representative frames,
208
+ and mean and estimated SASA vectors. [See the Python examples and output details](docs/api.md#atlas-downloads-and-sasa-clustering).
209
+
210
+ ## Python API
211
+
212
+ ```python
213
+ from jpsa.execution import configure_resources
214
+ configure_resources(cpus=2, gpus=0)
215
+
216
+ import jaxprotsasa as jpsa
217
+
218
+ trajectory = jpsa.TrajectoryData(
219
+ "system.pdb", "trajectory.xtc",
220
+ selection="protein or resname LIG",
221
+ ligand_selection="resname LIG",
222
+ radii_config="freesasa_reference",
223
+ )
224
+ result = jpsa.calculate_sasa(
225
+ trajectory,
226
+ save_path="python_results",
227
+ method="tessellation",
228
+ grid="healpix_192",
229
+ save_points=True,
230
+ )
231
+ print(result.system_sasa) # One total per frame.
232
+ print(result.component_info["label"]) # Labels for component area columns.
233
+ print(result.output_dir) # Folder for this run.
234
+ ```
235
+
236
+ `calculate_sasa` returns results in memory by default. Passing `save_path`
237
+ saves the result to disk. Reusing that path saves a separate numbered run
238
+ inside the folder.
239
+
240
+ Only selected atoms block one another's access to solvent. Selecting protein plus ligand measures the ligand's exposure in that complex. Selecting the ligand alone measures its isolated exposure. Python calls use the JAX environment already initialized by the program. The CLI's two-CPU policy is configured separately. [Usage](docs/usage.md#python-api) shows how to set resources before imports, work with arrays, and use device workers.
241
+
242
+ For a GPU run, choose the following setup in a **fresh process** instead of the CPU setup above. Configure CPU and GPU defaults together before importing numerical APIs:
243
+
244
+ ```python
245
+ from jpsa.execution import configure_resources
246
+
247
+ configure_resources(cpus=4, gpus=2) # Or: cpus=8, gpu_ids=[0, 2]
248
+ # Add include_cpu=True for CPU and GPU calculation workers together.
249
+
250
+ import jaxprotsasa as jpsa
251
+ ```
252
+
253
+ Use `calculate_sasa(..., parallel=True)`, `calculate_sasa_batch`, or
254
+ `sasa_parallel` to use the configured pool without repeating GPU selectors.
255
+ A serial calculation uses the first configured device. Use `gpus=0` for CPU
256
+ only. Settings apply within the existing allocation. GPU IDs are local runtime
257
+ hardware IDs, and GPU availability is checked when calculation begins. See
258
+ [complete resource examples](docs/quickstart.md#configure-cpu-and-gpu-resources-together).
259
+
260
+ ## Van der Waals Radii
261
+
262
+ The loader defaults to the package's **`freesasa_reference` element-radius table**. It preserves the effective radii used by the project's FreeSASA reference workflow. FreeSASA itself normally uses residue/atom-name ProtOr classification, which can assign different radii to atoms of the same element. Cite [Mitternacht, *FreeSASA* (2016)](https://doi.org/10.12688/f1000research.7931.1) and consult the [FreeSASA ProtOr configuration](https://github.com/mittinatten/freesasa/blob/master/share/protor.config) when comparing results.
263
+
264
+ MDAnalysis also publishes a different element-radius table. Loading a trajectory with MDAnalysis does not automatically select it here. Changing radii changes probe-expanded sphere areas and blocking of neighboring surfaces, so match the actual radii, probe, atom selection, and hydrogen treatment before comparing SASA. The [radii guide](docs/radii.md) lists the values, explains provenance and fallbacks, and shows how to supply MDAnalysis or custom radii.
265
+
266
+ ## Read and tune results
267
+
268
+ Molecular runs save atom, residue, component, and system areas alongside matching annotation tables. Reload them with `SASAResult.load("python_results", mmap_mode="r")`, or read the NPY arrays directly with `allow_pickle=False`. Surface points and exposure masks live in `surface/` when requested. Array CLI runs have a smaller file schema, described in [usage](docs/usage.md#saved-results).
269
+
270
+ SR defaults to the packaged `healpix_192` grid. Choose `icosahedron_42` or `icosahedron_162` with `grid`/`--grid`. Icosahedral areas use saved Voronoi weights. For Fibonacci spiral sampling, use `grid="spiral_points", n_points=962` with either SR or tessellation. See the [962-point examples](docs/grids.md#spiral-sampling-with-962-points).
271
+
272
+ SR, tessellation, and LR trajectory calculations cache compact nearby-atom edges by default (`neighbor_rebuild_interval=10`, `neighbor_skin=4.0` Å), rebuilding sooner when displacement requires it. These options are available in the SASA APIs and CLI. Distinguish **neighbor-list reuse** from **frame batching** (`frame_batch_size`). Benchmark interval 1 for small or rapidly moving systems. Scan overhead can outweigh saved discovery work. Larger frame batches can improve throughput while increasing memory. Neither setting has a universal best value. See [performance and window sizes](docs/performance.md).
273
+
274
+ ## Documentation
275
+
276
+ The guides are also configured as a searchable MkDocs site with light and dark
277
+ appearances. To preview them locally from the repository root (no JAX or GPU required):
278
+
279
+ ```sh
280
+ python3 -m venv .venv-docs
281
+ .venv-docs/bin/python -m pip install -r requirements-docs.txt
282
+ .venv-docs/bin/python -m mkdocs serve
283
+ ```
284
+
285
+ If the documentation dependencies are already installed in your project `.venv`,
286
+ run `.venv/bin/python -m mkdocs serve` instead. Use the same environment for
287
+ installation and MkDocs: a global `mkdocs` command can report missing `pymdownx`
288
+ even when `pymdown-extensions` is installed in a virtual environment. See
289
+ [environment troubleshooting](docs/documentation.md#missing-pymdownx-or-material-despite-installation).
290
+
291
+ See [the documentation](https://bkbonde.github.io/jaxprotsasa/) for more info.
292
+
293
+ | Guide | Contents |
294
+ | --- | --- |
295
+ | [Quickstart](docs/quickstart.md) | Load a PDB or trajectory. Calculate atom/residue SASA in Python and from the CLI. Try each method |
296
+ | [Installation](docs/installation.md) | CPU, NVIDIA CUDA, AMD ROCm, cluster stacks, package extras |
297
+ | [Command-line usage](docs/usage.md) | PDB and TPR/XTC tutorial, algorithm options, memory estimates, saved outputs |
298
+ | [Python API](docs/api.md) | Loading, calculation signatures, parameter defaults, and result objects |
299
+ | [Sampling grids](docs/grids.md) | SR/tessellation grid catalogue and images, LR sampling controls, and public grid APIs |
300
+ | [Bulk processing](docs/bulk.md) | Directories of PDBs, trajectory manifests, Python batches, and separate outputs |
301
+ | [Atomic radii](docs/radii.md) | Default table, FreeSASA/MDAnalysis differences, custom radii, citations |
302
+ | [SR accuracy validation](docs/validation.md) | Saved grids versus spiral-960 on six proteins, independent refined reference |
303
+ | [Performance](docs/performance.md) | Reuse windows, batching, memory, timing guidance |
304
+ | [Analytical dSASA](docs/dsasa.md) | Installation, arrays, native geometry, streaming, restart, and HDF5 output |
305
+ | [dSASA mathematics](docs/dsasa_mathematics.md) | Weighted geometry, analytical terms, equation-to-code mapping, derivatives |
306
+ | [dSASA implementation](docs/dsasa_implementation.md) | Component matrix, dependencies, delivered scope and limitations |
307
+ | [dSASA performance](docs/dsasa_performance.md) | Reproducible benchmarks, profiling, production validation requirements |
308
+ | [Algorithms](docs/algorithms.md) | SASA geometry, methods, numerical limits, pockets and MSMs |
309
+ | [Architecture](docs/architecture.md) | Module responsibilities, execution paths, data contracts |
310
+ | [GPU SASA literature](docs/literature.md) | Dated GPU methods catalog, foundational references, and bibliography downloads |
311
+ | [HPC](docs/hpc.md) | Device IDs, input files, Slurm, distributed ranks |
312
+ | [Examples](examples/README.md) | Runnable molecular and self-contained array examples |
313
+
314
+ Run the current `tests/` suite for available integration checks.
315
+
316
+ For development:
317
+
318
+ ```sh
319
+ python -m pip install -e '.[cpu,dev]'
320
+ python -m pytest -q
321
+ python -m build
322
+ ```
323
+
324
+ ## Credits and citation
325
+
326
+ Credits to [Pratik Patil](https://pra-ashok.github.io/CV/) and
327
+ [Bhushan Bonde](https://scholar.google.com/citations?user=O3hkOEUAAAAJ&hl=en).
328
+
329
+ If you use JAX SASA in your work, cite the GitHub repository and record the
330
+ software version, release tag, or commit used:
331
+
332
+ > Patil, Pratik, and Bhushan Bonde. *JAX SASA (jaxprotsasa).* GitHub repository.
333
+ > [bkbonde/jaxprotsasa](https://github.com/bkbonde/jaxprotsasa).
334
+
335
+ See [CITATION.cff](CITATION.cff) for citation metadata and the
336
+ [citation guide](docs/credits.md) for BibTeX.
@@ -0,0 +1,286 @@
1
+ # JAX SASA
2
+
3
+ Calculate solvent-accessible surface area (SASA) for proteins, ligands, and molecular trajectories with JAX. Read atom, residue, component, and system areas from a PDB structure or a matching topology and trajectory.
4
+
5
+ Use this library to identify exposed residues, follow exposure changes through
6
+ a simulation, or compare a ligand on its own with the same ligand in a protein
7
+ complex. It combines molecular-file loading, several SASA methods, annotated
8
+ outputs, and bulk processing in one Python and command-line workflow. JAX
9
+ compiles the numerical calculations for the selected device. A CPU is enough
10
+ to get started. SASA describes exposure and does not by itself give binding energy.
11
+
12
+ Choose Shrake–Rupley or tessellation for surface sampling, Lee–Richards for slice integration, or dSASA for analytical surface formulas. dSASA can also stream a long trajectory to an HDF5 file. The package includes surface-point export, pocket analysis, and Markov state model (MSM) workflows.
13
+
14
+ The repository, Python package, and installed command are named `jaxprotsasa`. The command `jpsa` is an installed alias for `jaxprotsasa`. Both accept the same subcommands and options, with no shell alias setup. Examples use `jpsa` for commands and `import jaxprotsasa as jpsa` in Python. The `jpsa` import alias also supports nested modules. Lengths are in **angstroms (Å)**, areas in **Ų**.
15
+
16
+ For notebook installation and import troubleshooting, see the
17
+ [Google Colab instructions](docs/installation.md#google-colab).
18
+
19
+ ```python
20
+ import jaxprotsasa as jpsa
21
+ ```
22
+
23
+ Start with the [quickstart](docs/quickstart.md) to load a PDB or trajectory and calculate atom/residue SASA. Follow the [command-line tutorial](docs/usage.md) for terminal examples, the [API reference](docs/api.md) for Python parameters, or the [HPC guide](docs/hpc.md) for CPU/GPU batch allocations and RAM planning.
24
+
25
+ ## Install
26
+
27
+ From the repository root, in an activated Python 3.11+ environment:
28
+
29
+ ```sh
30
+ # CPU and molecular-file support.
31
+ python -m pip install '.[cpu]'
32
+ jpsa hpc-check --runtime cpu
33
+ ```
34
+
35
+ For a fresh NVIDIA environment, install `.[cuda]` with a compatible driver and GPU. AMD users should follow the [ROCm installation instructions](docs/installation.md#amd-gpus-rocm), including the path for an existing cluster-provided JAX stack. The [installation guide](docs/installation.md) covers all runtime extras, editable installs, and environment checks.
36
+
37
+ ### Hardware compatibility
38
+
39
+ | Hardware | Runtime and library scope |
40
+ | --- | --- |
41
+ | CPU | The JAX CPU path is implemented and has recorded checks and examples. |
42
+ | NVIDIA GPU | The GPU path uses JAX with CUDA. Select devices with `--gpus` or `--gpu-ids`. Physical NVIDIA validation is not recorded here. |
43
+ | AMD GPU | The GPU path uses a compatible JAX ROCm stack and the same GPU options. Physical AMD validation is not recorded here. |
44
+ | Google Cloud TPU | Install `.[tpu]` and call `configure_resources(cpus=2, tpus=1)` before numerical imports. Python resource selection is implemented. Physical TPU validation is not recorded here. |
45
+
46
+ See the [overview compatibility table](docs/index.md#cpu-gpu-and-tpu-compatibility)
47
+ and [TPU setup notes](docs/installation.md#google-cloud-tpu-experimental-python-path).
48
+ JAX runtime support does not certify every workflow on that hardware.
49
+ Molecular file I/O and GUDHI geometry remain host CPU tasks.
50
+
51
+ ## Choose a SASA method
52
+
53
+ | Family | Method | Geometry and usage |
54
+ | --- | --- | --- |
55
+ | Analytical | Lee–Richards (`lr`) | Analytical circle-arc unions within slices. `n_slices` controls the remaining numerical height integration |
56
+ | Analytical | dSASA (`calculate_dsasa`) | Weighted regular triangulation, alpha-complex classification and analytical areas. CPU reference or experimental native JAX geometry |
57
+ | Numerical | Shrake–Rupley (`sr`) | Exposed saved or spiral sphere samples and solid-angle weights |
58
+ | Numerical | Tessellation (`tessellation`) | Compatibility alias for the same point quadrature as SR. No exact surface-mesh clipping |
59
+
60
+ Method-family imports live in `jaxprotsasa.surface_area.analytical` and `jaxprotsasa.surface_area.numerical`. Existing top-level imports remain supported. LR's `exact` mode describes its slice arcs. dSASA analytically evaluates the three-dimensional union of balls. See [algorithms](docs/algorithms.md).
61
+
62
+ ### Analytical dSASA: arrays and long trajectories
63
+
64
+ ```sh
65
+ python -m pip install '.[cpu,gudhi]'
66
+ ```
67
+
68
+ ```python
69
+ import numpy as np
70
+ import jaxprotsasa as jpsa
71
+
72
+ result = jpsa.calculate_dsasa(
73
+ np.array([[0., 0., 0.], [3., 0., 0.]]),
74
+ np.array([1.70, 1.55]),
75
+ probe_radius=1.4,
76
+ backend="gudhi",
77
+ )
78
+ print(result.atom_sasa, result.total_sasa) # Ų
79
+
80
+ summary = jpsa.process_dsasa_trajectory(
81
+ "system.tpr", "trajectory.xtc",
82
+ selection="protein", batch_size=32, output="dsasa.h5",
83
+ )
84
+ print(summary)
85
+ ```
86
+
87
+ The trajectory processor removes hydrogens using element/topology metadata and uses C/N/O/S radii matching the paper. Supply explicit radii for other elements. It streams frames to HDF5, preserves frame/time identities, and supports restart. Prepare whole, consistently imaged molecules for this nonperiodic calculation. Start with the [analytical dSASA guide](docs/dsasa.md), then see [detailed usage](docs/usage.md#analytical-dsasa) for derivatives, batching, restart, and reading output.
88
+
89
+ For native JAX geometry on one GPU:
90
+
91
+ ```sh
92
+ jpsa dsasa --topology system.tpr --traj trajectory.xtc --output dsasa-jax.h5 \
93
+ --geometry-backend jax --gpus 1 --incremental \
94
+ --geometry-fallback error --batch-size 32
95
+ ```
96
+
97
+ `backend="jax"` builds and validates the sphere-overlap geometry with JAX, then evaluates analytical areas. It can reuse connections between frames after checking them against the current coordinates. If its float64 geometry tests cannot resolve a case, the default fallback rebuilds that frame through CPU GUDHI/CGAL. `--geometry-fallback error` raises instead. This backend is experimental and has been tested on CPU. Physical GPU execution and throughput remain unmeasured. See [JAX geometry usage](docs/usage.md#native-jax-geometry-on-a-gpu), the [implementation guide](docs/dsasa_implementation.md), and the [benchmark guide](docs/dsasa_performance.md).
98
+
99
+ ## Command line
100
+
101
+ The command line provides SASA, trajectory streaming, pocket, and state-model workflows:
102
+
103
+ ```sh
104
+ # One static structure: supply the PDB once (-i and -o are the short names).
105
+ jpsa surf --pdb protein.pdb --output pdb_results --cpus 2 --gpus 0
106
+
107
+ # Selected molecular system defaults to two CPUs and no GPU.
108
+ jpsa surf --pdb system.pdb --traj trajectory.xtc --output sasa_results \
109
+ --selection "protein or resname LIG" --ligand-selection "resname LIG" \
110
+ --method tessellation --grid healpix_192 --save-points
111
+
112
+ # Share work across explicitly requested devices or several trajectories.
113
+ jpsa hpc --input examples/trajectories.json --output batch_results \
114
+ --gpus 2 --cpus 8 --include-cpu
115
+
116
+ # Estimate a state model from an integer NPY label trajectory.
117
+ jpsa msm labels.npy model_results --lag 1
118
+
119
+ # Analyze probe pockets in the first array frame.
120
+ jpsa pocket coordinates.npy radii.npy pocket_results
121
+ ```
122
+
123
+ `-i`/`--pdb`/`--topology` chooses the structure or topology, optional
124
+ `-x`/`--traj` adds trajectory frames, and `-o`/`--output` names the new output.
125
+ For a GROMACS trajectory, use `--topology system.tpr --traj trajectory.xtc`.
126
+ The [quickstart](docs/quickstart.md) includes ligand selections, CPU/GPU/mixed
127
+ Python setups, and expected outputs for each example.
128
+
129
+ Molecular `surf` writes `atom_sasa.npy`, `residue_sasa.npy`,
130
+ `component_sasa.npy`, `system_sasa.npy`, matching `*_info.npy` annotations,
131
+ frame IDs/times, and `metadata.json`. Shapes are `(frames, atoms)`,
132
+ `(frames, residues)`, and `(frames, components)`. A single-model PDB has one row.
133
+ With `--save-points`, `surface/` contains positions and exposure masks.
134
+ `hpc` writes one such folder per input and a root `batch.json`. `dsasa` writes
135
+ the separate HDF5 schema. See [all output formats](docs/usage.md#saved-results).
136
+
137
+ The `surf`, `hpc`, `msm`, and `pocket` commands default to **CPU only with two host CPUs**. Set the CPU limit with `--cpus N` or `--ncpus N`. `--gpus N` requests N visible GPUs, and bare `--gpus` requests one. `surf` processes one trajectory or coordinate array using CPU-only or GPU-only calculation. `hpc` requires an input file with at least two molecular trajectories and shares the calculation across selected CPUs or GPUs. `msm` and `pocket` currently use at most one GPU. Choose either a GPU count or a GPU ID list. CPUs always support host work. `--include-cpu` is available only in `hpc` to add CPU calculation workers to a GPU batch. These flags select within an existing allocation.
138
+
139
+ Run `jpsa COMMAND --help` for options. See the [command aliases](docs/usage.md#command-aliases). `jaxprotsasa COMMAND`, `python -m jaxprotsasa COMMAND`, and `python -m jpsa COMMAND` provide the same interface. `jpsa hpc-check --runtime cuda` or `--runtime rocm` tests an accelerator installation. Follow the [PDB and TPR/XTC command-line tutorial](docs/usage.md) or look up the [Python API reference](docs/api.md).
140
+
141
+ ### ATLAS downloads and SASA clustering
142
+
143
+ ```sh
144
+ jpsa download-atlas 3a1g_B 3bpj_C --output atlas
145
+ jpsa download-atlas --from-file pdb_chains.txt --output atlas
146
+
147
+ python -m pip install '.[umap]'
148
+ jpsa umap sasa_results --output sasa_clusters
149
+ ```
150
+
151
+ The downloader saves and extracts ATLAS analysis bundles by PDB-chain ID and
152
+ reuses existing downloads. A text list takes one ID per line.
153
+ [ATLAS database paper](https://doi.org/10.1093/nar/gkad1084)
154
+
155
+ `jpsa umap` accepts a `surf` results folder or a SASA NPY file with at least
156
+ four frames. It uses a sibling `frame_indices.npy` when present. The new output
157
+ folder contains the embedding plot, frame assignments, representative frames,
158
+ and mean and estimated SASA vectors. [See the Python examples and output details](docs/api.md#atlas-downloads-and-sasa-clustering).
159
+
160
+ ## Python API
161
+
162
+ ```python
163
+ from jpsa.execution import configure_resources
164
+ configure_resources(cpus=2, gpus=0)
165
+
166
+ import jaxprotsasa as jpsa
167
+
168
+ trajectory = jpsa.TrajectoryData(
169
+ "system.pdb", "trajectory.xtc",
170
+ selection="protein or resname LIG",
171
+ ligand_selection="resname LIG",
172
+ radii_config="freesasa_reference",
173
+ )
174
+ result = jpsa.calculate_sasa(
175
+ trajectory,
176
+ save_path="python_results",
177
+ method="tessellation",
178
+ grid="healpix_192",
179
+ save_points=True,
180
+ )
181
+ print(result.system_sasa) # One total per frame.
182
+ print(result.component_info["label"]) # Labels for component area columns.
183
+ print(result.output_dir) # Folder for this run.
184
+ ```
185
+
186
+ `calculate_sasa` returns results in memory by default. Passing `save_path`
187
+ saves the result to disk. Reusing that path saves a separate numbered run
188
+ inside the folder.
189
+
190
+ Only selected atoms block one another's access to solvent. Selecting protein plus ligand measures the ligand's exposure in that complex. Selecting the ligand alone measures its isolated exposure. Python calls use the JAX environment already initialized by the program. The CLI's two-CPU policy is configured separately. [Usage](docs/usage.md#python-api) shows how to set resources before imports, work with arrays, and use device workers.
191
+
192
+ For a GPU run, choose the following setup in a **fresh process** instead of the CPU setup above. Configure CPU and GPU defaults together before importing numerical APIs:
193
+
194
+ ```python
195
+ from jpsa.execution import configure_resources
196
+
197
+ configure_resources(cpus=4, gpus=2) # Or: cpus=8, gpu_ids=[0, 2]
198
+ # Add include_cpu=True for CPU and GPU calculation workers together.
199
+
200
+ import jaxprotsasa as jpsa
201
+ ```
202
+
203
+ Use `calculate_sasa(..., parallel=True)`, `calculate_sasa_batch`, or
204
+ `sasa_parallel` to use the configured pool without repeating GPU selectors.
205
+ A serial calculation uses the first configured device. Use `gpus=0` for CPU
206
+ only. Settings apply within the existing allocation. GPU IDs are local runtime
207
+ hardware IDs, and GPU availability is checked when calculation begins. See
208
+ [complete resource examples](docs/quickstart.md#configure-cpu-and-gpu-resources-together).
209
+
210
+ ## Van der Waals Radii
211
+
212
+ The loader defaults to the package's **`freesasa_reference` element-radius table**. It preserves the effective radii used by the project's FreeSASA reference workflow. FreeSASA itself normally uses residue/atom-name ProtOr classification, which can assign different radii to atoms of the same element. Cite [Mitternacht, *FreeSASA* (2016)](https://doi.org/10.12688/f1000research.7931.1) and consult the [FreeSASA ProtOr configuration](https://github.com/mittinatten/freesasa/blob/master/share/protor.config) when comparing results.
213
+
214
+ MDAnalysis also publishes a different element-radius table. Loading a trajectory with MDAnalysis does not automatically select it here. Changing radii changes probe-expanded sphere areas and blocking of neighboring surfaces, so match the actual radii, probe, atom selection, and hydrogen treatment before comparing SASA. The [radii guide](docs/radii.md) lists the values, explains provenance and fallbacks, and shows how to supply MDAnalysis or custom radii.
215
+
216
+ ## Read and tune results
217
+
218
+ Molecular runs save atom, residue, component, and system areas alongside matching annotation tables. Reload them with `SASAResult.load("python_results", mmap_mode="r")`, or read the NPY arrays directly with `allow_pickle=False`. Surface points and exposure masks live in `surface/` when requested. Array CLI runs have a smaller file schema, described in [usage](docs/usage.md#saved-results).
219
+
220
+ SR defaults to the packaged `healpix_192` grid. Choose `icosahedron_42` or `icosahedron_162` with `grid`/`--grid`. Icosahedral areas use saved Voronoi weights. For Fibonacci spiral sampling, use `grid="spiral_points", n_points=962` with either SR or tessellation. See the [962-point examples](docs/grids.md#spiral-sampling-with-962-points).
221
+
222
+ SR, tessellation, and LR trajectory calculations cache compact nearby-atom edges by default (`neighbor_rebuild_interval=10`, `neighbor_skin=4.0` Å), rebuilding sooner when displacement requires it. These options are available in the SASA APIs and CLI. Distinguish **neighbor-list reuse** from **frame batching** (`frame_batch_size`). Benchmark interval 1 for small or rapidly moving systems. Scan overhead can outweigh saved discovery work. Larger frame batches can improve throughput while increasing memory. Neither setting has a universal best value. See [performance and window sizes](docs/performance.md).
223
+
224
+ ## Documentation
225
+
226
+ The guides are also configured as a searchable MkDocs site with light and dark
227
+ appearances. To preview them locally from the repository root (no JAX or GPU required):
228
+
229
+ ```sh
230
+ python3 -m venv .venv-docs
231
+ .venv-docs/bin/python -m pip install -r requirements-docs.txt
232
+ .venv-docs/bin/python -m mkdocs serve
233
+ ```
234
+
235
+ If the documentation dependencies are already installed in your project `.venv`,
236
+ run `.venv/bin/python -m mkdocs serve` instead. Use the same environment for
237
+ installation and MkDocs: a global `mkdocs` command can report missing `pymdownx`
238
+ even when `pymdown-extensions` is installed in a virtual environment. See
239
+ [environment troubleshooting](docs/documentation.md#missing-pymdownx-or-material-despite-installation).
240
+
241
+ See [the documentation](https://bkbonde.github.io/jaxprotsasa/) for more info.
242
+
243
+ | Guide | Contents |
244
+ | --- | --- |
245
+ | [Quickstart](docs/quickstart.md) | Load a PDB or trajectory. Calculate atom/residue SASA in Python and from the CLI. Try each method |
246
+ | [Installation](docs/installation.md) | CPU, NVIDIA CUDA, AMD ROCm, cluster stacks, package extras |
247
+ | [Command-line usage](docs/usage.md) | PDB and TPR/XTC tutorial, algorithm options, memory estimates, saved outputs |
248
+ | [Python API](docs/api.md) | Loading, calculation signatures, parameter defaults, and result objects |
249
+ | [Sampling grids](docs/grids.md) | SR/tessellation grid catalogue and images, LR sampling controls, and public grid APIs |
250
+ | [Bulk processing](docs/bulk.md) | Directories of PDBs, trajectory manifests, Python batches, and separate outputs |
251
+ | [Atomic radii](docs/radii.md) | Default table, FreeSASA/MDAnalysis differences, custom radii, citations |
252
+ | [SR accuracy validation](docs/validation.md) | Saved grids versus spiral-960 on six proteins, independent refined reference |
253
+ | [Performance](docs/performance.md) | Reuse windows, batching, memory, timing guidance |
254
+ | [Analytical dSASA](docs/dsasa.md) | Installation, arrays, native geometry, streaming, restart, and HDF5 output |
255
+ | [dSASA mathematics](docs/dsasa_mathematics.md) | Weighted geometry, analytical terms, equation-to-code mapping, derivatives |
256
+ | [dSASA implementation](docs/dsasa_implementation.md) | Component matrix, dependencies, delivered scope and limitations |
257
+ | [dSASA performance](docs/dsasa_performance.md) | Reproducible benchmarks, profiling, production validation requirements |
258
+ | [Algorithms](docs/algorithms.md) | SASA geometry, methods, numerical limits, pockets and MSMs |
259
+ | [Architecture](docs/architecture.md) | Module responsibilities, execution paths, data contracts |
260
+ | [GPU SASA literature](docs/literature.md) | Dated GPU methods catalog, foundational references, and bibliography downloads |
261
+ | [HPC](docs/hpc.md) | Device IDs, input files, Slurm, distributed ranks |
262
+ | [Examples](examples/README.md) | Runnable molecular and self-contained array examples |
263
+
264
+ Run the current `tests/` suite for available integration checks.
265
+
266
+ For development:
267
+
268
+ ```sh
269
+ python -m pip install -e '.[cpu,dev]'
270
+ python -m pytest -q
271
+ python -m build
272
+ ```
273
+
274
+ ## Credits and citation
275
+
276
+ Credits to [Pratik Patil](https://pra-ashok.github.io/CV/) and
277
+ [Bhushan Bonde](https://scholar.google.com/citations?user=O3hkOEUAAAAJ&hl=en).
278
+
279
+ If you use JAX SASA in your work, cite the GitHub repository and record the
280
+ software version, release tag, or commit used:
281
+
282
+ > Patil, Pratik, and Bhushan Bonde. *JAX SASA (jaxprotsasa).* GitHub repository.
283
+ > [bkbonde/jaxprotsasa](https://github.com/bkbonde/jaxprotsasa).
284
+
285
+ See [CITATION.cff](CITATION.cff) for citation metadata and the
286
+ [citation guide](docs/credits.md) for BibTeX.
@@ -0,0 +1,4 @@
1
+ # Preserve an already installed, compatible AMD/site JAX stack.
2
+ # Constraints do not install ROCm, GPU drivers, or plugin/PJRT wheels.
3
+ jax==0.8.0
4
+ jaxlib==0.8.0