biotite 0.38.0__cp310-cp310-win_amd64.whl → 0.40.0__cp310-cp310-win_amd64.whl

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.

Potentially problematic release.


This version of biotite might be problematic. Click here for more details.

Files changed (124) hide show
  1. biotite/__init__.py +3 -3
  2. biotite/application/application.py +33 -28
  3. biotite/application/dssp/app.py +18 -18
  4. biotite/application/sra/__init__.py +5 -0
  5. biotite/application/sra/app.py +337 -55
  6. biotite/database/entrez/__init__.py +2 -1
  7. biotite/database/entrez/check.py +14 -3
  8. biotite/database/entrez/download.py +20 -13
  9. biotite/database/entrez/key.py +44 -0
  10. biotite/database/entrez/query.py +38 -34
  11. biotite/database/pubchem/query.py +44 -44
  12. biotite/database/rcsb/download.py +19 -14
  13. biotite/database/rcsb/query.py +46 -46
  14. biotite/sequence/align/__init__.py +5 -1
  15. biotite/sequence/align/banded.c +1408 -1025
  16. biotite/sequence/align/banded.cp310-win_amd64.pyd +0 -0
  17. biotite/sequence/align/buckets.py +69 -0
  18. biotite/sequence/align/cigar.py +389 -0
  19. biotite/sequence/align/kmeralphabet.c +3220 -2850
  20. biotite/sequence/align/kmeralphabet.cp310-win_amd64.pyd +0 -0
  21. biotite/sequence/align/kmersimilarity.c +713 -663
  22. biotite/sequence/align/kmersimilarity.cp310-win_amd64.pyd +0 -0
  23. biotite/sequence/align/kmertable.cp310-win_amd64.pyd +0 -0
  24. biotite/sequence/align/kmertable.cpp +68398 -0
  25. biotite/sequence/align/localgapped.c +1507 -1074
  26. biotite/sequence/align/localgapped.cp310-win_amd64.pyd +0 -0
  27. biotite/sequence/align/localungapped.c +1143 -833
  28. biotite/sequence/align/localungapped.cp310-win_amd64.pyd +0 -0
  29. biotite/sequence/align/multiple.c +1569 -1092
  30. biotite/sequence/align/multiple.cp310-win_amd64.pyd +0 -0
  31. biotite/sequence/align/pairwise.c +1612 -1212
  32. biotite/sequence/align/pairwise.cp310-win_amd64.pyd +0 -0
  33. biotite/sequence/align/permutation.c +33259 -0
  34. biotite/sequence/align/permutation.cp310-win_amd64.pyd +0 -0
  35. biotite/sequence/align/primes.txt +821 -0
  36. biotite/sequence/align/{kmertable.c → selector.c} +9129 -16497
  37. biotite/sequence/align/selector.cp310-win_amd64.pyd +0 -0
  38. biotite/sequence/align/tracetable.c +685 -646
  39. biotite/sequence/align/tracetable.cp310-win_amd64.pyd +0 -0
  40. biotite/sequence/codec.c +1159 -841
  41. biotite/sequence/codec.cp310-win_amd64.pyd +0 -0
  42. biotite/sequence/graphics/alignment.py +212 -2
  43. biotite/sequence/io/genbank/annotation.py +11 -11
  44. biotite/sequence/phylo/nj.c +684 -636
  45. biotite/sequence/phylo/nj.cp310-win_amd64.pyd +0 -0
  46. biotite/sequence/phylo/tree.c +970 -673
  47. biotite/sequence/phylo/tree.cp310-win_amd64.pyd +0 -0
  48. biotite/sequence/phylo/upgma.c +672 -626
  49. biotite/sequence/phylo/upgma.cp310-win_amd64.pyd +0 -0
  50. biotite/structure/__init__.py +1 -1
  51. biotite/structure/atoms.py +1 -1
  52. biotite/structure/basepairs.py +7 -12
  53. biotite/structure/bonds.c +3861 -3749
  54. biotite/structure/bonds.cp310-win_amd64.pyd +0 -0
  55. biotite/structure/celllist.c +727 -707
  56. biotite/structure/celllist.cp310-win_amd64.pyd +0 -0
  57. biotite/structure/charges.c +1561 -1560
  58. biotite/structure/charges.cp310-win_amd64.pyd +0 -0
  59. biotite/structure/filter.py +30 -37
  60. biotite/structure/info/__init__.py +5 -8
  61. biotite/structure/info/atoms.py +25 -67
  62. biotite/structure/info/bonds.py +46 -100
  63. biotite/structure/info/ccd/README.rst +8 -0
  64. biotite/structure/info/ccd/amino_acids.txt +1646 -0
  65. biotite/structure/info/ccd/carbohydrates.txt +1133 -0
  66. biotite/structure/info/ccd/components.bcif +0 -0
  67. biotite/structure/info/ccd/nucleotides.txt +797 -0
  68. biotite/structure/info/ccd.py +95 -0
  69. biotite/structure/info/groups.py +90 -0
  70. biotite/structure/info/masses.py +21 -20
  71. biotite/structure/info/misc.py +11 -22
  72. biotite/structure/info/standardize.py +17 -12
  73. biotite/structure/io/__init__.py +2 -4
  74. biotite/structure/io/ctab.py +1 -1
  75. biotite/structure/io/general.py +37 -43
  76. biotite/structure/io/mmtf/__init__.py +3 -0
  77. biotite/structure/io/mmtf/convertarray.c +528 -365
  78. biotite/structure/io/mmtf/convertarray.cp310-win_amd64.pyd +0 -0
  79. biotite/structure/io/mmtf/convertfile.c +725 -676
  80. biotite/structure/io/mmtf/convertfile.cp310-win_amd64.pyd +0 -0
  81. biotite/structure/io/mmtf/decode.c +1070 -754
  82. biotite/structure/io/mmtf/decode.cp310-win_amd64.pyd +0 -0
  83. biotite/structure/io/mmtf/encode.c +727 -677
  84. biotite/structure/io/mmtf/encode.cp310-win_amd64.pyd +0 -0
  85. biotite/structure/io/mmtf/file.py +34 -26
  86. biotite/structure/io/npz/__init__.py +3 -0
  87. biotite/structure/io/npz/file.py +21 -18
  88. biotite/structure/io/pdb/__init__.py +3 -3
  89. biotite/structure/io/pdb/file.py +72 -70
  90. biotite/structure/io/pdb/hybrid36.c +540 -478
  91. biotite/structure/io/pdb/hybrid36.cp310-win_amd64.pyd +0 -0
  92. biotite/structure/io/pdbqt/file.py +82 -68
  93. biotite/structure/io/pdbx/__init__.py +13 -6
  94. biotite/structure/io/pdbx/bcif.py +649 -0
  95. biotite/structure/io/pdbx/cif.py +1028 -0
  96. biotite/structure/io/pdbx/component.py +243 -0
  97. biotite/structure/io/pdbx/convert.py +707 -359
  98. biotite/structure/io/pdbx/encoding.c +112813 -0
  99. biotite/structure/io/pdbx/encoding.cp310-win_amd64.pyd +0 -0
  100. biotite/structure/io/pdbx/error.py +14 -0
  101. biotite/structure/io/pdbx/legacy.py +267 -0
  102. biotite/structure/molecules.py +151 -151
  103. biotite/structure/residues.py +40 -40
  104. biotite/structure/sasa.c +713 -644
  105. biotite/structure/sasa.cp310-win_amd64.pyd +0 -0
  106. biotite/structure/superimpose.py +158 -115
  107. biotite/visualize.py +9 -11
  108. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/METADATA +2 -2
  109. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/RECORD +112 -102
  110. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/WHEEL +1 -1
  111. biotite/structure/info/amino_acids.json +0 -1556
  112. biotite/structure/info/amino_acids.py +0 -42
  113. biotite/structure/info/carbohydrates.json +0 -1122
  114. biotite/structure/info/carbohydrates.py +0 -39
  115. biotite/structure/info/intra_bonds.msgpack +0 -0
  116. biotite/structure/info/link_types.msgpack +0 -1
  117. biotite/structure/info/nucleotides.json +0 -772
  118. biotite/structure/info/nucleotides.py +0 -39
  119. biotite/structure/info/residue_masses.msgpack +0 -0
  120. biotite/structure/info/residue_names.msgpack +0 -3
  121. biotite/structure/info/residues.msgpack +0 -0
  122. biotite/structure/io/pdbx/file.py +0 -652
  123. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/LICENSE.rst +0 -0
  124. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,6 @@ __all__ = ["PDBQTFile"]
8
8
 
9
9
  import warnings
10
10
  import numpy as np
11
- import networkx as nx
12
11
  from ....file import TextFile, InvalidFileError
13
12
  from ...error import BadStructureError
14
13
  from ...atoms import AtomArray, AtomArrayStack
@@ -26,65 +25,65 @@ PARAMETRIZED_ELEMENTS = [
26
25
  class PDBQTFile(TextFile):
27
26
  """
28
27
  This class represents an *AutoDock* PDBQT file.
29
-
28
+
30
29
  This class only provides rudimentary support for reading/writing
31
30
  the pure atom information.
32
31
 
33
32
  EXPERIMENTAL: Future API changes are probable.
34
-
33
+
35
34
  Examples
36
35
  --------
37
-
36
+
38
37
  Write biotin as flexible ligand into a PDBQT file:
39
-
38
+
40
39
  >>> import os.path
41
40
  >>> ligand = residue("BTN")
42
41
  >>> file = PDBQTFile()
43
42
  >>> mask = file.set_structure(ligand, rotatable_bonds="all")
44
43
  >>> # Print removed nonpolar hydrogen atoms
45
44
  >>> print(ligand[~mask])
46
- HET 0 BTN H101 H 3.745 1.171 0.974
47
- HET 0 BTN H102 H 4.071 1.343 -0.767
48
- HET 0 BTN H91 H 2.802 -0.740 -1.211
49
- HET 0 BTN H92 H 2.476 -0.912 0.530
50
- HET 0 BTN H81 H 1.289 1.265 0.523
51
- HET 0 BTN H82 H 1.616 1.437 -1.218
52
- HET 0 BTN H71 H 0.346 -0.646 -1.662
53
- HET 0 BTN H72 H 0.020 -0.818 0.079
54
- HET 0 BTN H2 H -0.838 1.576 -1.627
55
- HET 0 BTN H61 H -3.797 1.837 1.286
56
- HET 0 BTN H62 H -3.367 2.738 -0.205
57
- HET 0 BTN H5 H -4.307 0.812 -1.205
58
- HET 0 BTN H4 H -2.451 -0.038 -2.252
45
+ HET 0 BTN H101 H 3.740 1.170 0.970
46
+ HET 0 BTN H102 H 4.070 1.340 -0.770
47
+ HET 0 BTN H91 H 2.800 -0.740 -1.210
48
+ HET 0 BTN H92 H 2.480 -0.910 0.530
49
+ HET 0 BTN H81 H 1.290 1.260 0.520
50
+ HET 0 BTN H82 H 1.620 1.440 -1.220
51
+ HET 0 BTN H71 H 0.350 -0.650 -1.660
52
+ HET 0 BTN H72 H 0.020 -0.820 0.080
53
+ HET 0 BTN H2 H -0.840 1.580 -1.630
54
+ HET 0 BTN H61 H -3.800 1.840 1.290
55
+ HET 0 BTN H62 H -3.370 2.740 -0.200
56
+ HET 0 BTN H5 H -4.310 0.810 -1.210
57
+ HET 0 BTN H4 H -2.450 -0.040 -2.250
59
58
  >>> print(file)
60
59
  ROOT
61
- HETATM 1 C11 BTN 0 5.089 -0.280 0.173 1.00 0.00 0.258 C
62
- HETATM 2 O11 BTN 0 4.956 -1.473 0.030 1.00 0.00 -0.264 OA
60
+ HETATM 1 C11 BTN 0 5.090 -0.280 0.170 1.00 0.00 0.258 C
61
+ HETATM 2 O11 BTN 0 4.960 -1.470 0.030 1.00 0.00 -0.264 OA
63
62
  ENDROOT
64
63
  BRANCH 1 3
65
- HETATM 3 O12 BTN 0 6.299 0.233 0.444 1.00 0.00 -0.331 OA
66
- HETATM 17 HO2 BTN 0 7.034 -0.391 0.517 1.00 0.00 0.221 HD
64
+ HETATM 3 O12 BTN 0 6.300 0.230 0.440 1.00 0.00 -0.331 OA
65
+ HETATM 17 HO2 BTN 0 7.030 -0.390 0.520 1.00 0.00 0.221 HD
67
66
  ENDBRANCH 1 3
68
67
  BRANCH 1 4
69
- HETATM 4 C10 BTN 0 3.896 0.631 0.039 1.00 0.00 0.105 C
68
+ HETATM 4 C10 BTN 0 3.900 0.630 0.040 1.00 0.00 0.105 C
70
69
  BRANCH 4 5
71
- HETATM 5 C9 BTN 0 2.651 -0.200 -0.276 1.00 0.00 0.010 C
70
+ HETATM 5 C9 BTN 0 2.650 -0.200 -0.280 1.00 0.00 0.010 C
72
71
  BRANCH 5 6
73
- HETATM 6 C8 BTN 0 1.440 0.725 -0.412 1.00 0.00 0.002 C
72
+ HETATM 6 C8 BTN 0 1.440 0.720 -0.410 1.00 0.00 0.002 C
74
73
  BRANCH 6 7
75
- HETATM 7 C7 BTN 0 0.196 -0.106 -0.727 1.00 0.00 0.016 C
74
+ HETATM 7 C7 BTN 0 0.200 -0.110 -0.730 1.00 0.00 0.016 C
76
75
  BRANCH 7 8
77
- HETATM 8 C2 BTN 0 -1.015 0.819 -0.863 1.00 0.00 0.065 C
78
- HETATM 9 S1 BTN 0 -1.419 1.604 0.751 1.00 0.00 -0.154 SA
79
- HETATM 10 C6 BTN 0 -3.205 1.827 0.371 1.00 0.00 0.090 C
80
- HETATM 11 C5 BTN 0 -3.530 0.581 -0.476 1.00 0.00 0.091 C
81
- HETATM 12 N1 BTN 0 -3.970 -0.507 0.412 1.00 0.00 -0.239 NA
82
- HETATM 13 C3 BTN 0 -3.141 -1.549 0.271 1.00 0.00 0.272 C
83
- HETATM 14 O3 BTN 0 -3.271 -2.589 0.888 1.00 0.00 -0.259 OA
84
- HETATM 15 N2 BTN 0 -2.154 -1.343 -0.612 1.00 0.00 -0.239 NA
85
- HETATM 16 C4 BTN 0 -2.289 0.010 -1.175 1.00 0.00 0.093 C
86
- HETATM 18 HN1 BTN 0 -4.738 -0.474 1.004 1.00 0.00 0.132 HD
87
- HETATM 19 HN2 BTN 0 -1.462 -1.982 -0.843 1.00 0.00 0.132 HD
76
+ HETATM 8 C2 BTN 0 -1.020 0.820 -0.860 1.00 0.00 0.065 C
77
+ HETATM 9 S1 BTN 0 -1.420 1.600 0.750 1.00 0.00 -0.154 SA
78
+ HETATM 10 C6 BTN 0 -3.200 1.830 0.370 1.00 0.00 0.090 C
79
+ HETATM 11 C5 BTN 0 -3.530 0.580 -0.480 1.00 0.00 0.091 C
80
+ HETATM 12 N1 BTN 0 -3.970 -0.510 0.410 1.00 0.00 -0.239 NA
81
+ HETATM 13 C3 BTN 0 -3.140 -1.550 0.270 1.00 0.00 0.272 C
82
+ HETATM 14 O3 BTN 0 -3.270 -2.590 0.890 1.00 0.00 -0.259 OA
83
+ HETATM 15 N2 BTN 0 -2.150 -1.340 -0.610 1.00 0.00 -0.239 NA
84
+ HETATM 16 C4 BTN 0 -2.290 0.010 -1.170 1.00 0.00 0.093 C
85
+ HETATM 18 HN1 BTN 0 -4.740 -0.470 1.000 1.00 0.00 0.132 HD
86
+ HETATM 19 HN2 BTN 0 -1.460 -1.980 -0.840 1.00 0.00 0.132 HD
88
87
  ENDBRANCH 7 8
89
88
  ENDBRANCH 6 7
90
89
  ENDBRANCH 5 6
@@ -97,7 +96,7 @@ class PDBQTFile(TextFile):
97
96
  def get_remarks(self, model=None):
98
97
  """
99
98
  Get the content of ``REMARKS`` lines.
100
-
99
+
101
100
  Parameters
102
101
  ----------
103
102
  model : int, optional
@@ -128,7 +127,7 @@ class PDBQTFile(TextFile):
128
127
  # In these cases model starting index is set to 0
129
128
  if len(model_start_i) == 0:
130
129
  model_start_i = np.array([0])
131
-
130
+
132
131
  if model is None:
133
132
  # Add exclusive end of file
134
133
  model_start_i = np.concatenate((model_start_i, [len(self.lines)]))
@@ -144,7 +143,7 @@ class PDBQTFile(TextFile):
144
143
  "\n".join([self.lines[i][7:] for i in model_remark_line_i])
145
144
  )
146
145
  return remarks
147
-
146
+
148
147
  else:
149
148
  last_model = len(model_start_i)
150
149
  if model == 0:
@@ -163,7 +162,7 @@ class PDBQTFile(TextFile):
163
162
  f"the given model {model} does not exist"
164
163
  )
165
164
  remark_line_i = remark_line_i[line_filter]
166
-
165
+
167
166
  # Do not include 'REMARK ' itself -> begin from pos 8
168
167
  return "\n".join([self.lines[i][7:] for i in remark_line_i])
169
168
 
@@ -172,7 +171,7 @@ class PDBQTFile(TextFile):
172
171
  """
173
172
  Get an :class:`AtomArray` or :class:`AtomArrayStack` from the
174
173
  PDBQT file.
175
-
174
+
176
175
  Parameters
177
176
  ----------
178
177
  model : int, optional
@@ -184,7 +183,7 @@ class PDBQTFile(TextFile):
184
183
  If this parameter is omitted, an :class:`AtomArrayStack`
185
184
  containing all models will be returned, even if the
186
185
  structure contains only one model.
187
-
186
+
188
187
  Returns
189
188
  -------
190
189
  array : AtomArray or AtomArrayStack
@@ -202,7 +201,7 @@ class PDBQTFile(TextFile):
202
201
  # In these cases model starting index is set to 0
203
202
  if len(model_start_i) == 0:
204
203
  model_start_i = np.array([0])
205
-
204
+
206
205
  if model is None:
207
206
  depth = len(model_start_i)
208
207
  length = self._get_model_length(model_start_i, atom_line_i)
@@ -216,7 +215,7 @@ class PDBQTFile(TextFile):
216
215
  annot_i = atom_line_i[atom_line_i < model_start_i[1]]
217
216
  # Line indices for coordinate determination
218
217
  coord_i = atom_line_i
219
-
218
+
220
219
  else:
221
220
  last_model = len(model_start_i)
222
221
  if model == 0:
@@ -236,7 +235,7 @@ class PDBQTFile(TextFile):
236
235
  )
237
236
  annot_i = coord_i = atom_line_i[line_filter]
238
237
  array = AtomArray(len(coord_i))
239
-
238
+
240
239
  # Save atom IDs for later sorting into the original atom order
241
240
  atom_id = np.zeros(array.array_length(), int)
242
241
 
@@ -253,7 +252,7 @@ class PDBQTFile(TextFile):
253
252
  # i is index in array, line_i is line index
254
253
  for i, line_i in enumerate(annot_i):
255
254
  line = self.lines[line_i]
256
-
255
+
257
256
  atom_id[i] = int(line[6:11])
258
257
  chain_id[i] = line[21].strip()
259
258
  res_id[i] = int(line[22:26])
@@ -262,7 +261,7 @@ class PDBQTFile(TextFile):
262
261
  hetero[i] = (False if line[0:4] == "ATOM" else True)
263
262
  atom_name[i] = line[12:16].strip()
264
263
  element[i] = line[76:78].strip()
265
-
264
+
266
265
  # Add annotation arrays to atom array (stack)
267
266
  array.chain_id = chain_id
268
267
  array.res_id = res_id
@@ -271,7 +270,7 @@ class PDBQTFile(TextFile):
271
270
  array.hetero = hetero
272
271
  array.atom_name = atom_name
273
272
  array.element = element
274
-
273
+
275
274
  # Fill in coordinates
276
275
  if isinstance(array, AtomArray):
277
276
  for i, line_i in enumerate(coord_i):
@@ -279,7 +278,7 @@ class PDBQTFile(TextFile):
279
278
  array.coord[i,0] = float(line[30:38])
280
279
  array.coord[i,1] = float(line[38:46])
281
280
  array.coord[i,2] = float(line[46:54])
282
-
281
+
283
282
  elif isinstance(array, AtomArrayStack):
284
283
  m = 0
285
284
  i = 0
@@ -292,18 +291,18 @@ class PDBQTFile(TextFile):
292
291
  array.coord[m,i,1] = float(line[38:46])
293
292
  array.coord[m,i,2] = float(line[46:54])
294
293
  i += 1
295
-
294
+
296
295
  # Sort into the original atom order
297
296
  array = array[..., np.argsort(atom_id)]
298
297
 
299
298
  return array
300
-
299
+
301
300
 
302
301
  def set_structure(self, atoms, charges=None, atom_types=None,
303
302
  rotatable_bonds=None, root=None, include_torsdof=True):
304
303
  """
305
304
  Write an :class:`AtomArray` into the PDBQT file.
306
-
305
+
307
306
  Parameters
308
307
  ----------
309
308
  atoms : AtomArray, shape=(n,)
@@ -325,7 +324,7 @@ class PDBQTFile(TextFile):
325
324
  be written.
326
325
  - ``'rigid'`` - The molecule is handled as rigid ligand:
327
326
  Only a ``ROOT`` line will be written.
328
- - ``'all'`` - The molecule is handled as flexible
327
+ - ``'all'`` - The molecule is handled as flexible
329
328
  ligand:
330
329
  A ``ROOT`` line will be written and all rotatable
331
330
  bonds are included using ``BRANCH`` and ``ENDBRANCH``
@@ -335,7 +334,7 @@ class PDBQTFile(TextFile):
335
334
  A ``ROOT`` line will be written and all bonds in the
336
335
  given :class:`BondList` are considered flexible via
337
336
  ``BRANCH`` and ``ENDBRANCH`` lines.
338
-
337
+
339
338
  root : int, optional
340
339
  Specifies the index of the atom following the ``ROOT`` line.
341
340
  Setting the root atom is useful for specifying the *anchor*
@@ -347,7 +346,7 @@ class PDBQTFile(TextFile):
347
346
  By default, a ``TORSDOF`` (torsional degrees of freedom)
348
347
  record is written at the end of the file.
349
348
  By setting this parameter to false, the record is omitted.
350
-
349
+
351
350
  Returns
352
351
  -------
353
352
  mask : ndarray, shape=(n,), dtype=bool
@@ -355,19 +354,34 @@ class PDBQTFile(TextFile):
355
354
  ``atoms``, that was removed due to being a nonpolar
356
355
  hydrogen.
357
356
  """
357
+ # Check if AtomArray is suitable for PDBQT
358
+ max_atoms, max_residues = 99999, 9999
359
+ if atoms.array_length() > max_atoms:
360
+ warnings.warn(f"More then {max_atoms:,} atoms per model")
361
+ if (atoms.res_id > max_residues).any():
362
+ warnings.warn(f"Residue IDs exceed {max_residues:,}")
363
+ if np.isnan(atoms.coord).any():
364
+ raise BadStructureError("Coordinates contain 'NaN' values")
365
+ if any([len(name) > 1 for name in atoms.chain_id]):
366
+ raise BadStructureError("Some chain IDs exceed 1 character")
367
+ if any([len(name) > 3 for name in atoms.res_name]):
368
+ raise BadStructureError("Some residue names exceed 3 characters")
369
+ if any([len(name) > 4 for name in atoms.atom_name]):
370
+ raise BadStructureError("Some atom names exceed 4 characters")
371
+
358
372
  if charges is None:
359
373
  charges = partial_charges(atoms)
360
374
  charges[np.isnan(charges)] = 0
361
375
  else:
362
376
  if np.isnan(charges).any():
363
377
  raise ValueError("Input charges contain NaN values")
364
-
378
+
365
379
  # Get AutoDock atom types and remove nonpolar hydrogen atoms
366
380
  atoms, charges, types, mask = convert_atoms(atoms, charges)
367
381
  # Overwrite calculated atom types with input atom types
368
382
  if atom_types is not None:
369
383
  types = atom_types[mask]
370
-
384
+
371
385
  if rotatable_bonds is None:
372
386
  # No rotatable bonds -> the BondList contains no bonds
373
387
  rotatable_bonds = BondList(atoms.bonds.get_atom_count())
@@ -387,7 +401,7 @@ class PDBQTFile(TextFile):
387
401
  len(mask), np.asarray(rotatable_bonds)
388
402
  )[mask]
389
403
  use_root = True
390
-
404
+
391
405
  if root is None:
392
406
  root_index = 0
393
407
  else:
@@ -407,7 +421,7 @@ class PDBQTFile(TextFile):
407
421
  # as the root is probably a terminal atom
408
422
  for atom, bond_type in zip(*atoms.bonds.get_bonds(root_index)):
409
423
  rotatable_bonds.add_bond(root_index, atom, bond_type)
410
-
424
+
411
425
  # Break rotatable bonds
412
426
  # for simple branch determination in '_write_atoms()'
413
427
  atoms.bonds.remove_bonds(rotatable_bonds)
@@ -435,7 +449,7 @@ class PDBQTFile(TextFile):
435
449
  self.lines.append(f"TORSDOF {len(rotatable_bonds)}")
436
450
 
437
451
  return mask
438
-
452
+
439
453
 
440
454
  def _write_atoms(self, atoms, charges, types,
441
455
  atom_id, hetero, occupancy, b_factor,
@@ -459,7 +473,7 @@ class PDBQTFile(TextFile):
459
473
  # No rotatable bonds
460
474
  # -> all atom are in root i.e. this branch
461
475
  this_branch_indices = np.arange(atoms.array_length())
462
-
476
+
463
477
  if is_root:
464
478
  self.lines.append("ROOT")
465
479
  for i in this_branch_indices:
@@ -491,7 +505,7 @@ class PDBQTFile(TextFile):
491
505
  continue
492
506
 
493
507
  # Create a new branch for each rotatable bond,
494
- # that connects to an atom of this branch
508
+ # that connects to an atom of this branch
495
509
  if i in this_branch_indices:
496
510
  this_br_i = i
497
511
  new_br_i = j
@@ -501,7 +515,7 @@ class PDBQTFile(TextFile):
501
515
  else:
502
516
  # Rotatable bond does not start from this branch
503
517
  continue
504
-
518
+
505
519
  # Mark rotatable bond as visited as otherwise branches would
506
520
  # be created back and forth over the same rotatable bond and
507
521
  # this method would never terminate
@@ -521,7 +535,7 @@ class PDBQTFile(TextFile):
521
535
  self.lines.append(
522
536
  f"ENDBRANCH {atom_id[this_br_i]:>3d} {atom_id[new_br_i]:>3d}"
523
537
  )
524
-
538
+
525
539
 
526
540
  def _get_model_length(self, model_start_i, atom_line_i):
527
541
  """
@@ -557,7 +571,7 @@ def convert_atoms(atoms, charges):
557
571
  The atoms to be converted.
558
572
  charges : ndarray, dtype=float
559
573
  Partial charges for the atoms.
560
-
574
+
561
575
  Returns
562
576
  -------
563
577
  converted_atoms : AtomArray
@@ -619,8 +633,8 @@ def convert_atoms(atoms, charges):
619
633
  warnings.warn(
620
634
  f"Element {element} is not paramtrized, "
621
635
  f"using parameters for hydrogen instead"
622
- )
636
+ )
623
637
  atom_types[i] = "H"
624
-
638
+
625
639
  mask = ~hydrogen_removal_mask
626
640
  return atoms[mask], charges[mask], atom_types[mask], mask
@@ -3,15 +3,22 @@
3
3
  # information.
4
4
 
5
5
  """
6
- This subpackage provides support for the the modern PDBx/mmCIF file
7
- format. The :class:`PDBxFile` class provides dictionary-like access to
8
- every field in PDBx/mmCIF files.
9
- Additional utility functions allow conversion of these dictionaries to
10
- :class:`AtomArray` and :class:`AtomArrayStack` objects and vice versa.
6
+ This subpackage provides support for the the modern PDBx file formats.
7
+ The :class:`CIFFile` class provides dictionary-like access to
8
+ every field in text-based *mmCIF* files.
9
+ :class:`BinaryCIFFile` provides analogous functionality for the
10
+ *BinaryCIF* format.
11
+ Additional utility functions allow reading and writing structures
12
+ from/to these files.
11
13
  """
12
14
 
13
15
  __name__ = "biotite.structure.io.pdbx"
14
16
  __author__ = "Patrick Kunzmann"
15
17
 
16
18
  from .convert import *
17
- from .file import *
19
+ from .bcif import *
20
+ from .cif import *
21
+ from .component import *
22
+ from .encoding import *
23
+ from .error import *
24
+ from .legacy import *