stcrpy 1.0.0__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.
- examples/__init__.py +0 -0
- examples/egnn.py +425 -0
- stcrpy/__init__.py +5 -0
- stcrpy/tcr_datasets/__init__.py +0 -0
- stcrpy/tcr_datasets/tcr_graph_dataset.py +499 -0
- stcrpy/tcr_datasets/tcr_selector.py +0 -0
- stcrpy/tcr_datasets/tcr_structure_dataset.py +0 -0
- stcrpy/tcr_datasets/utils.py +350 -0
- stcrpy/tcr_formats/__init__.py +0 -0
- stcrpy/tcr_formats/tcr_formats.py +114 -0
- stcrpy/tcr_formats/tcr_haddock.py +556 -0
- stcrpy/tcr_geometry/TCRCoM.py +350 -0
- stcrpy/tcr_geometry/TCRCoM_LICENCE +168 -0
- stcrpy/tcr_geometry/TCRDock.py +261 -0
- stcrpy/tcr_geometry/TCRGeom.py +450 -0
- stcrpy/tcr_geometry/TCRGeomFiltering.py +273 -0
- stcrpy/tcr_geometry/__init__.py +0 -0
- stcrpy/tcr_geometry/reference_data/__init__.py +0 -0
- stcrpy/tcr_geometry/reference_data/dock_reference_1_imgt_numbered.pdb +6549 -0
- stcrpy/tcr_geometry/reference_data/dock_reference_2_imgt_numbered.pdb +6495 -0
- stcrpy/tcr_geometry/reference_data/reference_A.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/reference_B.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/reference_D.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/reference_G.pdb +31 -0
- stcrpy/tcr_geometry/reference_data/reference_data.py +104 -0
- stcrpy/tcr_interactions/PLIPParser.py +147 -0
- stcrpy/tcr_interactions/TCRInteractionProfiler.py +433 -0
- stcrpy/tcr_interactions/TCRpMHC_PLIP_Model_Parser.py +133 -0
- stcrpy/tcr_interactions/__init__.py +0 -0
- stcrpy/tcr_interactions/utils.py +170 -0
- stcrpy/tcr_methods/__init__.py +0 -0
- stcrpy/tcr_methods/tcr_batch_operations.py +223 -0
- stcrpy/tcr_methods/tcr_methods.py +150 -0
- stcrpy/tcr_methods/tcr_reformatting.py +18 -0
- stcrpy/tcr_metrics/__init__.py +2 -0
- stcrpy/tcr_metrics/constants.py +39 -0
- stcrpy/tcr_metrics/tcr_interface_rmsd.py +237 -0
- stcrpy/tcr_metrics/tcr_rmsd.py +179 -0
- stcrpy/tcr_ml/__init__.py +0 -0
- stcrpy/tcr_ml/geometry_predictor.py +3 -0
- stcrpy/tcr_processing/AGchain.py +89 -0
- stcrpy/tcr_processing/Chemical_components.py +48915 -0
- stcrpy/tcr_processing/Entity.py +301 -0
- stcrpy/tcr_processing/Fragment.py +58 -0
- stcrpy/tcr_processing/Holder.py +24 -0
- stcrpy/tcr_processing/MHC.py +449 -0
- stcrpy/tcr_processing/MHCchain.py +149 -0
- stcrpy/tcr_processing/Model.py +37 -0
- stcrpy/tcr_processing/Select.py +145 -0
- stcrpy/tcr_processing/TCR.py +532 -0
- stcrpy/tcr_processing/TCRIO.py +47 -0
- stcrpy/tcr_processing/TCRParser.py +1230 -0
- stcrpy/tcr_processing/TCRStructure.py +148 -0
- stcrpy/tcr_processing/TCRchain.py +160 -0
- stcrpy/tcr_processing/__init__.py +3 -0
- stcrpy/tcr_processing/annotate.py +480 -0
- stcrpy/tcr_processing/utils/__init__.py +0 -0
- stcrpy/tcr_processing/utils/common.py +67 -0
- stcrpy/tcr_processing/utils/constants.py +367 -0
- stcrpy/tcr_processing/utils/region_definitions.py +782 -0
- stcrpy/utils/__init__.py +0 -0
- stcrpy/utils/error_stream.py +12 -0
- stcrpy-1.0.0.dist-info/METADATA +173 -0
- stcrpy-1.0.0.dist-info/RECORD +68 -0
- stcrpy-1.0.0.dist-info/WHEEL +5 -0
- stcrpy-1.0.0.dist-info/licenses/LICENCE +28 -0
- stcrpy-1.0.0.dist-info/licenses/stcrpy/tcr_geometry/TCRCoM_LICENCE +168 -0
- stcrpy-1.0.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from Bio import PDB
|
|
2
|
+
from Bio.PDB.PDBIO import PDBIO
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class TCRIO(PDBIO):
|
|
6
|
+
def __init__(self):
|
|
7
|
+
self.io = PDBIO()
|
|
8
|
+
|
|
9
|
+
def save(
|
|
10
|
+
self,
|
|
11
|
+
tcr: "TCR",
|
|
12
|
+
save_as: str = None,
|
|
13
|
+
tcr_only: bool = False,
|
|
14
|
+
format: str = "pdb",
|
|
15
|
+
):
|
|
16
|
+
assert (
|
|
17
|
+
tcr.__module__.split(".")[-1] == "TCR"
|
|
18
|
+
), f"{tcr} must be type TCR, not TCRStructure"
|
|
19
|
+
structure_to_save = PDB.Model.Model(0)
|
|
20
|
+
for chain in tcr.get_chains():
|
|
21
|
+
chain.serial_num = 0
|
|
22
|
+
structure_to_save.add(chain)
|
|
23
|
+
if not tcr_only:
|
|
24
|
+
for mhc in tcr.get_MHC():
|
|
25
|
+
if (
|
|
26
|
+
mhc.__class__.__name__ == "MHCchain"
|
|
27
|
+
): # handle MHC that is single chain
|
|
28
|
+
chain = mhc
|
|
29
|
+
chain.serial_num = 0
|
|
30
|
+
structure_to_save.add(chain)
|
|
31
|
+
else:
|
|
32
|
+
for chain in mhc.get_chains(): # handle multichain MHC object
|
|
33
|
+
chain.serial_num = 0
|
|
34
|
+
structure_to_save.add(chain)
|
|
35
|
+
|
|
36
|
+
for chain in tcr.get_antigen():
|
|
37
|
+
chain.serial_num = 0
|
|
38
|
+
structure_to_save.add(chain)
|
|
39
|
+
|
|
40
|
+
self.io.set_structure(structure_to_save)
|
|
41
|
+
if not save_as:
|
|
42
|
+
if not tcr_only:
|
|
43
|
+
save_as = f"{tcr.parent.parent.id}_{tcr.id}.{format}"
|
|
44
|
+
else:
|
|
45
|
+
save_as = f"{tcr.parent.parent.id}_{tcr.id}_TCR_only.{format}"
|
|
46
|
+
|
|
47
|
+
self.io.save(save_as)
|