pidibble 1.1.2__tar.gz → 1.1.3__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.
- {pidibble-1.1.2 → pidibble-1.1.3}/.readthedocs.yaml +3 -3
- {pidibble-1.1.2 → pidibble-1.1.3}/PKG-INFO +3 -1
- {pidibble-1.1.2 → pidibble-1.1.3}/README.md +2 -0
- pidibble-1.1.3/docs/requirements.txt +8 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/source/conf.py +1 -1
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/pdbparse.py +31 -1
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/resources/pdb_format.yaml +5 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pyproject.toml +1 -1
- {pidibble-1.1.2 → pidibble-1.1.3}/.gitignore +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/LICENSE +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/MANIFEST.in +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/Makefile +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/make.bat +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/source/api.rst +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/source/generated/pidibble.rst +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/source/index.rst +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/source/notes.md +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/docs/source/usage.rst +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/__init__.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/baseparsers.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/baserecord.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/mmcif_parse.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/pdbrecord.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/resources/__init__.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/pidibble/resources/mmcif_format.yaml +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/__init__.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/conftest.py +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/4tvp.cif +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/4tvp.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/4zmj-newresnames.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/4zmj.cif +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/4zmj.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/6m0j.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/G.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/GG.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/test.pdb +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb/test_pdb_format.yaml +0 -0
- {pidibble-1.1.2 → pidibble-1.1.3}/tests/unit/test_rcsb.py +0 -0
|
@@ -27,6 +27,6 @@ sphinx:
|
|
|
27
27
|
# Optional but recommended, declare the Python requirements required
|
|
28
28
|
# to build your documentation
|
|
29
29
|
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
python:
|
|
31
|
+
install:
|
|
32
|
+
- requirements: docs/requirements.txt
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pidibble
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
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,8 @@ ATOM
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
## Release History
|
|
91
|
+
* 1.1.3
|
|
92
|
+
* Added ability to group into models for multiple-model entries
|
|
91
93
|
* 1.1.2
|
|
92
94
|
* Added ability to retrieve pdbs from AlphaFold database
|
|
93
95
|
* 1.1.1
|
|
@@ -144,6 +144,7 @@ class PDBParser:
|
|
|
144
144
|
record_formats=self.pdb_format_dict['record_formats']
|
|
145
145
|
key=''
|
|
146
146
|
record_format={}
|
|
147
|
+
group_open_record=None
|
|
147
148
|
for i,pdbrecord_line in enumerate(self.pdb_lines):
|
|
148
149
|
tc=pdbrecord_line[0]
|
|
149
150
|
if tc in PDBParser.comment_chars:
|
|
@@ -167,6 +168,18 @@ class PDBParser:
|
|
|
167
168
|
elif record_type in [3,4,5]:
|
|
168
169
|
if not key in self.parsed:
|
|
169
170
|
# this is necessarily the first occurance of a record with this key, but since there can be multiple instances this must be a list of records
|
|
171
|
+
if 'groupuntil' in record_format:
|
|
172
|
+
group_open_record=new_record
|
|
173
|
+
logger.debug(f'opening group {group_open_record.serial} until {group_open_record.format["groupuntil"]}')
|
|
174
|
+
if group_open_record!=None and key==group_open_record.format['groupuntil']:
|
|
175
|
+
logger.debug(f'closing group {group_open_record.serial}')
|
|
176
|
+
group_open_record=None
|
|
177
|
+
if 'groupby' in record_format:
|
|
178
|
+
tok=new_record.format['groupby'].split('.')
|
|
179
|
+
if group_open_record!=None:
|
|
180
|
+
if tok[0]==group_open_record.key:
|
|
181
|
+
groupid=getattr(group_open_record,tok[1])
|
|
182
|
+
setattr(new_record,group_open_record.key.lower(),groupid)
|
|
170
183
|
self.parsed[key]=[new_record]
|
|
171
184
|
else:
|
|
172
185
|
# this is either
|
|
@@ -189,15 +202,32 @@ class PDBParser:
|
|
|
189
202
|
root_record.continue_record(new_record,record_format)
|
|
190
203
|
else:
|
|
191
204
|
# case (b)
|
|
205
|
+
if 'groupuntil' in record_format:
|
|
206
|
+
group_open_record=new_record
|
|
207
|
+
logger.debug(f'opening group {group_open_record.serial} until {group_open_record.format["groupuntil"]}')
|
|
208
|
+
if group_open_record!=None and key==group_open_record.format['groupuntil']:
|
|
209
|
+
logger.debug(f'closing group {group_open_record.serial}')
|
|
210
|
+
group_open_record=None
|
|
211
|
+
if 'groupby' in record_format:
|
|
212
|
+
tok=new_record.format['groupby'].split('.')
|
|
213
|
+
if group_open_record!=None:
|
|
214
|
+
if tok[0]==group_open_record.key:
|
|
215
|
+
groupid=getattr(group_open_record,tok[1])
|
|
216
|
+
setattr(new_record,group_open_record.key.lower(),groupid)
|
|
192
217
|
self.parsed[key].append(new_record)
|
|
193
218
|
|
|
194
|
-
|
|
195
219
|
def post_process(self):
|
|
196
220
|
if self.input_format!='mmCIF':
|
|
197
221
|
self.parse_embedded_records()
|
|
198
222
|
self.parse_tokens()
|
|
199
223
|
self.parse_tables()
|
|
200
224
|
|
|
225
|
+
# def parse_models(self):
|
|
226
|
+
# n_models=self.parsed.get('NUMMDL',1)
|
|
227
|
+
# for i in range(n_models):
|
|
228
|
+
# self.parsed['MODEL'][i+1]={}
|
|
229
|
+
# # in progress
|
|
230
|
+
|
|
201
231
|
def parse_embedded_records(self):
|
|
202
232
|
new_parsed_records={}
|
|
203
233
|
for key,p in self.parsed.items():
|
|
@@ -303,6 +303,7 @@ record_formats:
|
|
|
303
303
|
- sidCodes
|
|
304
304
|
ANISOU:
|
|
305
305
|
type: 3
|
|
306
|
+
groupby: MODEL.serial
|
|
306
307
|
fields:
|
|
307
308
|
serial: [Integer,[7,11]]
|
|
308
309
|
name: [String,[13,16]]
|
|
@@ -318,6 +319,7 @@ record_formats:
|
|
|
318
319
|
charge: [Float,[79,80]] # String?
|
|
319
320
|
ATOM:
|
|
320
321
|
type: 3
|
|
322
|
+
groupby: MODEL.serial
|
|
321
323
|
fields:
|
|
322
324
|
serial: [Integer,[7,11]]
|
|
323
325
|
name: [String,[13,16]]
|
|
@@ -332,6 +334,7 @@ record_formats:
|
|
|
332
334
|
charge: [Float,[79,80]] # String?
|
|
333
335
|
HETATM:
|
|
334
336
|
type: 3
|
|
337
|
+
groupby: MODEL.serial
|
|
335
338
|
fields:
|
|
336
339
|
serial: [Integer,[7,11]]
|
|
337
340
|
name: [String,[13,16]]
|
|
@@ -593,9 +596,11 @@ record_formats:
|
|
|
593
596
|
type: 5
|
|
594
597
|
MODEL:
|
|
595
598
|
type: 5
|
|
599
|
+
groupuntil: ENDMDL
|
|
596
600
|
fields:
|
|
597
601
|
serial: [Integer,[11,14]]
|
|
598
602
|
TER:
|
|
603
|
+
groupby: MODEL.serial
|
|
599
604
|
type: 5
|
|
600
605
|
fields:
|
|
601
606
|
serial: [Integer,[7,11]]
|
|
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
|
|
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
|