pidibble 1.3.0__tar.gz → 1.3.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 (53) hide show
  1. {pidibble-1.3.0 → pidibble-1.3.2}/PKG-INFO +4 -1
  2. {pidibble-1.3.0 → pidibble-1.3.2}/README.md +3 -0
  3. pidibble-1.3.2/docs/requirements.txt +15 -0
  4. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/pdbparse.py +9 -2
  5. {pidibble-1.3.0 → pidibble-1.3.2}/pyproject.toml +1 -1
  6. pidibble-1.3.0/docs/requirements.txt +0 -8
  7. {pidibble-1.3.0 → pidibble-1.3.2}/.github/workflows/release.yaml +0 -0
  8. {pidibble-1.3.0 → pidibble-1.3.2}/.gitignore +0 -0
  9. {pidibble-1.3.0 → pidibble-1.3.2}/.readthedocs.yaml +0 -0
  10. {pidibble-1.3.0 → pidibble-1.3.2}/LICENSE +0 -0
  11. {pidibble-1.3.0 → pidibble-1.3.2}/MANIFEST.in +0 -0
  12. {pidibble-1.3.0 → pidibble-1.3.2}/docs/Makefile +0 -0
  13. {pidibble-1.3.0 → pidibble-1.3.2}/docs/make.bat +0 -0
  14. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/_static/css/custom.css +0 -0
  15. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/API.rst +0 -0
  16. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.baseparsers.rst +0 -0
  17. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.baserecord.rst +0 -0
  18. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.hex.rst +0 -0
  19. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.mmcif_parse.rst +0 -0
  20. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.pdbparse.rst +0 -0
  21. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.pdbrecord.rst +0 -0
  22. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.resources.rst +0 -0
  23. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/api/pidibble.rst +0 -0
  24. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/conf.py +0 -0
  25. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/index.rst +0 -0
  26. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/installation.rst +0 -0
  27. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/notes.md +0 -0
  28. {pidibble-1.3.0 → pidibble-1.3.2}/docs/source/usage.rst +0 -0
  29. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/__init__.py +0 -0
  30. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/baseparsers.py +0 -0
  31. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/baserecord.py +0 -0
  32. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/hex.py +0 -0
  33. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/mmcif_parse.py +0 -0
  34. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/pdbrecord.py +0 -0
  35. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/resources/__init__.py +0 -0
  36. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/resources/mmcif_format.yaml +0 -0
  37. {pidibble-1.3.0 → pidibble-1.3.2}/pidibble/resources/pdb_format.yaml +0 -0
  38. {pidibble-1.3.0 → pidibble-1.3.2}/tests/__init__.py +0 -0
  39. {pidibble-1.3.0 → pidibble-1.3.2}/tests/conftest.py +0 -0
  40. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_hex/my_system.pdb +0 -0
  41. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_hex.py +0 -0
  42. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/4tvp.cif +0 -0
  43. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/4tvp.pdb +0 -0
  44. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/4zmj-newresnames.pdb +0 -0
  45. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/4zmj.cif +0 -0
  46. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/4zmj.pdb +0 -0
  47. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/6m0j.pdb +0 -0
  48. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/8fae.cif +0 -0
  49. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/G.pdb +0 -0
  50. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/GG.pdb +0 -0
  51. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/test.pdb +0 -0
  52. {pidibble-1.3.0 → pidibble-1.3.2}/tests/unit/test_rcsb/test_pdb_format.yaml +0 -0
  53. {pidibble-1.3.0 → pidibble-1.3.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.3.0
3
+ Version: 1.3.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,9 @@ ATOM
91
91
  ```
92
92
 
93
93
  ## Release History
94
+ * 1.3.2
95
+ * implemented `filepath` parameter in `PDBParser()` to make
96
+ reading local files more transparent
94
97
  * 1.3.0
95
98
  * streamline class attribute usage; full API documentation
96
99
  * 1.2.3:
@@ -73,6 +73,9 @@ ATOM
73
73
  ```
74
74
 
75
75
  ## Release History
76
+ * 1.3.2
77
+ * implemented `filepath` parameter in `PDBParser()` to make
78
+ reading local files more transparent
76
79
  * 1.3.0
77
80
  * streamline class attribute usage; full API documentation
78
81
  * 1.2.3:
@@ -0,0 +1,15 @@
1
+ pillow
2
+ mock==1.0.1
3
+ alabaster>=0.7,<0.8,!=0.7.5
4
+ commonmark==0.9.1
5
+ recommonmark==0.5.0
6
+ sphinx
7
+ sphinx-rtd-theme
8
+ readthedocs-sphinx-ext<2.3
9
+ furo
10
+ sphinx-copybutton
11
+ pidibble
12
+ readthedocs-sphinx-ext<2.3
13
+ sphinx-copybutton
14
+ sphinxcontrib-mermaid
15
+ pyyaml
@@ -12,6 +12,7 @@ import os
12
12
  import logging
13
13
  import yaml
14
14
  import numpy as np
15
+ from pathlib import Path
15
16
  from mmcif.io.IoAdapterCore import IoAdapterCore
16
17
  from . import resources
17
18
  from .baseparsers import ListParsers, ListParser, str2int_sig, safe_float
@@ -24,7 +25,6 @@ import importlib.metadata
24
25
  import json
25
26
  from .hex import str2atomSerial, hex_reset
26
27
 
27
-
28
28
  __version__ = importlib.metadata.version("pidibble")
29
29
 
30
30
  class PDBParser:
@@ -52,6 +52,7 @@ class PDBParser:
52
52
  input_format='PDB',
53
53
  overwrite=False,
54
54
  alphafold='',
55
+ filepath: Path = None,
55
56
  mappers={'HxInteger':str2atomSerial,'Integer':str2int_sig,'String':str,'Float':safe_float},
56
57
  pdbcode_synonyms=['PDBcode','pdb_code','pdbCode','pdbcode','pdbID','pdb_id','pdbid','PDBID','PDBId','PDBid'],
57
58
  comment_chars=['#'],
@@ -62,6 +63,7 @@ class PDBParser:
62
63
  self.input_format=input_format
63
64
  self.overwrite=overwrite
64
65
  self.alphafold=alphafold
66
+ self.filepath=filepath
65
67
  self.mappers=mappers
66
68
  self.mappers.update(ListParsers)
67
69
  self.pdb_code=''
@@ -118,7 +120,7 @@ class PDBParser:
118
120
  bool
119
121
  True if the file was successfully fetched, False otherwise.
120
122
  """
121
- assert self.pdb_code!='' or self.alphafold!=''
123
+ assert self.pdb_code!='' or self.alphafold!='' or self.filepath is not None, "PDB code or AlphaFold ID must be provided, or a path to a PDB file must be specified."
122
124
  if self.pdb_code!='':
123
125
  if self.input_format=='PDB':
124
126
  self.filepath=f'{self.pdb_code}.pdb'
@@ -153,6 +155,11 @@ class PDBParser:
153
155
  logger.warning(f'Could not retrieve {result[0]["pdbUrl"]}')
154
156
  return False
155
157
  return True
158
+ elif self.filepath is not None:
159
+ if not os.path.exists(self.filepath):
160
+ logger.warning(f'File {self.filepath} does not exist.')
161
+ return False
162
+ return True
156
163
  else:
157
164
  pass # assert statement at top of method body should suppress this branch
158
165
 
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "pidibble"
6
- version = "1.3.0"
6
+ version = "1.3.2"
7
7
  authors = [
8
8
  { name="Cameron F Abrams", email="cfa22@drexel.edu" },
9
9
  ]
@@ -1,8 +0,0 @@
1
- pillow
2
- mock==1.0.1
3
- alabaster>=0.7,<0.8,!=0.7.5
4
- commonmark==0.9.1
5
- recommonmark==0.5.0
6
- sphinx
7
- sphinx-rtd-theme
8
- readthedocs-sphinx-ext<2.3
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