-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknuckles_parse.pyi
629 lines (519 loc) · 13.4 KB
/
knuckles_parse.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
from enum import Enum
from typing import Optional, Union
class AtomRecord:
"""A class to represent an Atom Record in a PDB file.
Parameters
----------
line : str
A string representing the line in the PDB file.
Attributes
----------
serial : int
The serial number of the atom.
name : str
The name of the atom.
alt_loc : str
The alternate location indicator.
res_name : str
The name of the residue.
chain_id : str
The chain identifier.
res_seq : int
The sequence number of the residue.
i_code : str
The insertion code.
x : float
The x-coordinate of the atom.
y : float
The y-coordinate of the atom.
z : float
The z-coordinate of the atom.
occupancy : float
The occupancy of the atom.
temp_factor : float
The temperature factor of the atom.
element : Optional[str]
The element symbol.
charge : Optional[str]
The charge on the atom.
entry : Optional[str]
The entry in the PDB file.
"""
serial: int
name: str
alt_loc: Optional[str]
res_name: str
chain_id: Optional[str]
res_seq: int
i_code: Optional[str]
x: float
y: float
z: float
occupancy: float
temp_factor: float
element: Optional[str]
charge: Optional[str]
entry: Optional[str]
def __repr__(self) -> str: ...
class AnisotropicRecord:
"""A class to represent an Anisotropic Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
serial : int
The serial number of the atom.
name : str
The name of the atom.
alt_loc : str
The alternate location indicator.
res_name : str
The name of the residue.
chain_id : str
The chain identifier.
res_seq : int
The sequence number of the residue.
i_code : str
The insertion code.
u00 : int
The U(1,1) element of the anisotropic temperature factor.
u11 : int
The U(2,2) element of the anisotropic temperature factor.
u22 : int
The U(3,3) element of the anisotropic temperature factor.
u01 : int
The U(1,2) element of the anisotropic temperature factor.
u02 : int
The U(1,3) element of the anisotropic temperature factor.
u12 : int
The U(2,3) element of the anisotropic temperature factor.
element : Optional[str]
The element symbol.
charge : Optional[str]
The charge on the atom.
"""
serial: int
name: str
alt_loc: Optional[str]
res_name: str
chain_id: Optional[str]
res_seq: int
i_code: Optional[str]
u00: int
u11: int
u22: int
u01: int
u02: int
u12: int
element: Optional[str]
charge: Optional[str]
def __repr__(self) -> str: ...
class ConnectRecord:
"""A class to represent a Connect Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
serial : int
The base serial number of an atom.
connected : list[Optional[int]]
A list of serial numbers of atoms that are connected to the atom with the given serial number.
"""
serial: int
connected: list[Optional[int]]
def __repr__(self) -> str: ...
class CrystalRecord:
"""A class to represent a Crystal Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
a : float
The length of the unit cell edge a. (Angstroms)
b : float
The length of the unit cell edge b. (Angstroms)
c : float
The length of the unit cell edge c. (Angstroms)
alpha : float
The angle between the unit cell edge b and c. (Degrees)
beta : float
The angle between the unit cell edge a and c. (Degrees)
gamma : float
The angle between the unit cell edge a and b. (Degrees)
space_group : str
The space group symbol.
z : int
The number of molecules in the unit cell. (Z value)
"""
a: float
b: float
c: float
alpha: float
beta: float
gamma: float
space_group: str
z: int
def __repr__(self) -> str: ...
class DBRefRecord:
"""A class to represent a DBREF Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
id_code : str
ID code of this entry.
chain_id : char
Chain identifier.
seq_begin : int
Initial sequence number of the PDB sequence segment.
insert_begin : Optional[char]
Initial insertion code of the PDB sequence segment.
seq_end : int
Ending sequence number of the PDB sequence segment.
insert_end : Optional[char]
Ending insertion code of the PDB sequence segment.
database : DBType
The database name.
db_accession : str
Accession code of the database.
db_id_code : str
ID code of the database.
db_seq_begin : int
Initial sequence number of the database sequence segment.
i_dbns_beg : Optional[char]
Initial insertion code of the database sequence segment.
db_seq_end : int
Ending sequence number of the database sequence segment.
db_ins_end : Optional[char]
Ending insertion code of the database sequence segment.
"""
id_code: str
chain_id: str
seq_begin: int
insert_begin: Optional[str]
seq_end: int
insert_end: Optional[str]
database: DBType
db_accession: str
db_id_code: str
db_seq_begin: int
i_dbns_beg: Optional[str]
db_seq_end: int
db_ins_end: Optional[str]
def __repr__(self) -> str: ...
class DBType(Enum):
"""An enumeration to represent the database type in a DBREF Record."""
GB = ...
NORINE = ...
PDB = ...
UNP = ...
def __repr__(self) -> str: ...
class HetRecord:
"""A class to represent a HET Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
het_id : str
The heterogen identifier.
chain_id : str
The chain identifier.
seq_num : int
The sequence number.
i_code : Option[str]
The insertion code.
num_het_atoms: int
The number of HETATM records for the group.
text: Optional[str]
The text.
"""
het_id: str
chain_id: str
seq_num: int
i_code: Optional[str]
num_het_atoms: int
text: Optional[str]
def __repr__(self) -> str: ...
# pub struct HetnamRecord {
# pub continuation: Option<String>,
# pub het_id: String,
# pub text: String,
# }
class HetnamRecord:
"""A class to represent a HETNAM Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
continuation : Optional[str]
The continuation line.
het_id : str
The heterogen identifier.
text : str
The text.
"""
continuation: Optional[str]
het_id: str
text: str
def __repr__(self) -> str: ...
class ModelRecord:
"""A class to represent a Model Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
serial_number : int
The serial number of the model.
"""
serial_number: int
def __repr__(self) -> str: ...
class ModresRecord:
"""A class to represent a MODRES Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
id_code : str
ID code of this entry.
res_name : str
Residue name used in the PDB file.
chain_id : str
Chain identifier.
seq_num : int
Sequence number.
i_code : Optional[str]
Insertion code.
std_res : str
Standard residue name.
comment : str
Comment.
"""
id_code: str
res_name: str
chain_id: str
seq_num: int
i_code: Optional[str]
std_res: str
comment: str
def __repr__(self) -> str: ...
class MtrixnRecord:
"""A class to represent an MTRIXn Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
n : int
N value of the MTRIXn record. (n = 1, 2, 3)
serial_number : int
Serial number of the transformation matrix.
matrix : list[float]
The transformation matrix.
vn : float
The vector.
i_given : bool
The I given flag.
"""
n: int
serial_number: int
matrix: list[float]
vn: float
i_given: bool
def __repr__(self) -> str: ...
class NummdlRecord:
"""A class to represent a NUMMDL Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
num_models : int
The number of models.
"""
num_models: int
def __repr__(self) -> str: ...
class OrigxnRecord:
"""A class to represent an ORIGXn Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
n : int
N value of the ORIGXn record. (n = 1, 2, 3)
o : list[float]
The origin.
tn: float
The translation.
"""
n: int
o: list[float]
tn: float
def __repr__(self) -> str: ...
class ScalenRecord:
"""A class to represent a SCALEn Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file
Attributes
----------
n : int
N value of the SCALEn record. (n = 1, 2, 3)
scalen : list[float]
The scaling matrix.
un : float
The unit.
"""
n: int
scalen: list[float]
un: float
def __repr__(self) -> str: ...
class SeqAdvRecord:
"""A class to represent a SEQADV Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
id_code : str
ID code of this entry.
res_name : str
Residue name used in the PDB file.
chain_id : str
Chain identifier.
seq_num : int
Sequence number.
i_code : Optional[str]
Insertion code.
database : DBType
Database name.
db_accession : str
Accession code of the database.
db_res : Optional[str]
Residue name in the database.
db_seq : Optional[int]
Sequence number in the database.
conflict : str
Conflict comment.
"""
id_code: str
res_name: str
chain_id: str
seq_num: int
i_code: Optional[str]
database: DBType
db_accession: str
db_res: Optional[str]
db_seq: Optional[int]
conflict: str
def __repr__(self) -> str: ...
class SeqresRecord:
"""A class to represent a SEQRES Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
ser_num : int
Serial number of the SEQRES record.
chain_id : str
Chain identifier.
num_res : int
Number of residues in the chain.
res_names : list[str]
List of residue names.
"""
ser_num: int
chain_id: str
num_res: int
res_names: list[str]
res_names: list[str]
def __repr__(self) -> str: ...
class TermRecord:
"""A class to represent a TER Record in a PDB file.
Parameters
----------
line : str
A string representing a line in the PDB file.
Attributes
----------
serial : int
The serial number of the atom.
"""
serial: int
def __repr__(self) -> str: ...
class Record:
"""A class to represents a single line in a PDB file.
Wraps around the specific record types like AtomRecord, AnisotropicRecord, etc.
Parameters
----------
line : str
A string representing the line in the PDB file.
"""
@property
def record(
self,
) -> Union[
AnisotropicRecord,
AtomRecord,
ConnectRecord,
CrystalRecord,
DBRefRecord,
HetRecord,
HetnamRecord,
MtrixnRecord,
ModelRecord,
ModresRecord,
NummdlRecord,
OrigxnRecord,
ScalenRecord,
SeqresRecord,
SeqAdvRecord,
TermRecord,
None,
]:
"""Getter method that returns the specific variant of the Record.
Returns
-------
Union[
AnisotropicRecord, AtomRecord, ConnectRecord, CrystalRecord,
DBRefRecord, HetRecrd, MtrixnRecord, ModelRecord, ModresRecord,
NummdlRecord, OrigxnRecord, ScalenRecord, SeqresRecord, SeqAdvRecord,
TermRecord, HetnamRecord, None]
The specific variant of the Record.
"""
...
def pdbreader(contents: str) -> list[Record]:
"""Read the contents of a PDB file.
Parameters
----------
contents : str
The contents of the PDB file.
Returns
-------
list[Record]
A list of Record objects.
"""
...