pidibble 1.4.0__tar.gz → 1.4.2__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.
Files changed (52) hide show
  1. {pidibble-1.4.0 → pidibble-1.4.2}/PKG-INFO +5 -1
  2. {pidibble-1.4.0 → pidibble-1.4.2}/README.md +4 -0
  3. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/pdbparse.py +14 -12
  4. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/pdbrecord.py +6 -1
  5. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/resources/pdb_format.yaml +2 -1
  6. {pidibble-1.4.0 → pidibble-1.4.2}/pyproject.toml +1 -1
  7. {pidibble-1.4.0 → pidibble-1.4.2}/.github/workflows/release.yaml +0 -0
  8. {pidibble-1.4.0 → pidibble-1.4.2}/.gitignore +0 -0
  9. {pidibble-1.4.0 → pidibble-1.4.2}/.readthedocs.yaml +0 -0
  10. {pidibble-1.4.0 → pidibble-1.4.2}/LICENSE +0 -0
  11. {pidibble-1.4.0 → pidibble-1.4.2}/MANIFEST.in +0 -0
  12. {pidibble-1.4.0 → pidibble-1.4.2}/docs/Makefile +0 -0
  13. {pidibble-1.4.0 → pidibble-1.4.2}/docs/make.bat +0 -0
  14. {pidibble-1.4.0 → pidibble-1.4.2}/docs/requirements.txt +0 -0
  15. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/_static/css/custom.css +0 -0
  16. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/API.rst +0 -0
  17. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.baseparsers.rst +0 -0
  18. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.baserecord.rst +0 -0
  19. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.hex.rst +0 -0
  20. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.mmcif_parse.rst +0 -0
  21. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.pdbparse.rst +0 -0
  22. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.pdbrecord.rst +0 -0
  23. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.resources.rst +0 -0
  24. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/api/pidibble.rst +0 -0
  25. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/conf.py +0 -0
  26. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/index.rst +0 -0
  27. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/installation.rst +0 -0
  28. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/notes.md +0 -0
  29. {pidibble-1.4.0 → pidibble-1.4.2}/docs/source/usage.rst +0 -0
  30. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/__init__.py +0 -0
  31. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/baseparsers.py +0 -0
  32. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/baserecord.py +0 -0
  33. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/hex.py +0 -0
  34. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/mmcif_parse.py +0 -0
  35. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/resources/__init__.py +0 -0
  36. {pidibble-1.4.0 → pidibble-1.4.2}/pidibble/resources/mmcif_format.yaml +0 -0
  37. {pidibble-1.4.0 → pidibble-1.4.2}/tests/__init__.py +0 -0
  38. {pidibble-1.4.0 → pidibble-1.4.2}/tests/conftest.py +0 -0
  39. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_hex/my_system.pdb +0 -0
  40. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_hex.py +0 -0
  41. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/4tvp.cif +0 -0
  42. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/4tvp.pdb +0 -0
  43. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/4zmj-newresnames.pdb +0 -0
  44. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/4zmj.cif +0 -0
  45. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/4zmj.pdb +0 -0
  46. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/6m0j.pdb +0 -0
  47. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/8fae.cif +0 -0
  48. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/G.pdb +0 -0
  49. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/GG.pdb +0 -0
  50. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/test.pdb +0 -0
  51. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb/test_pdb_format.yaml +0 -0
  52. {pidibble-1.4.0 → pidibble-1.4.2}/tests/unit/test_rcsb.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pidibble
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: A complete Protein Data Bank (PDB) file parser
5
5
  Project-URL: Source, https://github.com/cameronabrams/pidibble
6
6
  Project-URL: Documentation, https://pidibble.readthedocs.io/en/latest/
@@ -91,6 +91,10 @@ ATOM
91
91
  ```
92
92
 
93
93
  ## Release History
94
+ * 1.4.2
95
+ * updated alphafold interface
96
+ * 1.4.1
97
+ * Fixed parsing bug in `PDBRecordList`
94
98
  * 1.4.0
95
99
  * Introduced `PDBRecordList` and `PDBRecordDict` classes
96
100
  * 1.3.3
@@ -73,6 +73,10 @@ ATOM
73
73
  ```
74
74
 
75
75
  ## Release History
76
+ * 1.4.2
77
+ * updated alphafold interface
78
+ * 1.4.1
79
+ * Fixed parsing bug in `PDBRecordList`
76
80
  * 1.4.0
77
81
  * Introduced `PDBRecordList` and `PDBRecordDict` classes
78
82
  * 1.3.3
@@ -14,7 +14,6 @@ import yaml
14
14
  import numpy as np
15
15
  from pathlib import Path
16
16
  from mmcif.io.IoAdapterCore import IoAdapterCore
17
- from typing import List, Dict
18
17
  from . import resources
19
18
  from .baseparsers import ListParsers, ListParser, str2int_sig, safe_float
20
19
  from .baserecord import BaseRecordParser
@@ -144,8 +143,9 @@ class PDBParser:
144
143
  self.filepath=f'{self.alphafold}.pdb'
145
144
  BASE_URL=self.pdb_format_dict['ALPHAFOLD_API_URL']
146
145
  target_url=os.path.join(BASE_URL,self.alphafold)
146
+ logger.debug(f'target url {target_url}')
147
147
  try:
148
- urllib.request.urlretrieve(target_url,f'{self.alphafold}.json')
148
+ urllib.request.urlretrieve(target_url+r'?key='+self.pdb_format_dict['ALPHAFOLD_API_KEY'],f'{self.alphafold}.json')
149
149
  except:
150
150
  logger.warning(f'Could not fetch metadata for entry with accession code {self.alphafold} from AlphaFold')
151
151
  return False
@@ -407,13 +407,15 @@ def get_symm_ops(rec:PDBRecord):
407
407
  T : :class:`numpy.ndarray`
408
408
  The 3x1 translation vector.
409
409
  """
410
- M=np.identity(3)
411
- T=np.array([0.,0.,0.])
412
- assert len(rec.row)==3,f'a transformation matrix record should not have more than 3 rows'
413
- for c,r in zip(rec.coordinate,rec.row):
414
- row=c-1
415
- M[row][0]=r.m1
416
- M[row][1]=r.m2
417
- M[row][2]=r.m3
418
- T[row]=r.t
419
- return M,T
410
+ M = np.identity(3)
411
+ T = np.array([0., 0., 0.])
412
+ if not (hasattr(rec, 'row') and hasattr(rec, 'coordinate')):
413
+ raise ValueError('Invalid PDBRecord: missing row or coordinate attributes')
414
+ assert len(rec.row) == 3, f'a transformation matrix record should not have more than 3 rows'
415
+ for c, r in zip(rec.coordinate, rec.row):
416
+ row = c - 1
417
+ M[row][0] = r.m1
418
+ M[row][1] = r.m2
419
+ M[row][2] = r.m3
420
+ T[row] = r.t
421
+ return M, T
@@ -7,10 +7,12 @@
7
7
  .. moduleauthor: Cameron F. Abrams, <cfa22@drexel.edu>
8
8
 
9
9
  """
10
+ from __future__ import annotations
10
11
  from collections import UserList, UserDict
11
12
  from .baserecord import BaseRecord, BaseRecordParser
12
13
  from .baseparsers import StringParser
13
14
  import logging
15
+
14
16
  logger=logging.getLogger(__name__)
15
17
 
16
18
  class tokengroup:
@@ -130,6 +132,9 @@ class PDBRecord(BaseRecord):
130
132
  inst.format=current_format
131
133
  return inst
132
134
 
135
+ def __repr__(self):
136
+ return f'<PDBRecord {self.__dict__}>'
137
+
133
138
  def get_token(self,key):
134
139
  """
135
140
  Retrieve a token value from the PDBRecord instance based on the provided key.
@@ -482,7 +487,7 @@ class PDBRecordList(UserList):
482
487
 
483
488
  def __add__(self, other):
484
489
  self._validate_all(other)
485
- return AList(super().__add__(other))
490
+ return PDBRecordList(super().__add__(other))
486
491
 
487
492
  def __iadd__(self, other):
488
493
  self._validate_all(other)
@@ -11,7 +11,8 @@
11
11
  # 1. 28-FEB-2024: Alphafold stuff
12
12
  #
13
13
  BASE_URL: https://files.rcsb.org/download
14
- ALPHAFOLD_API_URL: https://alphafold.com/api/prediction
14
+ ALPHAFOLD_API_URL: https://alphafold.ebi.ac.uk/api/prediction
15
+ ALPHAFOLD_API_KEY: AIzaSyCeurAJz7ZGjPQUtEaerUkBZ3TaBkXrY94
15
16
  record_types:
16
17
  1: one-time-single-line
17
18
  2: one-time-multiple-line
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "pidibble"
6
- version = "1.4.0"
6
+ version = "1.4.2"
7
7
  authors = [
8
8
  { name="Cameron F Abrams", email="cfa22@drexel.edu" },
9
9
  ]
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
File without changes
File without changes