rust-sasa-python 0.7.4__cp314-cp314-win32.whl
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.
- rust_sasa_python/__init__.py +5 -0
- rust_sasa_python/__init__.pyi +151 -0
- rust_sasa_python/py.typed +0 -0
- rust_sasa_python/rust_sasa_python.cp314-win32.pyd +0 -0
- rust_sasa_python-0.7.4.dist-info/METADATA +74 -0
- rust_sasa_python-0.7.4.dist-info/RECORD +9 -0
- rust_sasa_python-0.7.4.dist-info/WHEEL +4 -0
- rust_sasa_python-0.7.4.dist-info/licenses/LICENSE.md +21 -0
- rust_sasa_python-0.7.4.dist-info/sboms/rust-sasa-python.cyclonedx.json +2333 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Type stubs for rust_sasa_python module."""
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
class Protein:
|
|
6
|
+
"""Protein-level SASA results."""
|
|
7
|
+
|
|
8
|
+
total: float
|
|
9
|
+
polar: float
|
|
10
|
+
non_polar: float
|
|
11
|
+
|
|
12
|
+
class Residue:
|
|
13
|
+
"""Residue-level SASA results."""
|
|
14
|
+
|
|
15
|
+
chain_id: str
|
|
16
|
+
residue_name: str
|
|
17
|
+
residue_number: int
|
|
18
|
+
sasa: float
|
|
19
|
+
|
|
20
|
+
class Chain:
|
|
21
|
+
"""Chain-level SASA results."""
|
|
22
|
+
|
|
23
|
+
chain_id: str
|
|
24
|
+
sasa: float
|
|
25
|
+
|
|
26
|
+
class SASACalculator:
|
|
27
|
+
"""SASA calculator with configurable parameters."""
|
|
28
|
+
|
|
29
|
+
def __init__(self, pdb_path: str) -> None:
|
|
30
|
+
"""Initialize SASA calculator with PDB file path.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
pdb_path: Path to PDB or mmCIF file
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def with_probe_radius(self, radius: float) -> SASACalculator:
|
|
38
|
+
"""Set the probe radius for SASA calculation.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
radius: Probe sphere radius in Ångströms (default: 1.4)
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
Self for method chaining
|
|
45
|
+
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
def with_n_points(self, points: int) -> SASACalculator:
|
|
49
|
+
"""Set the number of points for surface sampling.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
points: Number of sampling points (default: 100)
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Self for method chaining
|
|
56
|
+
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
def calculate_protein(self) -> Protein:
|
|
60
|
+
"""Calculate SASA at the protein level.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
Protein: Object containing total, polar, and non-polar SASA values
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
def calculate_chain(self) -> List[Chain]:
|
|
68
|
+
"""Calculate SASA at the chain level.
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
List[Chain]: List of chain-level SASA results
|
|
72
|
+
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
def calculate_residue(self) -> List[Residue]:
|
|
76
|
+
"""Calculate SASA at the residue level.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
List[Residue]: List of residue-level SASA results
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
def calculate_atom(self) -> List[float]:
|
|
84
|
+
"""Calculate SASA at the atom level.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
List[float]: List of atom-level SASA values
|
|
88
|
+
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
# Convenience functions
|
|
92
|
+
def calculate_protein_sasa(pdb_path: str) -> Protein:
|
|
93
|
+
"""Calculate protein-level SASA for a PDB file.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
pdb_path: Path to PDB or mmCIF file
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Protein: Object containing total, polar, and non-polar SASA values
|
|
100
|
+
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
def calculate_residue_sasa(pdb_path: str) -> List[Residue]:
|
|
104
|
+
"""Calculate residue-level SASA for a PDB file.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
pdb_path: Path to PDB or mmCIF file
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
List[Residue]: List of residue-level SASA results
|
|
111
|
+
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
def calculate_atom_sasa(pdb_path: str) -> List[float]:
|
|
115
|
+
"""Calculate atom-level SASA for a PDB file.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
pdb_path: Path to PDB or mmCIF file
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
List[float]: List of atom-level SASA values
|
|
122
|
+
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
def calculate_chain_sasa(pdb_path: str) -> List[Chain]:
|
|
126
|
+
"""Calculate chain-level SASA for a PDB file.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
pdb_path: Path to PDB or mmCIF file
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
List[Chain]: List of chain-level SASA results
|
|
133
|
+
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
def calculate_sasa_internal(
|
|
137
|
+
atoms_in: list[tuple[tuple[float, float, float], float, int]],
|
|
138
|
+
probe_radius: float,
|
|
139
|
+
n_points: int,
|
|
140
|
+
) -> list[float]:
|
|
141
|
+
"""Calculate SASA for a set of atoms.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
atoms_in: List of atom coordinates, radii, and indices
|
|
145
|
+
probe_radius: Probe radius
|
|
146
|
+
n_points: Number of points on the sphere
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
List[float]: List of SASA values
|
|
150
|
+
|
|
151
|
+
"""
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rust-sasa-python
|
|
3
|
+
Version: 0.7.4
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Requires-Dist: pytest>=8.4.1 ; extra == 'dev'
|
|
8
|
+
Requires-Dist: maturin==1.16.0 ; extra == 'dev'
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
License-File: LICENSE.md
|
|
11
|
+
Summary: An ultra-fast package for computing Solvent Accessible Surface Area (SASA/ASA) for proteins **46X** faster than Biopython, **7X** faster than Freesasa
|
|
12
|
+
Author: Max Campbell
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
|
+
|
|
16
|
+
# rust-sasa-python
|
|
17
|
+
|
|
18
|
+
A high-performance **Python library** for computing SASA (Solvent Accessible Surface Area) using Rust as the backend. This library provides a clean, Pythonic interface to the fast RustSASA calculation engine. If you use RustSASA in your research, please [cite it](https://github.com/maxall41/RustSASA#how-to-cite).
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **Powered by [RustSASA](https://github.com/maxall41/RustSASA)**: Leverages Rust's performance and safety.
|
|
23
|
+
- **Ludicrous Speed**: **63X** faster than Biopython, **5X** faster than Freesasa.
|
|
24
|
+
- **Pythonic Interface**: Clean, intuitive API.
|
|
25
|
+
- **Configurable**: Customizable probe radius and sampling points.
|
|
26
|
+
- **PDB and mmCIF SUPPORT**: Supports both PDB and mmCIF files.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
# PyPI
|
|
32
|
+
pip install rust-sasa-python
|
|
33
|
+
|
|
34
|
+
# conda
|
|
35
|
+
conda install -c conda-forge rust-sasa-python
|
|
36
|
+
|
|
37
|
+
# mamba
|
|
38
|
+
mamba install -c conda-forge rust-sasa-python
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import rust_sasa_python as sasa
|
|
45
|
+
|
|
46
|
+
# Simple calculation - use convenience function
|
|
47
|
+
result = sasa.calculate_protein_sasa("protein.pdb")
|
|
48
|
+
print(f"Total SASA: {result.total:.2f}")
|
|
49
|
+
|
|
50
|
+
# Builder pattern for more control
|
|
51
|
+
calculator = (sasa.SASACalculator("protein.pdb")
|
|
52
|
+
.with_probe_radius(1.2)
|
|
53
|
+
.with_n_points(2000))
|
|
54
|
+
result = calculator.calculate_protein()
|
|
55
|
+
print(f"Total SASA: {result.total:.2f}")
|
|
56
|
+
print(f"Polar SASA: {result.polar:.2f}")
|
|
57
|
+
print(f"Non-polar SASA: {result.non_polar:.2f}")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
See [DOCS](https://github.com/maxall41/rust-sasa-python/blob/main/DOCS.md) for more information and API reference.
|
|
61
|
+
|
|
62
|
+
## Contributing
|
|
63
|
+
|
|
64
|
+
Contributions are welcome! Please feel free to submit issues and pull requests.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
This project is licensed under the MIT License.
|
|
69
|
+
|
|
70
|
+
## Related Projects
|
|
71
|
+
|
|
72
|
+
- [RustSASA](https://github.com/maxall41/RustSASA) - The core Rust library.
|
|
73
|
+
- [DPXRust](https://github.com/maxall41/DPXRust) - Rust library for DPX calculations.
|
|
74
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
rust_sasa_python/__init__.py,sha256=GwXUM63Xm1llfQ1qZLKralpgqaG4xQ7gWZjqdtN9BXc,147
|
|
2
|
+
rust_sasa_python/__init__.pyi,sha256=YR6gWJ-vh5KkHoclp4JogFppAd2CyFqi_iHxqFU4T2o,3535
|
|
3
|
+
rust_sasa_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
rust_sasa_python/rust_sasa_python.cp314-win32.pyd,sha256=j6nyCPxRDGujEttisRSYqI8LrOkB7Pxto3R1MIjVw6Y,1006592
|
|
5
|
+
rust_sasa_python-0.7.4.dist-info/METADATA,sha256=FygBdU_1ElyVkXxIEKke3D7XHcvScGjOIt2pQvI5jwc,2604
|
|
6
|
+
rust_sasa_python-0.7.4.dist-info/WHEEL,sha256=wkszVsmv0KLgRIp3AAntqJqm1bOsjFaxpAqkfcC0Vw0,93
|
|
7
|
+
rust_sasa_python-0.7.4.dist-info/licenses/LICENSE.md,sha256=Wy79HDisHgyh-fvS8i-HOSiBePW1NXTRUdOLxxQgQfk,1092
|
|
8
|
+
rust_sasa_python-0.7.4.dist-info/sboms/rust-sasa-python.cyclonedx.json,sha256=J8ctE860eEMn7JCPOXHLrh05fWV60lKKq56ZAOSuCgg,71715
|
|
9
|
+
rust_sasa_python-0.7.4.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Maxwell Campbell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|