rcsb-embedding-model 0.0.11__tar.gz → 0.0.13__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.
Potentially problematic release.
This version of rcsb-embedding-model might be problematic. Click here for more details.
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/PKG-INFO +2 -2
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/README.md +1 -1
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/pyproject.toml +1 -1
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/dataset/resdiue_assembly_embedding_from_structure.py +3 -3
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/utils/data.py +1 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/utils/structure_parser.py +4 -4
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/test_remote_inference.py +21 -1
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/.gitignore +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/LICENSE.md +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/assets/embedding-model-architecture.png +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/examples/esm_embeddings.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/__init__.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/cli/args_utils.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/cli/inference.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/dataset/esm_prot_from_chain.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/dataset/esm_prot_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/dataset/residue_assembly_embedding_from_tensor_file.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/dataset/residue_embedding_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/dataset/residue_embedding_from_tensor_file.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/inference/assembly_inferece.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/inference/chain_inference.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/inference/esm_inference.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/inference/structure_inference.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/model/layers.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/model/residue_embedding_aggregator.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/modules/chain_module.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/modules/esm_module.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/modules/structure_module.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/rcsb_structure_embedding.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/types/api_types.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/utils/model.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/utils/structure_provider.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/writer/batch_writer.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/1acb.A.pt +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/1acb.B.pt +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/2uzi.A.pt +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/2uzi.B.pt +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/2uzi.C.pt +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/esm-from-chain-inference.csv +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/pdb/1acb.cif +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/pdb/2uzi.cif +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/test_embedding_model.py +0 -0
- {rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/test_inference.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rcsb-embedding-model
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Summary: Protein Embedding Model for Structure Search
|
|
5
5
|
Project-URL: Homepage, https://github.com/rcsb/rcsb-embedding-model
|
|
6
6
|
Project-URL: Issues, https://github.com/rcsb/rcsb-embedding-model/issues
|
|
@@ -18,7 +18,7 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
|
|
19
19
|
# RCSB Embedding Model
|
|
20
20
|
|
|
21
|
-
**Version** 0.0.
|
|
21
|
+
**Version** 0.0.13
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
## Overview
|
|
@@ -37,7 +37,7 @@ class ResidueAssemblyDatasetFromStructure(ResidueAssemblyEmbeddingFromTensorFile
|
|
|
37
37
|
super().__init__(
|
|
38
38
|
src_stream=self.__get_assemblies(src_stream),
|
|
39
39
|
res_embedding_location=res_embedding_location,
|
|
40
|
-
src_location=
|
|
40
|
+
src_location=SrcLocation.stream,
|
|
41
41
|
structure_location=structure_location,
|
|
42
42
|
structure_format=structure_format,
|
|
43
43
|
min_res_n=min_res_n,
|
|
@@ -60,9 +60,9 @@ class ResidueAssemblyDatasetFromStructure(ResidueAssemblyEmbeddingFromTensorFile
|
|
|
60
60
|
)).iterrows():
|
|
61
61
|
src_name = row[ResidueAssemblyDatasetFromStructure.STREAM_NAME_ATTR]
|
|
62
62
|
src_structure = row[ResidueAssemblyDatasetFromStructure.STREAM_ATTR]
|
|
63
|
-
|
|
63
|
+
structure = stringio_from_url(src_structure) if self.structure_location == StructureLocation.remote else src_structure
|
|
64
64
|
item_name = row[ResidueAssemblyDatasetFromStructure.ITEM_NAME_ATTR]
|
|
65
|
-
for assembly_id in get_assemblies(
|
|
65
|
+
for assembly_id in get_assemblies(structure=structure, structure_format=self.structure_format):
|
|
66
66
|
assemblies.append((src_name, src_structure, str(assembly_id), f"{item_name}.{assembly_id}"))
|
|
67
67
|
|
|
68
68
|
return tuple(assemblies)
|
|
@@ -37,13 +37,13 @@ def get_protein_chains(structure, min_res_n=0):
|
|
|
37
37
|
return tuple(chain_ids)
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
def get_assemblies(
|
|
40
|
+
def get_assemblies(structure, structure_format="mmcif"):
|
|
41
41
|
if structure_format == "pdb":
|
|
42
|
-
return tuple(list_pdb_assemblies(PDBFile.read(
|
|
42
|
+
return tuple(list_pdb_assemblies(PDBFile.read(structure)))
|
|
43
43
|
elif structure_format == "mmcif":
|
|
44
|
-
return tuple(list_assemblies(CIFFile.read(
|
|
44
|
+
return tuple(list_assemblies(CIFFile.read(structure)).keys())
|
|
45
45
|
elif structure_format == "binarycif":
|
|
46
|
-
return tuple(list_assemblies(BinaryCIFFile.read(
|
|
46
|
+
return tuple(list_assemblies(BinaryCIFFile.read(structure)))
|
|
47
47
|
else:
|
|
48
48
|
raise RuntimeError(f"Unknown file format {structure_format}")
|
|
49
49
|
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import os.path
|
|
1
2
|
import unittest
|
|
2
3
|
|
|
3
4
|
from rcsb_embedding_model.types.api_types import SrcLocation, SrcProteinFrom, StructureLocation, StructureFormat, \
|
|
4
|
-
Accelerator
|
|
5
|
+
Accelerator, SrcAssemblyFrom
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class TestRemoteInference(unittest.TestCase):
|
|
8
9
|
|
|
10
|
+
__test_path = os.path.dirname(__file__)
|
|
11
|
+
|
|
9
12
|
def test_esm_inference_from_structure(self):
|
|
10
13
|
from rcsb_embedding_model.inference.esm_inference import predict
|
|
11
14
|
|
|
@@ -26,3 +29,20 @@ class TestRemoteInference(unittest.TestCase):
|
|
|
26
29
|
for idx, shape in enumerate(shapes):
|
|
27
30
|
self.assertEqual(tuple(esm_embeddings[idx][0][0].shape), shape)
|
|
28
31
|
|
|
32
|
+
def test_assembly_inference_from_structure(self):
|
|
33
|
+
from rcsb_embedding_model.inference.assembly_inferece import predict
|
|
34
|
+
|
|
35
|
+
assembly_embeddings = predict(
|
|
36
|
+
src_stream=[
|
|
37
|
+
("1acb", "https://files.rcsb.org/download/1acb.cif", "1acb"),
|
|
38
|
+
("2uzi", "https://files.rcsb.org/download/2uzi.cif", "2uzi")
|
|
39
|
+
],
|
|
40
|
+
res_embedding_location=f"{self.__test_path}/resources/embeddings",
|
|
41
|
+
src_location=SrcLocation.stream,
|
|
42
|
+
src_from=SrcAssemblyFrom.structure,
|
|
43
|
+
structure_location=StructureLocation.remote,
|
|
44
|
+
structure_format=StructureFormat.mmcif,
|
|
45
|
+
accelerator=Accelerator.cpu
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
self.assertEqual(len(assembly_embeddings), 2)
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/assets/embedding-model-architecture.png
RENAMED
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/model/layers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/src/rcsb_embedding_model/utils/model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/1acb.A.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/1acb.B.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/2uzi.A.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/2uzi.B.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.11 → rcsb_embedding_model-0.0.13}/tests/resources/embeddings/2uzi.C.pt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|