rcsb-embedding-model 0.0.32__tar.gz → 0.0.33__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.32 → rcsb_embedding_model-0.0.33}/PKG-INFO +1 -1
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/pyproject.toml +1 -1
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/utils/data.py +4 -6
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/utils/structure_parser.py +25 -19
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/.dockerignore +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/.github/workflows/_workflow-docker.yaml +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/.github/workflows/publish.yaml +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/.gitignore +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/Dockerfile +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/LICENSE.md +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/README.md +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/assets/embedding-model-architecture.png +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/examples/esm_embeddings.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/__init__.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/cli/args_utils.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/cli/inference.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/dataset/esm_prot_from_chain.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/dataset/esm_prot_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/dataset/resdiue_assembly_embedding_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/dataset/residue_assembly_embedding_from_tensor_file.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/dataset/residue_embedding_from_structure.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/dataset/residue_embedding_from_tensor_file.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/inference/assembly_inferece.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/inference/chain_inference.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/inference/esm_inference.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/inference/structure_inference.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/model/layers.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/model/residue_embedding_aggregator.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/modules/chain_module.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/modules/esm_module.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/modules/structure_module.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/rcsb_structure_embedding.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/types/api_types.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/utils/model.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/utils/structure_provider.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/writer/batch_writer.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/1acb.A.pt +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/1acb.B.pt +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/2uzi.A.pt +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/2uzi.B.pt +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/2uzi.C.pt +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/pdb/1acb.cif +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/pdb/2uzi.cif +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/src_stream/assembly-complete-test.csv +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/src_stream/instance-complete-test.csv +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/src_stream/instance.csv +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/test_cli_inference.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/test_embedding_model.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/test_inference.py +0 -0
- {rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/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.33
|
|
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
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/utils/data.py
RENAMED
|
@@ -4,6 +4,7 @@ import gzip
|
|
|
4
4
|
from io import StringIO, BytesIO
|
|
5
5
|
|
|
6
6
|
import torch
|
|
7
|
+
from requests import RequestException
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
def collate_seq_embeddings(batch_list):
|
|
@@ -52,13 +53,10 @@ def stringio_from_url(url):
|
|
|
52
53
|
return StringIO(f.read())
|
|
53
54
|
else:
|
|
54
55
|
return StringIO(response.text)
|
|
55
|
-
except
|
|
56
|
-
|
|
57
|
-
return None
|
|
56
|
+
except RequestException as e:
|
|
57
|
+
raise RuntimeError(f"Error fetching URL: {e}")
|
|
58
58
|
except (OSError, gzip.BadGzipFile) as e:
|
|
59
|
-
|
|
60
|
-
return None
|
|
61
|
-
|
|
59
|
+
raise RuntimeError(f"Error decompressing gzip file: {e}")
|
|
62
60
|
|
|
63
61
|
|
|
64
62
|
def concatenate_tensors(file_list, max_residues, dim=0):
|
|
@@ -9,17 +9,20 @@ def get_structure_from_src(
|
|
|
9
9
|
chain_id=None,
|
|
10
10
|
assembly_id=None
|
|
11
11
|
):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
try:
|
|
13
|
+
if structure_format == "pdb":
|
|
14
|
+
pdb_file = PDBFile.read(src_structure)
|
|
15
|
+
structure = __get_pdb_structure(pdb_file, assembly_id)
|
|
16
|
+
elif structure_format == "mmcif":
|
|
17
|
+
cif_file = CIFFile.read(src_structure)
|
|
18
|
+
structure = __get_structure(cif_file, assembly_id)
|
|
19
|
+
elif structure_format == "binarycif":
|
|
20
|
+
cif_file = BinaryCIFFile.read(src_structure)
|
|
21
|
+
structure = __get_structure(cif_file, assembly_id)
|
|
22
|
+
else:
|
|
23
|
+
raise RuntimeError(f"Unknown file format {structure_format}")
|
|
24
|
+
except Exception as e:
|
|
25
|
+
raise RuntimeError(f"Error reading structure from {src_structure}: {e}")
|
|
23
26
|
|
|
24
27
|
if chain_id is not None:
|
|
25
28
|
return structure[structure.chain_id == chain_id]
|
|
@@ -38,14 +41,17 @@ def get_protein_chains(structure, min_res_n=0):
|
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
def get_assemblies(structure, structure_format="mmcif"):
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
try:
|
|
45
|
+
if structure_format == "pdb":
|
|
46
|
+
return tuple(list_pdb_assemblies(PDBFile.read(structure)))
|
|
47
|
+
elif structure_format == "mmcif":
|
|
48
|
+
return tuple(list_assemblies(CIFFile.read(structure)).keys())
|
|
49
|
+
elif structure_format == "binarycif":
|
|
50
|
+
return tuple(list_assemblies(BinaryCIFFile.read(structure)))
|
|
51
|
+
else:
|
|
52
|
+
raise RuntimeError(f"Unknown file format {structure_format}")
|
|
53
|
+
except Exception as e:
|
|
54
|
+
raise RuntimeError(f"Error reading assemblies from {structure}: {e}")
|
|
49
55
|
|
|
50
56
|
|
|
51
57
|
def rename_atom_ch(atom_ch, ch="A"):
|
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/.github/workflows/_workflow-docker.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/assets/embedding-model-architecture.png
RENAMED
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/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.32 → rcsb_embedding_model-0.0.33}/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.32 → rcsb_embedding_model-0.0.33}/src/rcsb_embedding_model/utils/model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/1acb.A.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/1acb.B.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/2uzi.A.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/2uzi.B.pt
RENAMED
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/embeddings/2uzi.C.pt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rcsb_embedding_model-0.0.32 → rcsb_embedding_model-0.0.33}/tests/resources/src_stream/instance.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|