prot-rsa 1.0.1__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.
- prot_rsa-1.0.1/HISTORY.md +111 -0
- prot_rsa-1.0.1/LICENSE +21 -0
- prot_rsa-1.0.1/MANIFEST.in +1 -0
- prot_rsa-1.0.1/PKG-INFO +124 -0
- prot_rsa-1.0.1/README.md +92 -0
- prot_rsa-1.0.1/prot_rsa.egg-info/PKG-INFO +124 -0
- prot_rsa-1.0.1/prot_rsa.egg-info/SOURCES.txt +18 -0
- prot_rsa-1.0.1/prot_rsa.egg-info/dependency_links.txt +1 -0
- prot_rsa-1.0.1/prot_rsa.egg-info/entry_points.txt +2 -0
- prot_rsa-1.0.1/prot_rsa.egg-info/requires.txt +3 -0
- prot_rsa-1.0.1/prot_rsa.egg-info/top_level.txt +1 -0
- prot_rsa-1.0.1/protrsa.py +1833 -0
- prot_rsa-1.0.1/pyproject.toml +55 -0
- prot_rsa-1.0.1/setup.cfg +4 -0
- prot_rsa-1.0.1/tests/test_atom_pipeline.py +296 -0
- prot_rsa-1.0.1/tests/test_atom_sasa_naive.py +215 -0
- prot_rsa-1.0.1/tests/test_atom_sasa_spatial.py +510 -0
- prot_rsa-1.0.1/tests/test_cli.py +275 -0
- prot_rsa-1.0.1/tests/test_residue_cef.py +166 -0
- prot_rsa-1.0.1/tests/test_structure_reader.py +265 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Release history
|
|
2
|
+
|
|
3
|
+
## 1.0.1 — current release
|
|
4
|
+
|
|
5
|
+
`prot-rsa` is an importable Python module and command-line program for
|
|
6
|
+
calculating solvent-accessible surface area (SASA) for protein structures.
|
|
7
|
+
|
|
8
|
+
### Current capabilities
|
|
9
|
+
|
|
10
|
+
- Reads PDB, mmCIF, `.pdb.gz`, and `.cif.gz` structures.
|
|
11
|
+
- Resolves alternate locations and rejects multiple coordinate models.
|
|
12
|
+
- Calculates atom SASA with deterministic Fibonacci sphere sampling (960 points
|
|
13
|
+
by default; configurable with `--sphere-points`, minimum 122).
|
|
14
|
+
- Uses cKDTree neighbor pruning, vectorized occlusion masks, ordered neighbors,
|
|
15
|
+
cached geometric terms, complete-burial skipping, and a Numba CPU backend.
|
|
16
|
+
- Supports one or more Numba worker threads through `--workers`.
|
|
17
|
+
- Supports explicit-hydrogen mode (`--use-h`) and optional retained loose
|
|
18
|
+
hetero-atoms (`--preserve-het`).
|
|
19
|
+
- Produces both complete-residue (`ALL`) and side-chain (`SIDE`) contextual
|
|
20
|
+
exposure fractions (CEF).
|
|
21
|
+
- Uses `NA` for SIDE values of residues without retained side-chain atoms,
|
|
22
|
+
including glycine under the canonical backbone definition.
|
|
23
|
+
- Exposes reusable calculation and parsing functions through `protrsa` without
|
|
24
|
+
command-line or filesystem side effects on import.
|
|
25
|
+
- Uses compact SAS column names with one-line `#` explanations at the start of
|
|
26
|
+
each atom and residue output file.
|
|
27
|
+
- Names the tab-separated outputs `<base>.atom_sas.tsv` and
|
|
28
|
+
`<base>.res_sas.tsv` so their format and purpose are explicit.
|
|
29
|
+
- Prints a concise completion summary containing the generated filenames,
|
|
30
|
+
atom/residue counts, and elapsed time.
|
|
31
|
+
|
|
32
|
+
The separate atom-file comparison helper is not part of this release.
|
|
33
|
+
|
|
34
|
+
### Output files and schemas
|
|
35
|
+
|
|
36
|
+
For an input such as `1LYZ.pdb`, the command writes:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
1LYZ.atom_sas.tsv
|
|
40
|
+
1LYZ.res_sas.tsv
|
|
41
|
+
1LYZ.pqr
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`*.atom_sas.tsv` is a UTF-8 tab-separated file. It begins with one `#` comment per
|
|
45
|
+
column, followed by this header:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
# atom: 1-based output atom index
|
|
49
|
+
# rec: source record type
|
|
50
|
+
# src: source atom identifier
|
|
51
|
+
# name: atom name
|
|
52
|
+
# res: residue name
|
|
53
|
+
# chain: chain identifier
|
|
54
|
+
# seq: residue sequence identifier
|
|
55
|
+
# ins: insertion code
|
|
56
|
+
# elem: resolved element
|
|
57
|
+
# radius: assigned atomic radius, Å
|
|
58
|
+
# sasa: solvent-accessible surface area, Ų
|
|
59
|
+
atom rec src name res chain seq ins elem radius sasa
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`*.res_sas.tsv` follows the same comment-plus-header convention:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
# res: residue name
|
|
66
|
+
# chain: chain identifier
|
|
67
|
+
# seq: residue sequence identifier
|
|
68
|
+
# ins: insertion code
|
|
69
|
+
# all: in-protein SASA of all residue atoms, Ų
|
|
70
|
+
# a_ref: isolated-residue reference SASA of all atoms, Ų
|
|
71
|
+
# a_cef: all-atom contextual exposure fraction
|
|
72
|
+
# side: in-protein side-chain SASA, Ų
|
|
73
|
+
# s_ref: isolated side-chain reference SASA, Ų
|
|
74
|
+
# s_cef: side-chain contextual exposure fraction
|
|
75
|
+
res chain seq ins all a_ref a_cef side s_ref s_cef
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The first four residue fields identify the residue. The `*_all` values use all
|
|
79
|
+
normalized residue atoms. The `*_side` values exclude backbone atoms `N`,
|
|
80
|
+
`CA`, `C`, `O`, and `OXT`. Reference values are calculated with the selected
|
|
81
|
+
residue atoms isolated from the rest of the protein. Numeric residue values
|
|
82
|
+
are formatted to three decimal places; SIDE fields are `NA` when no SIDE atoms
|
|
83
|
+
remain.
|
|
84
|
+
|
|
85
|
+
`*.pqr` contains PDB-style records with the input coordinates, a placeholder
|
|
86
|
+
charge of `0.000`, and the assigned radius. It has no tabular header.
|
|
87
|
+
|
|
88
|
+
### Expected performance
|
|
89
|
+
|
|
90
|
+
Representative one-thread timings on the canonical benchmark structures are
|
|
91
|
+
shown below. These are wall-clock medians and are hardware- and environment-
|
|
92
|
+
dependent; they are performance expectations rather than guarantees.
|
|
93
|
+
|
|
94
|
+
| Configuration | Sphere points | 1LYZ (1,001 atoms) | 1CA2 (2,040 atoms) | 1UOR (4,616 atoms) |
|
|
95
|
+
| --- | ---: | ---: | ---: | ---: |
|
|
96
|
+
| Naive reference | 960 | 551 s | 2,185 s | 11,634 s |
|
|
97
|
+
| cKDTree | 960 | 19.490 s | 40.644 s | 86.590 s |
|
|
98
|
+
| Vectorized mask | 960 | 0.609 s | 1.285 s | 2.820 s |
|
|
99
|
+
| Occlusion-ordered neighbors | 960 | 0.319 s | 0.630 s | 1.620 s |
|
|
100
|
+
| Cached NumPy kernel | 960 | 0.276 s | 0.536 s | 1.393 s |
|
|
101
|
+
| Numba CPU | 960 | 0.328 s | 0.388 s | 0.735 s |
|
|
102
|
+
| Numba CPU, reduced sampling | 480 | 0.358 s | 0.382 s | 0.494 s |
|
|
103
|
+
|
|
104
|
+
Halving the sphere-point count does not halve total wall-clock time because
|
|
105
|
+
validation, neighbor construction, and other fixed costs remain. The 480-point
|
|
106
|
+
results had atom-SASA MAE values of approximately 0.164, 0.145, and 0.184 Ų
|
|
107
|
+
per atom for 1LYZ, 1CA2, and 1UOR, respectively, relative to 960-point output.
|
|
108
|
+
|
|
109
|
+
## 1.0.0 — initial release
|
|
110
|
+
|
|
111
|
+
Initial TestPyPI release of the atom-SASA and dual residue-CEF calculation.
|
prot_rsa-1.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Junjun Mao
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include HISTORY.md
|
prot_rsa-1.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prot-rsa
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Fast protein residue surface-area calculation in Python
|
|
5
|
+
Author: Junjun Mao
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/newbooks/prot-rsa
|
|
8
|
+
Project-URL: Repository, https://github.com/newbooks/prot-rsa
|
|
9
|
+
Project-URL: Issues, https://github.com/newbooks/prot-rsa/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/newbooks/prot-rsa/blob/main/HISTORY.md
|
|
11
|
+
Project-URL: Documentation, https://github.com/newbooks/prot-rsa/blob/main/README.md
|
|
12
|
+
Keywords: bioinformatics,computational biology,protein,residue surface area,structural biology
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy
|
|
29
|
+
Requires-Dist: scipy
|
|
30
|
+
Requires-Dist: numba
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# prot-rsa
|
|
34
|
+
|
|
35
|
+
Fast protein residue surface-area calculation in Python.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Install the distribution from PyPI:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install prot-rsa
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Command-line use
|
|
46
|
+
|
|
47
|
+
Run the installed application with:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
prot-rsa structure.pdb
|
|
51
|
+
# optionally choose a lower sampling resolution (minimum 122 points)
|
|
52
|
+
prot-rsa structure.pdb --sphere-points 480
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Run `prot-rsa --help` to see the supported PDB/mmCIF input suffixes, calculation
|
|
56
|
+
options, defaults, and derived output filenames.
|
|
57
|
+
|
|
58
|
+
The command writes `<base>.atom_sas.tsv` and `<base>.res_sas.tsv` as TSV files, plus a
|
|
59
|
+
normalized `<base>.pqr` containing the selected radii and placeholder charge
|
|
60
|
+
`0.000`. The production calculation uses cKDTree neighbor pruning; the
|
|
61
|
+
deliberately naive serial implementation remains available as a correctness
|
|
62
|
+
reference.
|
|
63
|
+
|
|
64
|
+
## Python use
|
|
65
|
+
|
|
66
|
+
The application can also be imported as the `protrsa` module so its functions
|
|
67
|
+
and constants can be used directly:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
import protrsa
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The distribution and command are named `prot-rsa`. The import name is
|
|
74
|
+
`protrsa` because Python module names cannot contain hyphens.
|
|
75
|
+
|
|
76
|
+
## Residue exposure
|
|
77
|
+
|
|
78
|
+
Residue solvent-accessible surface area will be calculated by summing the
|
|
79
|
+
already computed atom SASAs for each residue. The residue report will contain
|
|
80
|
+
both complete-residue (`ALL`) and side-chain (`SIDE`) **Contextual Exposure
|
|
81
|
+
Fraction (CEF)** values rather than conventional RSA:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
CEF = selected-atom SASA in the complete protein
|
|
85
|
+
/ SASA of the same selected residue conformation in isolation
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The denominator is a naked-residue calculation using the same selected atoms,
|
|
89
|
+
atomic radii, probe radius, and sphere points, but without other residues
|
|
90
|
+
present. The compact output columns are `all`, `a_ref`, `a_cef`, `side`,
|
|
91
|
+
`s_ref`, and `s_cef`; leading `#` comment lines explain every field. CEF therefore represents
|
|
92
|
+
the fraction of the selected residue surface retained in its protein context.
|
|
93
|
+
It is distinct from conventional RSA, which normally uses a fixed residue-type
|
|
94
|
+
reference or maximum ASA.
|
|
95
|
+
|
|
96
|
+
Residues without retained side-chain atoms, such as glycine under the
|
|
97
|
+
canonical backbone definition, use `NA` for the three SIDE fields.
|
|
98
|
+
|
|
99
|
+
CEF lies in `[0, 1]` up to floating-point roundoff. The complete residue
|
|
100
|
+
output contract is documented in `docs/specs/residue-cef.md`.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Optimization Comparison
|
|
104
|
+
|
|
105
|
+
This program targets the speed optimization of residue surface solvent exposure calculation.
|
|
106
|
+
|
|
107
|
+
The table below compares protein RSA calculation times under each
|
|
108
|
+
optimization. Execution times are reported in seconds; lower values are
|
|
109
|
+
better.
|
|
110
|
+
|
|
111
|
+
| Optimization | Sphere points | Time (small) | Time (medium) | Time (large) | Atom-SASA MAE vs `*.sas.baseline` (small / medium / large, Ų) |
|
|
112
|
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
113
|
+
| Naive | 960 | 551 | 2185 | 11634 | 0.000 / 0.000 / 0.000 |
|
|
114
|
+
| cKDTree | 960 | 19.490 | 40.644 | 86.590 | 0.000 / 0.000 / 0.000 |
|
|
115
|
+
| Vectorized mask | 960 | 0.609 | 1.285 | 2.820 | 0.000 / 0.000 / 0.000 |
|
|
116
|
+
| Occlusion-ordered neighbors | 960 | 0.319 | 0.630 | 1.620 | 0.000 / 0.000 / 0.000 |
|
|
117
|
+
| Cache | 960 | 0.276 | 0.536 | 1.393 | 0.000 / 0.000 / 0.000 |
|
|
118
|
+
| Numba CPU | 960 | 0.328 | 0.388 | 0.735 | 0.000 / 0.000 / 0.000 |
|
|
119
|
+
| Reduced points | 480 | 0.358 | 0.382 | 0.494 | 0.164 / 0.145 / 0.184 |
|
|
120
|
+
|
|
121
|
+
Benchmark structures are **small** — 1LYZ (129 residues); **medium** — 1CA2
|
|
122
|
+
(256 residues); **large** — 1UOR (580 residues). Residue counts are the numbers
|
|
123
|
+
of unique residues represented by `ATOM` records; waters, ions, and other
|
|
124
|
+
`HETATM` records are excluded.
|
prot_rsa-1.0.1/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# prot-rsa
|
|
2
|
+
|
|
3
|
+
Fast protein residue surface-area calculation in Python.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the distribution from PyPI:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install prot-rsa
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Command-line use
|
|
14
|
+
|
|
15
|
+
Run the installed application with:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
prot-rsa structure.pdb
|
|
19
|
+
# optionally choose a lower sampling resolution (minimum 122 points)
|
|
20
|
+
prot-rsa structure.pdb --sphere-points 480
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Run `prot-rsa --help` to see the supported PDB/mmCIF input suffixes, calculation
|
|
24
|
+
options, defaults, and derived output filenames.
|
|
25
|
+
|
|
26
|
+
The command writes `<base>.atom_sas.tsv` and `<base>.res_sas.tsv` as TSV files, plus a
|
|
27
|
+
normalized `<base>.pqr` containing the selected radii and placeholder charge
|
|
28
|
+
`0.000`. The production calculation uses cKDTree neighbor pruning; the
|
|
29
|
+
deliberately naive serial implementation remains available as a correctness
|
|
30
|
+
reference.
|
|
31
|
+
|
|
32
|
+
## Python use
|
|
33
|
+
|
|
34
|
+
The application can also be imported as the `protrsa` module so its functions
|
|
35
|
+
and constants can be used directly:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
import protrsa
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The distribution and command are named `prot-rsa`. The import name is
|
|
42
|
+
`protrsa` because Python module names cannot contain hyphens.
|
|
43
|
+
|
|
44
|
+
## Residue exposure
|
|
45
|
+
|
|
46
|
+
Residue solvent-accessible surface area will be calculated by summing the
|
|
47
|
+
already computed atom SASAs for each residue. The residue report will contain
|
|
48
|
+
both complete-residue (`ALL`) and side-chain (`SIDE`) **Contextual Exposure
|
|
49
|
+
Fraction (CEF)** values rather than conventional RSA:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
CEF = selected-atom SASA in the complete protein
|
|
53
|
+
/ SASA of the same selected residue conformation in isolation
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The denominator is a naked-residue calculation using the same selected atoms,
|
|
57
|
+
atomic radii, probe radius, and sphere points, but without other residues
|
|
58
|
+
present. The compact output columns are `all`, `a_ref`, `a_cef`, `side`,
|
|
59
|
+
`s_ref`, and `s_cef`; leading `#` comment lines explain every field. CEF therefore represents
|
|
60
|
+
the fraction of the selected residue surface retained in its protein context.
|
|
61
|
+
It is distinct from conventional RSA, which normally uses a fixed residue-type
|
|
62
|
+
reference or maximum ASA.
|
|
63
|
+
|
|
64
|
+
Residues without retained side-chain atoms, such as glycine under the
|
|
65
|
+
canonical backbone definition, use `NA` for the three SIDE fields.
|
|
66
|
+
|
|
67
|
+
CEF lies in `[0, 1]` up to floating-point roundoff. The complete residue
|
|
68
|
+
output contract is documented in `docs/specs/residue-cef.md`.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## Optimization Comparison
|
|
72
|
+
|
|
73
|
+
This program targets the speed optimization of residue surface solvent exposure calculation.
|
|
74
|
+
|
|
75
|
+
The table below compares protein RSA calculation times under each
|
|
76
|
+
optimization. Execution times are reported in seconds; lower values are
|
|
77
|
+
better.
|
|
78
|
+
|
|
79
|
+
| Optimization | Sphere points | Time (small) | Time (medium) | Time (large) | Atom-SASA MAE vs `*.sas.baseline` (small / medium / large, Ų) |
|
|
80
|
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
81
|
+
| Naive | 960 | 551 | 2185 | 11634 | 0.000 / 0.000 / 0.000 |
|
|
82
|
+
| cKDTree | 960 | 19.490 | 40.644 | 86.590 | 0.000 / 0.000 / 0.000 |
|
|
83
|
+
| Vectorized mask | 960 | 0.609 | 1.285 | 2.820 | 0.000 / 0.000 / 0.000 |
|
|
84
|
+
| Occlusion-ordered neighbors | 960 | 0.319 | 0.630 | 1.620 | 0.000 / 0.000 / 0.000 |
|
|
85
|
+
| Cache | 960 | 0.276 | 0.536 | 1.393 | 0.000 / 0.000 / 0.000 |
|
|
86
|
+
| Numba CPU | 960 | 0.328 | 0.388 | 0.735 | 0.000 / 0.000 / 0.000 |
|
|
87
|
+
| Reduced points | 480 | 0.358 | 0.382 | 0.494 | 0.164 / 0.145 / 0.184 |
|
|
88
|
+
|
|
89
|
+
Benchmark structures are **small** — 1LYZ (129 residues); **medium** — 1CA2
|
|
90
|
+
(256 residues); **large** — 1UOR (580 residues). Residue counts are the numbers
|
|
91
|
+
of unique residues represented by `ATOM` records; waters, ions, and other
|
|
92
|
+
`HETATM` records are excluded.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prot-rsa
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Fast protein residue surface-area calculation in Python
|
|
5
|
+
Author: Junjun Mao
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/newbooks/prot-rsa
|
|
8
|
+
Project-URL: Repository, https://github.com/newbooks/prot-rsa
|
|
9
|
+
Project-URL: Issues, https://github.com/newbooks/prot-rsa/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/newbooks/prot-rsa/blob/main/HISTORY.md
|
|
11
|
+
Project-URL: Documentation, https://github.com/newbooks/prot-rsa/blob/main/README.md
|
|
12
|
+
Keywords: bioinformatics,computational biology,protein,residue surface area,structural biology
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy
|
|
29
|
+
Requires-Dist: scipy
|
|
30
|
+
Requires-Dist: numba
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# prot-rsa
|
|
34
|
+
|
|
35
|
+
Fast protein residue surface-area calculation in Python.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Install the distribution from PyPI:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install prot-rsa
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Command-line use
|
|
46
|
+
|
|
47
|
+
Run the installed application with:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
prot-rsa structure.pdb
|
|
51
|
+
# optionally choose a lower sampling resolution (minimum 122 points)
|
|
52
|
+
prot-rsa structure.pdb --sphere-points 480
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Run `prot-rsa --help` to see the supported PDB/mmCIF input suffixes, calculation
|
|
56
|
+
options, defaults, and derived output filenames.
|
|
57
|
+
|
|
58
|
+
The command writes `<base>.atom_sas.tsv` and `<base>.res_sas.tsv` as TSV files, plus a
|
|
59
|
+
normalized `<base>.pqr` containing the selected radii and placeholder charge
|
|
60
|
+
`0.000`. The production calculation uses cKDTree neighbor pruning; the
|
|
61
|
+
deliberately naive serial implementation remains available as a correctness
|
|
62
|
+
reference.
|
|
63
|
+
|
|
64
|
+
## Python use
|
|
65
|
+
|
|
66
|
+
The application can also be imported as the `protrsa` module so its functions
|
|
67
|
+
and constants can be used directly:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
import protrsa
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The distribution and command are named `prot-rsa`. The import name is
|
|
74
|
+
`protrsa` because Python module names cannot contain hyphens.
|
|
75
|
+
|
|
76
|
+
## Residue exposure
|
|
77
|
+
|
|
78
|
+
Residue solvent-accessible surface area will be calculated by summing the
|
|
79
|
+
already computed atom SASAs for each residue. The residue report will contain
|
|
80
|
+
both complete-residue (`ALL`) and side-chain (`SIDE`) **Contextual Exposure
|
|
81
|
+
Fraction (CEF)** values rather than conventional RSA:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
CEF = selected-atom SASA in the complete protein
|
|
85
|
+
/ SASA of the same selected residue conformation in isolation
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The denominator is a naked-residue calculation using the same selected atoms,
|
|
89
|
+
atomic radii, probe radius, and sphere points, but without other residues
|
|
90
|
+
present. The compact output columns are `all`, `a_ref`, `a_cef`, `side`,
|
|
91
|
+
`s_ref`, and `s_cef`; leading `#` comment lines explain every field. CEF therefore represents
|
|
92
|
+
the fraction of the selected residue surface retained in its protein context.
|
|
93
|
+
It is distinct from conventional RSA, which normally uses a fixed residue-type
|
|
94
|
+
reference or maximum ASA.
|
|
95
|
+
|
|
96
|
+
Residues without retained side-chain atoms, such as glycine under the
|
|
97
|
+
canonical backbone definition, use `NA` for the three SIDE fields.
|
|
98
|
+
|
|
99
|
+
CEF lies in `[0, 1]` up to floating-point roundoff. The complete residue
|
|
100
|
+
output contract is documented in `docs/specs/residue-cef.md`.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Optimization Comparison
|
|
104
|
+
|
|
105
|
+
This program targets the speed optimization of residue surface solvent exposure calculation.
|
|
106
|
+
|
|
107
|
+
The table below compares protein RSA calculation times under each
|
|
108
|
+
optimization. Execution times are reported in seconds; lower values are
|
|
109
|
+
better.
|
|
110
|
+
|
|
111
|
+
| Optimization | Sphere points | Time (small) | Time (medium) | Time (large) | Atom-SASA MAE vs `*.sas.baseline` (small / medium / large, Ų) |
|
|
112
|
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
113
|
+
| Naive | 960 | 551 | 2185 | 11634 | 0.000 / 0.000 / 0.000 |
|
|
114
|
+
| cKDTree | 960 | 19.490 | 40.644 | 86.590 | 0.000 / 0.000 / 0.000 |
|
|
115
|
+
| Vectorized mask | 960 | 0.609 | 1.285 | 2.820 | 0.000 / 0.000 / 0.000 |
|
|
116
|
+
| Occlusion-ordered neighbors | 960 | 0.319 | 0.630 | 1.620 | 0.000 / 0.000 / 0.000 |
|
|
117
|
+
| Cache | 960 | 0.276 | 0.536 | 1.393 | 0.000 / 0.000 / 0.000 |
|
|
118
|
+
| Numba CPU | 960 | 0.328 | 0.388 | 0.735 | 0.000 / 0.000 / 0.000 |
|
|
119
|
+
| Reduced points | 480 | 0.358 | 0.382 | 0.494 | 0.164 / 0.145 / 0.184 |
|
|
120
|
+
|
|
121
|
+
Benchmark structures are **small** — 1LYZ (129 residues); **medium** — 1CA2
|
|
122
|
+
(256 residues); **large** — 1UOR (580 residues). Residue counts are the numbers
|
|
123
|
+
of unique residues represented by `ATOM` records; waters, ions, and other
|
|
124
|
+
`HETATM` records are excluded.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
HISTORY.md
|
|
2
|
+
LICENSE
|
|
3
|
+
MANIFEST.in
|
|
4
|
+
README.md
|
|
5
|
+
protrsa.py
|
|
6
|
+
pyproject.toml
|
|
7
|
+
prot_rsa.egg-info/PKG-INFO
|
|
8
|
+
prot_rsa.egg-info/SOURCES.txt
|
|
9
|
+
prot_rsa.egg-info/dependency_links.txt
|
|
10
|
+
prot_rsa.egg-info/entry_points.txt
|
|
11
|
+
prot_rsa.egg-info/requires.txt
|
|
12
|
+
prot_rsa.egg-info/top_level.txt
|
|
13
|
+
tests/test_atom_pipeline.py
|
|
14
|
+
tests/test_atom_sasa_naive.py
|
|
15
|
+
tests/test_atom_sasa_spatial.py
|
|
16
|
+
tests/test_cli.py
|
|
17
|
+
tests/test_residue_cef.py
|
|
18
|
+
tests/test_structure_reader.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
protrsa
|