rcsb-embedding-model 0.0.32__py3-none-any.whl → 0.0.33__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.

Potentially problematic release.


This version of rcsb-embedding-model might be problematic. Click here for more details.

@@ -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 requests.exceptions.RequestException as e:
56
- print(f"Error fetching URL: {e}")
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
- print(f"Error decompressing gzip file: {e}")
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
- if structure_format == "pdb":
13
- pdb_file = PDBFile.read(src_structure)
14
- structure = __get_pdb_structure(pdb_file, assembly_id)
15
- elif structure_format == "mmcif":
16
- cif_file = CIFFile.read(src_structure)
17
- structure = __get_structure(cif_file, assembly_id)
18
- elif structure_format == "binarycif":
19
- cif_file = BinaryCIFFile.read(src_structure)
20
- structure = __get_structure(cif_file, assembly_id)
21
- else:
22
- raise RuntimeError(f"Unknown file format {structure_format}")
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
- if structure_format == "pdb":
42
- return tuple(list_pdb_assemblies(PDBFile.read(structure)))
43
- elif structure_format == "mmcif":
44
- return tuple(list_assemblies(CIFFile.read(structure)).keys())
45
- elif structure_format == "binarycif":
46
- return tuple(list_assemblies(BinaryCIFFile.read(structure)))
47
- else:
48
- raise RuntimeError(f"Unknown file format {structure_format}")
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"):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rcsb-embedding-model
3
- Version: 0.0.32
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
@@ -18,13 +18,13 @@ rcsb_embedding_model/modules/chain_module.py,sha256=KsZw2uagO4rpAKWv6ivqEMxIEzgt
18
18
  rcsb_embedding_model/modules/esm_module.py,sha256=otJRbCb319nCCob_4E1W_UClhkex9eDqcCyzWQO-vIs,740
19
19
  rcsb_embedding_model/modules/structure_module.py,sha256=4js02XzKvhc_G26ELsGhJ9SCi_wlvtVolObxfWt3BhE,1077
20
20
  rcsb_embedding_model/types/api_types.py,sha256=SCwALwvEb0KRKaoWKbuN7JyfOH-1whsI0Z4ki41dht8,1235
21
- rcsb_embedding_model/utils/data.py,sha256=BOjYdIRHrFqk8qFuKGrgCtVyfDupzgOVmH_0C-ecMvg,3813
21
+ rcsb_embedding_model/utils/data.py,sha256=ThrcYycIizsV_Ycn6PPxF12JRr1m2K-v8TsIaVqx10A,3816
22
22
  rcsb_embedding_model/utils/model.py,sha256=xr3p02ohOgJ5UInwdIupN68Oq4yvNFhxobZRacS1adg,953
23
- rcsb_embedding_model/utils/structure_parser.py,sha256=z_Aid5QgGUAJkLL-fMzG2Uh2wPrHXmBdjhLn_YkPl-k,3035
23
+ rcsb_embedding_model/utils/structure_parser.py,sha256=mS70NcliGETWPdr0rOiypiR-u_N_H6HeRoZKwVfQrAU,3342
24
24
  rcsb_embedding_model/utils/structure_provider.py,sha256=eWtxjkPpmRfmil_DKR1J6miaXR3lQ28DF5O0qrqSgGA,786
25
25
  rcsb_embedding_model/writer/batch_writer.py,sha256=rTFNasB0Xp4-XCNTXKeEWZxSrb7lvZytoRldJUWn9Jg,3312
26
- rcsb_embedding_model-0.0.32.dist-info/METADATA,sha256=JWSb2a_wZ2Y8YWzyM3vk_QG--ukrIGsI5Q1-R3bApjs,5351
27
- rcsb_embedding_model-0.0.32.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
- rcsb_embedding_model-0.0.32.dist-info/entry_points.txt,sha256=MK11jTIEmaV-x4CkPX5IymDaVs7Ky_f2xxU8BJVZ_9Q,69
29
- rcsb_embedding_model-0.0.32.dist-info/licenses/LICENSE.md,sha256=oUaHiKgfBkChth_Sm67WemEvatO1U0Go8LHjaskXY0w,1522
30
- rcsb_embedding_model-0.0.32.dist-info/RECORD,,
26
+ rcsb_embedding_model-0.0.33.dist-info/METADATA,sha256=eOV5-e3IlkBYzZlIduZSLGB1k7VwvliKsF6Jf0QZaOQ,5351
27
+ rcsb_embedding_model-0.0.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ rcsb_embedding_model-0.0.33.dist-info/entry_points.txt,sha256=MK11jTIEmaV-x4CkPX5IymDaVs7Ky_f2xxU8BJVZ_9Q,69
29
+ rcsb_embedding_model-0.0.33.dist-info/licenses/LICENSE.md,sha256=oUaHiKgfBkChth_Sm67WemEvatO1U0Go8LHjaskXY0w,1522
30
+ rcsb_embedding_model-0.0.33.dist-info/RECORD,,