stcrpy 1.0.0__py3-none-any.whl → 1.0.5__py3-none-any.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.
- stcrpy/__init__.py +1 -1
- stcrpy/tcr_formats/tcr_formats.py +20 -1
- stcrpy/tcr_geometry/TCRAngle.py +177 -0
- stcrpy/tcr_geometry/TCRDock.py +4 -1
- stcrpy/tcr_geometry/reference_data/Acoreset.txt +30 -0
- stcrpy/tcr_geometry/reference_data/Bcoreset.txt +30 -0
- stcrpy/tcr_geometry/reference_data/consensus_A.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/consensus_B.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/consensus_D.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/consensus_G.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/pcA.txt +3 -0
- stcrpy/tcr_geometry/reference_data/pcB.txt +3 -0
- stcrpy/tcr_interactions/TCRInteractionProfiler.py +1 -1
- stcrpy/tcr_interactions/TCRpMHC_PLIP_Model_Parser.py +21 -0
- stcrpy/tcr_methods/tcr_batch_operations.py +14 -10
- stcrpy/tcr_methods/tcr_methods.py +23 -22
- stcrpy/tcr_metrics/tcr_dockq.py +404 -0
- stcrpy/tcr_processing/Chemical_components.py +4 -4
- stcrpy/tcr_processing/Entity.py +15 -16
- stcrpy/tcr_processing/MHC.py +456 -4
- stcrpy/tcr_processing/TCR.py +462 -14
- stcrpy/tcr_processing/TCRParser.py +364 -193
- stcrpy/tcr_processing/annotate.py +35 -24
- stcrpy/tcr_processing/utils/common.py +3 -2
- stcrpy/tcr_processing/utils/constants.py +4 -3
- stcrpy/tcr_processing/utils/region_definitions.py +9 -0
- stcrpy/tcr_processing/utils/symmetry_mates.py +90 -0
- stcrpy-1.0.5.dist-info/METADATA +285 -0
- {stcrpy-1.0.0.dist-info → stcrpy-1.0.5.dist-info}/RECORD +33 -22
- {stcrpy-1.0.0.dist-info → stcrpy-1.0.5.dist-info}/WHEEL +1 -1
- stcrpy-1.0.0.dist-info/METADATA +0 -173
- {stcrpy-1.0.0.dist-info → stcrpy-1.0.5.dist-info}/licenses/LICENCE +0 -0
- {stcrpy-1.0.0.dist-info → stcrpy-1.0.5.dist-info}/licenses/stcrpy/tcr_geometry/TCRCoM_LICENCE +0 -0
- {stcrpy-1.0.0.dist-info → stcrpy-1.0.5.dist-info}/top_level.txt +0 -0
stcrpy-1.0.0.dist-info/METADATA
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: stcrpy
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: Set of methods to parse, annotate, and calculate features of TCR structures
|
|
5
|
-
Maintainer: Nele Quast
|
|
6
|
-
Maintainer-email: quast@stats.ox.ac.uk
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENCE
|
|
9
|
-
License-File: stcrpy/tcr_geometry/TCRCoM_LICENCE
|
|
10
|
-
Requires-Dist: biopython
|
|
11
|
-
Requires-Dist: numpy==1.26.4
|
|
12
|
-
Requires-Dist: lxml
|
|
13
|
-
Requires-Dist: openbabel-wheel==3.1.1.21
|
|
14
|
-
Requires-Dist: rdkit
|
|
15
|
-
Requires-Dist: anarci-mhc
|
|
16
|
-
Requires-Dist: pandas
|
|
17
|
-
Requires-Dist: matplotlib
|
|
18
|
-
Requires-Dist: scipy
|
|
19
|
-
Requires-Dist: requests
|
|
20
|
-
Requires-Dist: scikit-learn
|
|
21
|
-
Dynamic: description
|
|
22
|
-
Dynamic: description-content-type
|
|
23
|
-
Dynamic: license-file
|
|
24
|
-
Dynamic: maintainer
|
|
25
|
-
Dynamic: maintainer-email
|
|
26
|
-
Dynamic: requires-dist
|
|
27
|
-
Dynamic: summary
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<img src="./stcrpy_logo.png" alt="drawing" width="300"/>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
# STCRpy
|
|
35
|
-
[](https://github.com/npqst/STCRpy/actions/workflows/conda-workflow.yml)
|
|
36
|
-
[](https://github.com/npqst/STCRpy/actions/workflows/unittest-workflow.yml)
|
|
37
|
-
[](https://stcrpy.readthedocs.io/en/latest/)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Structural TCR python (STCRpy) is a software suite for analysing and processing T-cell receptor structures.
|
|
41
|
-
|
|
42
|
-
Please feel free to reach out with any comments or feedback.
|
|
43
|
-
|
|
44
|
-
Under review, please cite:
|
|
45
|
-
|
|
46
|
-
**Quast, N. , Deane, C., & Raybould, M. (2025). STCRpy: a software suite for TCR:pMHC structure parsing, interaction profiling, and machine learning dataset preparation. BioRxiv. https://doi.org/10.1101/2025.04.25.650667**
|
|
47
|
-
|
|
48
|
-
<img src="./stcrpy_main_fig.png" alt="drawing" width="1500"/>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# Installation
|
|
53
|
-
|
|
54
|
-
## TL;DR installation
|
|
55
|
-
```
|
|
56
|
-
pip install stcrpy
|
|
57
|
-
pip install plip
|
|
58
|
-
conda install -c conda-forge pymol-open-source numpy -y
|
|
59
|
-
ANARCI --build_models # this step will take a few minutes
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Step by step installation
|
|
63
|
-
We recommend installing STCRpy in a [conda](https://www.anaconda.com/docs/getting-started/miniconda/install#macos-linux-installation) (or [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html)) environment using python 3.9 to 3.12:
|
|
64
|
-
```
|
|
65
|
-
conda create -n stcrpy_env python==3.12 -y
|
|
66
|
-
conda activate stcrpy_env
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
The core functionality of STCRpy can be installed as follows:
|
|
70
|
-
```
|
|
71
|
-
pip install stcrpy
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
After installing stcrpy, the anarci HMM models must be built to enable annotation.
|
|
75
|
-
```
|
|
76
|
-
ANARCI --build_models # this step will take a few minutes
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
To enable interaction profiling, install PLIP (Adasme et. al., 2021):
|
|
80
|
-
```
|
|
81
|
-
pip install plip
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
To enable pymol visualisations, install pymol open source locally within the environment. Unfortunately, pymol currently needs to be installed even if you already have a pymol version. Be sure to install pymol within a managed conda (or mamba) environment to prevent interference with any existing versions.
|
|
85
|
-
```
|
|
86
|
-
conda install -c conda-forge pymol-open-source numpy -y
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
To generate pytorch and pytorch-geometric compatible datasets:
|
|
90
|
-
```
|
|
91
|
-
pip install pytorch --index-url https://download.pytorch.org/whl/cpu
|
|
92
|
-
pip install torch_geometric
|
|
93
|
-
```
|
|
94
|
-
Note that this installs the CPU version of pytorch, for GPU / CUDA versions install according to the [pytorch installation docs](https://pytorch.org/get-started/locally/).
|
|
95
|
-
|
|
96
|
-
The EGNN example also uses `einops`. To install:
|
|
97
|
-
```
|
|
98
|
-
pip install einops
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
# Documentation
|
|
102
|
-
STCRpy [documentation](https://stcrpy.readthedocs.io/en/latest/) is hosted on ReadtheDocs.
|
|
103
|
-
|
|
104
|
-
# Examples
|
|
105
|
-
STCRpy generates and operates on TCR structure objects. The majority of the API can be accessed through functions of the format: `tcr.some_stcrpy_function()`. TCR objects are associated with their MHC and antigen if these are presented in the structure.
|
|
106
|
-
|
|
107
|
-
A notebook with examples can be found under [examples/STCRpy_examples.ipynb](./examples/STCRpy_examples.ipynb)
|
|
108
|
-
|
|
109
|
-
First import STCRpy:
|
|
110
|
-
```
|
|
111
|
-
import stcrpy
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### To fetch a TCR structure from STCRDab or the PDB:
|
|
115
|
-
```
|
|
116
|
-
tcr = stcrpy.fetch_TCR("8gvb")
|
|
117
|
-
```
|
|
118
|
-
This will return a TCR strcuture or object, or, if there are multiple copies of TCR crystal structures in the PDB file, will return a list containing TCR structure objects. It may be useful to unpack the list into distinct objects, or use python generators to operate on the lists.
|
|
119
|
-
|
|
120
|
-
### To load a TCR structure from a PDB or MMCIF file:
|
|
121
|
-
```
|
|
122
|
-
tcr = stcrpy.load_TCR("filename.{pdb, cif}")
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### To load multiple TCR structures from a list of files at once:
|
|
126
|
-
```
|
|
127
|
-
multiple_tcrs = stcrpy.load_TCRs([file_1, file_2, file_3])
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### To save a TCR object to PDB or MMCIF files:
|
|
131
|
-
```
|
|
132
|
-
tcr.save(filename.{pdb, cif}) # save the TCR and it's associated MHC and antigen
|
|
133
|
-
tcr.save(filename.{pdb, cif}, TCR_only=True) # save the TCR only
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### To calculate the TCR to pMHC geometry:
|
|
137
|
-
```
|
|
138
|
-
tcr.calculate_geometry() # change the 'mode' keyword argument to change the geometry calculation method. See paper / documentation for details.
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### To score the TCR to pMHC geometry:
|
|
142
|
-
```
|
|
143
|
-
tcr.score_docking_geometry()
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### To profile interactions:
|
|
147
|
-
```
|
|
148
|
-
tcr.profile_peptide_interactions() # interaction profiling parameters can be adjusted, see documentation for details
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### To visualise interactions:
|
|
152
|
-
```
|
|
153
|
-
tcr.visualise_interactions()
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### To run full analysis on a set of TCR structures:
|
|
157
|
-
```
|
|
158
|
-
from stcrpy.tcr_methods.tcr_batch_operations import analyse_tcrs
|
|
159
|
-
germlines_and_alleles_df, geometries_df, interactions_df = analyse_tcrs(list_or_dict_of_files)
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### To generate graph datasets:
|
|
163
|
-
```
|
|
164
|
-
dataset = TCRGraphDataset(
|
|
165
|
-
root=PATH_TO_DATASET,
|
|
166
|
-
data_paths=PATH_TO_TCR_FILES
|
|
167
|
-
)
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
File without changes
|
{stcrpy-1.0.0.dist-info → stcrpy-1.0.5.dist-info}/licenses/stcrpy/tcr_geometry/TCRCoM_LICENCE
RENAMED
|
File without changes
|
|
File without changes
|