rcsb-embedding-model 0.0.18__tar.gz → 0.0.19__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.18 → rcsb_embedding_model-0.0.19}/PKG-INFO +2 -2
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/README.md +1 -1
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/pyproject.toml +1 -1
- rcsb_embedding_model-0.0.19/src/rcsb_embedding_model/modules/esm_module.py +21 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/utils/data.py +1 -1
- rcsb_embedding_model-0.0.18/src/rcsb_embedding_model/modules/esm_module.py +0 -27
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/.github/workflows/_workflow-docker.yaml +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/.github/workflows/publish.yaml +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/.gitignore +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/Dockerfile +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/LICENSE.md +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/assets/embedding-model-architecture.png +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/examples/esm_embeddings.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/__init__.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/cli/args_utils.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/cli/inference.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/dataset/esm_prot_from_chain.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/dataset/esm_prot_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/dataset/resdiue_assembly_embedding_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/dataset/residue_assembly_embedding_from_tensor_file.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/dataset/residue_embedding_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/dataset/residue_embedding_from_tensor_file.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/inference/assembly_inferece.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/inference/chain_inference.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/inference/esm_inference.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/inference/structure_inference.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/model/layers.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/model/residue_embedding_aggregator.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/modules/chain_module.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/modules/structure_module.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/rcsb_structure_embedding.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/types/api_types.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/utils/model.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/utils/structure_parser.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/utils/structure_provider.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/writer/batch_writer.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/1acb.A.pt +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/1acb.B.pt +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/2uzi.A.pt +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/2uzi.B.pt +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/2uzi.C.pt +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/pdb/1acb.cif +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/pdb/2uzi.cif +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/test_embedding_model.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/test_inference.py +0 -0
- {rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/test_remote_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.19
|
|
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
|
|
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
|
|
18
18
|
# RCSB Embedding Model
|
|
19
19
|
|
|
20
|
-
**Version** 0.0.
|
|
20
|
+
**Version** 0.0.19
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
## Overview
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from esm.sdk.api import SamplingConfig
|
|
2
|
+
from lightning import LightningModule
|
|
3
|
+
|
|
4
|
+
from rcsb_embedding_model.utils.model import get_residue_model
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class EsmModule(LightningModule):
|
|
8
|
+
|
|
9
|
+
def __init__(
|
|
10
|
+
self
|
|
11
|
+
):
|
|
12
|
+
super().__init__()
|
|
13
|
+
self.esm3 = get_residue_model(self.device)
|
|
14
|
+
|
|
15
|
+
def predict_step(self, prot_batch, batch_idx):
|
|
16
|
+
return tuple([self.__compute_embeddings(esm_prot) for esm_prot, name in prot_batch]), tuple([name for esm_prot, name in prot_batch])
|
|
17
|
+
|
|
18
|
+
def __compute_embeddings(self, esm_prot):
|
|
19
|
+
return self.esm3.forward_and_sample(
|
|
20
|
+
self.esm3.encode(esm_prot), SamplingConfig(return_per_residue_embeddings=True)
|
|
21
|
+
).per_residue_embedding
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/utils/data.py
RENAMED
|
@@ -82,4 +82,4 @@ def adapt_csv_to_embedding_chain_stream(src_file, res_embedding_location):
|
|
|
82
82
|
def __parse_row(row):
|
|
83
83
|
r = row.split(",")
|
|
84
84
|
return os.path.join(res_embedding_location, f"{r[0]}.{r[2]}.pt"), f"{r[0]}.{r[2]}"
|
|
85
|
-
return tuple([__parse_row(r) for r in open(src_file)])
|
|
85
|
+
return tuple([__parse_row(r.strip()) for r in open(src_file)])
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from esm.sdk.api import SamplingConfig
|
|
2
|
-
from esm.sdk import batch_executor
|
|
3
|
-
from lightning import LightningModule
|
|
4
|
-
|
|
5
|
-
from rcsb_embedding_model.utils.model import get_residue_model
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class EsmModule(LightningModule):
|
|
9
|
-
|
|
10
|
-
def __init__(
|
|
11
|
-
self
|
|
12
|
-
):
|
|
13
|
-
super().__init__()
|
|
14
|
-
self.esm3 = get_residue_model(self.device)
|
|
15
|
-
|
|
16
|
-
def predict_step(self, prot_batch, batch_idx):
|
|
17
|
-
prot_embeddings = []
|
|
18
|
-
def __batch_embedding(esm_prot):
|
|
19
|
-
return self.esm3.forward_and_sample(
|
|
20
|
-
self.esm3.encode(esm_prot), SamplingConfig(return_per_residue_embeddings=True)
|
|
21
|
-
).per_residue_embedding
|
|
22
|
-
with batch_executor() as executor:
|
|
23
|
-
prot_embeddings = executor.execute_batch(
|
|
24
|
-
user_func=__batch_embedding,
|
|
25
|
-
esm_prot=[esm_prot for esm_prot, name in prot_batch]
|
|
26
|
-
)
|
|
27
|
-
return tuple(prot_embeddings), tuple([name for esm_prot, name in prot_batch])
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/.github/workflows/_workflow-docker.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/assets/embedding-model-architecture.png
RENAMED
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/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
|
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/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
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/src/rcsb_embedding_model/utils/model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/1acb.A.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/1acb.B.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/2uzi.A.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/tests/resources/embeddings/2uzi.B.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.18 → rcsb_embedding_model-0.0.19}/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
|