pidibble 1.1.8__tar.gz → 1.2.0__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 (41) hide show
  1. {pidibble-1.1.8 → pidibble-1.2.0}/PKG-INFO +5 -1
  2. {pidibble-1.1.8 → pidibble-1.2.0}/README.md +4 -0
  3. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/hex.py +5 -1
  4. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/pdbparse.py +6 -1
  5. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/resources/pdb_format.yaml +18 -18
  6. {pidibble-1.1.8 → pidibble-1.2.0}/pyproject.toml +1 -1
  7. {pidibble-1.1.8 → pidibble-1.2.0}/.gitignore +0 -0
  8. {pidibble-1.1.8 → pidibble-1.2.0}/.readthedocs.yaml +0 -0
  9. {pidibble-1.1.8 → pidibble-1.2.0}/LICENSE +0 -0
  10. {pidibble-1.1.8 → pidibble-1.2.0}/MANIFEST.in +0 -0
  11. {pidibble-1.1.8 → pidibble-1.2.0}/docs/Makefile +0 -0
  12. {pidibble-1.1.8 → pidibble-1.2.0}/docs/make.bat +0 -0
  13. {pidibble-1.1.8 → pidibble-1.2.0}/docs/requirements.txt +0 -0
  14. {pidibble-1.1.8 → pidibble-1.2.0}/docs/source/api.rst +0 -0
  15. {pidibble-1.1.8 → pidibble-1.2.0}/docs/source/conf.py +0 -0
  16. {pidibble-1.1.8 → pidibble-1.2.0}/docs/source/generated/pidibble.rst +0 -0
  17. {pidibble-1.1.8 → pidibble-1.2.0}/docs/source/index.rst +0 -0
  18. {pidibble-1.1.8 → pidibble-1.2.0}/docs/source/notes.md +0 -0
  19. {pidibble-1.1.8 → pidibble-1.2.0}/docs/source/usage.rst +0 -0
  20. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/__init__.py +0 -0
  21. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/baseparsers.py +0 -0
  22. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/baserecord.py +0 -0
  23. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/mmcif_parse.py +0 -0
  24. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/pdbrecord.py +0 -0
  25. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/resources/__init__.py +0 -0
  26. {pidibble-1.1.8 → pidibble-1.2.0}/pidibble/resources/mmcif_format.yaml +0 -0
  27. {pidibble-1.1.8 → pidibble-1.2.0}/tests/__init__.py +0 -0
  28. {pidibble-1.1.8 → pidibble-1.2.0}/tests/conftest.py +0 -0
  29. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_hex/my_system.pdb +0 -0
  30. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_hex.py +0 -0
  31. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/4tvp.cif +0 -0
  32. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/4tvp.pdb +0 -0
  33. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/4zmj-newresnames.pdb +0 -0
  34. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/4zmj.cif +0 -0
  35. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/4zmj.pdb +0 -0
  36. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/6m0j.pdb +0 -0
  37. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/G.pdb +0 -0
  38. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/GG.pdb +0 -0
  39. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/test.pdb +0 -0
  40. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb/test_pdb_format.yaml +0 -0
  41. {pidibble-1.1.8 → pidibble-1.2.0}/tests/unit/test_rcsb.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pidibble
3
- Version: 1.1.8
3
+ Version: 1.2.0
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/
@@ -88,6 +88,10 @@ ATOM
88
88
  ```
89
89
 
90
90
  ## Release History
91
+ * 1.2.0
92
+ * bugfix: hex issues again
93
+ * 1.1.9
94
+ * gently handles any nan values or '*' fillers
91
95
  * 1.1.8
92
96
  * Allow unstructured REMARK records (thanks a lot, packmol) to be parsed as REMARK.-1
93
97
  * 1.1.6
@@ -70,6 +70,10 @@ ATOM
70
70
  ```
71
71
 
72
72
  ## Release History
73
+ * 1.2.0
74
+ * bugfix: hex issues again
75
+ * 1.1.9
76
+ * gently handles any nan values or '*' fillers
73
77
  * 1.1.8
74
78
  * Allow unstructured REMARK records (thanks a lot, packmol) to be parsed as REMARK.-1
75
79
  * 1.1.6
@@ -2,8 +2,12 @@ __hex_tripped__=False
2
2
  def str2atomSerial(arg):
3
3
  global __hex_tripped__
4
4
  assert type(arg)==str
5
- if __hex_tripped__ or any([(x in arg) for x in 'abcdef']):
5
+ if arg=='nan':
6
+ return_object=0
7
+ elif __hex_tripped__ or any([(x in arg) for x in 'abcdef']):
6
8
  return_object=int(arg,16)
9
+ elif '*' in arg:
10
+ return_object=0
7
11
  else:
8
12
  return_object=int(arg)
9
13
  if return_object>99999 and not __hex_tripped__:
@@ -23,6 +23,11 @@ import importlib.metadata
23
23
  import json
24
24
  from .hex import str2atomSerial, hex_reset
25
25
 
26
+ def safe_float(x):
27
+ if x=='nan':
28
+ return 0.0
29
+ return float(x)
30
+
26
31
  __version__ = importlib.metadata.version("pidibble")
27
32
 
28
33
  def str2int_sig(arg):
@@ -31,7 +36,7 @@ def str2int_sig(arg):
31
36
 
32
37
  class PDBParser:
33
38
  # mappers={'Integer':int,'String':str,'Float':float}
34
- mappers={'HxInteger':str2atomSerial,'Integer':str2int_sig,'String':str,'Float':float}
39
+ mappers={'HxInteger':str2atomSerial,'Integer':str2int_sig,'String':str,'Float':safe_float}
35
40
  mappers.update(ListParsers)
36
41
  comment_lines=[]
37
42
  comment_chars=['#']
@@ -23,17 +23,17 @@ custom_formats:
23
23
  Residue10:
24
24
  resName: [String,[1,4]]
25
25
  chainID: [String,[5,5]]
26
- seqNum: [HxInteger,[6,9]]
26
+ seqNum: [Integer,[6,9]]
27
27
  iCode: [String,[10,10]]
28
28
  Residue11:
29
29
  resName: [String,[1,4]]
30
30
  chainID: [String,[5,5]]
31
- seqNum: [HxInteger,[7,10]]
31
+ seqNum: [Integer,[7,10]]
32
32
  iCode: [String,[11,11]]
33
33
  Residue12:
34
34
  resName: [String,[1,4]]
35
35
  chainID: [String,[5,5]]
36
- seqNum: [HxInteger,[7,11]]
36
+ seqNum: [Integer,[7,11]]
37
37
  iCode: [String,[12,12]]
38
38
  Biomtrow:
39
39
  m1: [Float,[1,10]]
@@ -85,16 +85,16 @@ record_formats:
85
85
  type: 1
86
86
  fields:
87
87
  numRemark: [Integer,[11,15]]
88
- numHet: [HxInteger,[21,25]]
88
+ numHet: [Integer,[21,25]]
89
89
  numHelix: [Integer,[26,30]]
90
90
  numSheet: [Integer,[31,35]]
91
91
  numTurn: [Integer,[36,40]]
92
92
  numSite: [Integer,[41,45]]
93
93
  numXform: [Integer,[46,50]]
94
- numCoord: [HxInteger,[51,55]]
94
+ numCoord: [Integer,[51,55]]
95
95
  numTer: [Integer,[56,60]]
96
- numConect: [HxInteger,[61,65]]
97
- numSeq: [HxInteger,[66,70]]
96
+ numConect: [Integer,[61,65]]
97
+ numSeq: [Integer,[66,70]]
98
98
  ORIGX1:
99
99
  type: 1
100
100
  fields:
@@ -350,7 +350,7 @@ record_formats:
350
350
  CISPEP:
351
351
  type: 3
352
352
  fields:
353
- serNum: [HxInteger,[8,10]]
353
+ serNum: [Integer,[8,10]]
354
354
  residue1: [Residue11,[12,22]]
355
355
  residue2: [Residue11,[26,36]]
356
356
  modNum: [Integer,[44,46]]
@@ -374,24 +374,24 @@ record_formats:
374
374
  fields:
375
375
  idCode: [String,[8,11]]
376
376
  chainID: [String,[13,13]]
377
- seqBegin: [HxInteger,[15,18]]
377
+ seqBegin: [Integer,[15,18]]
378
378
  insertBegin: [String,[19,19]]
379
- seqEnd: [HxInteger,[21,24]]
379
+ seqEnd: [Integer,[21,24]]
380
380
  insertEnd: [String,[25,25]]
381
381
  database: [String,[27,32]]
382
382
  dbAccession: [String,[34,41]]
383
383
  dbIdCode: [String,[43,54]]
384
- dbseqBegin: [HxInteger,[56,60]]
384
+ dbseqBegin: [Integer,[56,60]]
385
385
  dbinsBegin: [String,[61,61]]
386
- dbseqEnd: [HxInteger,[63,67]]
386
+ dbseqEnd: [Integer,[63,67]]
387
387
  dbinsEnd: [String,[68,68]]
388
388
  DBREF1:
389
389
  fields:
390
390
  idCode: [String,[8,11]]
391
391
  chainID: [String,[13,13]]
392
- seqBegin: [HxInteger,[15,18]]
392
+ seqBegin: [Integer,[15,18]]
393
393
  insertBegin: [String,[19,19]]
394
- seqEnd: [HxInteger,[21,24]]
394
+ seqEnd: [Integer,[21,24]]
395
395
  insertEnd: [String,[25,25]]
396
396
  database: [String,[27,32]]
397
397
  dbIdCode: [String,[48,67]]
@@ -400,12 +400,12 @@ record_formats:
400
400
  idCode: [String,[8,11]]
401
401
  chainID: [String,[13,13]]
402
402
  dbAccession: [String,[19,40]]
403
- seqBegin: [HxInteger,[46,55]]
404
- seqEnd: [HxInteger,[58,67]]
403
+ seqBegin: [Integer,[46,55]]
404
+ seqEnd: [Integer,[58,67]]
405
405
  HELIX:
406
406
  type: 3
407
407
  fields:
408
- serNum: [HxInteger,[8,10]]
408
+ serNum: [nteger,[8,10]]
409
409
  helixID: [String,[12,14]]
410
410
  initRes: [Residue11,[16,26]]
411
411
  endRes: [Residue11,[28,38]]
@@ -846,7 +846,7 @@ record_formats:
846
846
  modelNum: [Integer,[13,14]]
847
847
  resName: [String,[16,18]]
848
848
  chainID: [String,[20,20]]
849
- seqNum: [HxInteger,[22,26]]
849
+ seqNum: [Integer,[22,26]]
850
850
  iCode: [String,[27,27]]
851
851
  470:
852
852
  fields:
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "pidibble"
6
- version = "1.1.8"
6
+ version = "1.2.0"
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
File without changes