biotite 0.38.0__cp310-cp310-macosx_11_0_arm64.whl → 0.40.0__cp310-cp310-macosx_11_0_arm64.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.cpython-310-darwin.so +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.cpython-310-darwin.so +0 -0
  21. biotite/sequence/align/kmersimilarity.c +713 -663
  22. biotite/sequence/align/kmersimilarity.cpython-310-darwin.so +0 -0
  23. biotite/sequence/align/kmertable.cpp +68398 -0
  24. biotite/sequence/align/kmertable.cpython-310-darwin.so +0 -0
  25. biotite/sequence/align/localgapped.c +1507 -1074
  26. biotite/sequence/align/localgapped.cpython-310-darwin.so +0 -0
  27. biotite/sequence/align/localungapped.c +1143 -833
  28. biotite/sequence/align/localungapped.cpython-310-darwin.so +0 -0
  29. biotite/sequence/align/multiple.c +1569 -1092
  30. biotite/sequence/align/multiple.cpython-310-darwin.so +0 -0
  31. biotite/sequence/align/pairwise.c +1612 -1212
  32. biotite/sequence/align/pairwise.cpython-310-darwin.so +0 -0
  33. biotite/sequence/align/permutation.c +33259 -0
  34. biotite/sequence/align/permutation.cpython-310-darwin.so +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.cpython-310-darwin.so +0 -0
  38. biotite/sequence/align/tracetable.c +685 -646
  39. biotite/sequence/align/tracetable.cpython-310-darwin.so +0 -0
  40. biotite/sequence/codec.c +1159 -841
  41. biotite/sequence/codec.cpython-310-darwin.so +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.cpython-310-darwin.so +0 -0
  46. biotite/sequence/phylo/tree.c +970 -673
  47. biotite/sequence/phylo/tree.cpython-310-darwin.so +0 -0
  48. biotite/sequence/phylo/upgma.c +672 -626
  49. biotite/sequence/phylo/upgma.cpython-310-darwin.so +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.cpython-310-darwin.so +0 -0
  55. biotite/structure/celllist.c +727 -707
  56. biotite/structure/celllist.cpython-310-darwin.so +0 -0
  57. biotite/structure/charges.c +1561 -1560
  58. biotite/structure/charges.cpython-310-darwin.so +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.cpython-310-darwin.so +0 -0
  79. biotite/structure/io/mmtf/convertfile.c +725 -676
  80. biotite/structure/io/mmtf/convertfile.cpython-310-darwin.so +0 -0
  81. biotite/structure/io/mmtf/decode.c +1070 -754
  82. biotite/structure/io/mmtf/decode.cpython-310-darwin.so +0 -0
  83. biotite/structure/io/mmtf/encode.c +727 -677
  84. biotite/structure/io/mmtf/encode.cpython-310-darwin.so +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.cpython-310-darwin.so +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.cpython-310-darwin.so +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.cpython-310-darwin.so +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
@@ -30,7 +30,7 @@ def get_molecule_indices(array):
30
30
  array : AtomArray or AtomArrayStack or BondList
31
31
  The input structure with an associated :class:`BondList`.
32
32
  Alternatively, the :class:`BondList` can be directly supplied.
33
-
33
+
34
34
  Returns
35
35
  -------
36
36
  indices : list of ndarray, dtype=int
@@ -38,7 +38,7 @@ def get_molecule_indices(array):
38
38
  atoms of a single molecule.
39
39
  Consequently, the length of this list is equal to the number of
40
40
  molecules in the input `array`.
41
-
41
+
42
42
  See also
43
43
  --------
44
44
  get_molecule_masks
@@ -63,54 +63,54 @@ def get_molecule_indices(array):
63
63
  >>> print(len(indices))
64
64
  2
65
65
  >>> print(atp[indices[0]])
66
- HET 0 ATP PG P 1.200 -0.226 -6.850
67
- HET 0 ATP O1G O 1.740 1.140 -6.672
68
- HET 0 ATP O2G O 2.123 -1.036 -7.891
69
- HET 0 ATP O3G O -0.302 -0.139 -7.421
70
- HET 0 ATP PB P 0.255 -0.130 -4.446
71
- HET 0 ATP O1B O 0.810 1.234 -4.304
72
- HET 0 ATP O2B O -1.231 -0.044 -5.057
73
- HET 0 ATP O3B O 1.192 -0.990 -5.433
74
- HET 0 ATP PA P -0.745 0.068 -2.071
75
- HET 0 ATP O1A O -2.097 0.143 -2.669
76
- HET 0 ATP O2A O -0.125 1.549 -1.957
77
- HET 0 ATP O3A O 0.203 -0.840 -3.002
78
- HET 0 ATP HOG2 H 2.100 -0.546 -8.725
79
- HET 0 ATP HOG3 H -0.616 -1.048 -7.522
80
- HET 0 ATP HOB2 H -1.554 -0.952 -5.132
81
- HET 0 ATP HOA2 H 0.752 1.455 -1.563
66
+ HET 0 ATP PG P 1.200 -0.230 -6.850
67
+ HET 0 ATP O1G O 1.740 1.140 -6.670
68
+ HET 0 ATP O2G O 2.120 -1.040 -7.890
69
+ HET 0 ATP O3G O -0.300 -0.140 -7.420
70
+ HET 0 ATP PB P 0.260 -0.130 -4.450
71
+ HET 0 ATP O1B O 0.810 1.230 -4.300
72
+ HET 0 ATP O2B O -1.230 -0.040 -5.060
73
+ HET 0 ATP O3B O 1.190 -0.990 -5.430
74
+ HET 0 ATP PA P -0.740 0.070 -2.070
75
+ HET 0 ATP O1A O -2.100 0.140 -2.670
76
+ HET 0 ATP O2A O -0.120 1.550 -1.960
77
+ HET 0 ATP O3A O 0.200 -0.840 -3.000
78
+ HET 0 ATP HOG2 H 2.100 -0.550 -8.730
79
+ HET 0 ATP HOG3 H -0.620 -1.050 -7.520
80
+ HET 0 ATP HOB2 H -1.550 -0.950 -5.130
81
+ HET 0 ATP HOA2 H 0.750 1.460 -1.560
82
82
  >>> print(atp[indices[1]])
83
- HET 0 ATP O5' O -0.844 -0.587 -0.604
84
- HET 0 ATP C5' C -1.694 0.260 0.170
85
- HET 0 ATP C4' C -1.831 -0.309 1.584
86
- HET 0 ATP O4' O -0.542 -0.355 2.234
87
- HET 0 ATP C3' C -2.683 0.630 2.465
88
- HET 0 ATP O3' O -4.033 0.165 2.534
89
- HET 0 ATP C2' C -2.011 0.555 3.856
90
- HET 0 ATP O2' O -2.926 0.043 4.827
91
- HET 0 ATP C1' C -0.830 -0.418 3.647
92
- HET 0 ATP N9 N 0.332 0.015 4.425
93
- HET 0 ATP C8 C 1.302 0.879 4.012
94
- HET 0 ATP N7 N 2.184 1.042 4.955
95
- HET 0 ATP C5 C 1.833 0.300 6.033
96
- HET 0 ATP C6 C 2.391 0.077 7.303
97
- HET 0 ATP N6 N 3.564 0.706 7.681
98
- HET 0 ATP N1 N 1.763 -0.747 8.135
99
- HET 0 ATP C2 C 0.644 -1.352 7.783
100
- HET 0 ATP N3 N 0.088 -1.178 6.602
101
- HET 0 ATP C4 C 0.644 -0.371 5.704
102
- HET 0 ATP H5'1 H -2.678 0.312 -0.296
103
- HET 0 ATP H5'2 H -1.263 1.259 0.221
104
- HET 0 ATP H4' H -2.275 -1.304 1.550
105
- HET 0 ATP H3' H -2.651 1.649 2.078
106
- HET 0 ATP HO3' H -4.515 0.788 3.094
107
- HET 0 ATP H2' H -1.646 1.537 4.157
108
- HET 0 ATP HO2' H -3.667 0.662 4.867
109
- HET 0 ATP H1' H -1.119 -1.430 3.931
110
- HET 0 ATP H8 H 1.334 1.357 3.044
111
- HET 0 ATP HN61 H 3.938 0.548 8.562
112
- HET 0 ATP HN62 H 4.015 1.303 7.064
113
- HET 0 ATP H2 H 0.166 -2.014 8.490
83
+ HET 0 ATP O5' O -0.840 -0.590 -0.600
84
+ HET 0 ATP C5' C -1.690 0.260 0.170
85
+ HET 0 ATP C4' C -1.830 -0.310 1.580
86
+ HET 0 ATP O4' O -0.540 -0.360 2.230
87
+ HET 0 ATP C3' C -2.680 0.630 2.460
88
+ HET 0 ATP O3' O -4.030 0.160 2.530
89
+ HET 0 ATP C2' C -2.010 0.560 3.860
90
+ HET 0 ATP O2' O -2.930 0.040 4.830
91
+ HET 0 ATP C1' C -0.830 -0.420 3.650
92
+ HET 0 ATP N9 N 0.330 0.020 4.430
93
+ HET 0 ATP C8 C 1.300 0.880 4.010
94
+ HET 0 ATP N7 N 2.180 1.040 4.960
95
+ HET 0 ATP C5 C 1.830 0.300 6.030
96
+ HET 0 ATP C6 C 2.390 0.080 7.300
97
+ HET 0 ATP N6 N 3.560 0.710 7.680
98
+ HET 0 ATP N1 N 1.760 -0.750 8.140
99
+ HET 0 ATP C2 C 0.640 -1.350 7.780
100
+ HET 0 ATP N3 N 0.090 -1.180 6.600
101
+ HET 0 ATP C4 C 0.640 -0.370 5.700
102
+ HET 0 ATP H5'1 H -2.680 0.310 -0.300
103
+ HET 0 ATP H5'2 H -1.260 1.260 0.220
104
+ HET 0 ATP H4' H -2.280 -1.300 1.550
105
+ HET 0 ATP H3' H -2.650 1.650 2.080
106
+ HET 0 ATP HO3' H -4.520 0.790 3.090
107
+ HET 0 ATP H2' H -1.650 1.540 4.160
108
+ HET 0 ATP HO2' H -3.670 0.660 4.870
109
+ HET 0 ATP H1' H -1.120 -1.430 3.930
110
+ HET 0 ATP H8 H 1.330 1.360 3.040
111
+ HET 0 ATP HN61 H 3.940 0.550 8.560
112
+ HET 0 ATP HN62 H 4.020 1.300 7.060
113
+ HET 0 ATP H2 H 0.170 -2.010 8.490
114
114
  """
115
115
  if isinstance(array, BondList):
116
116
  bonds = array
@@ -123,7 +123,7 @@ def get_molecule_indices(array):
123
123
  f"Expected a 'BondList', 'AtomArray' or 'AtomArrayStack', "
124
124
  f"not '{type(array).__name__}'"
125
125
  )
126
-
126
+
127
127
  molecule_indices = []
128
128
  visited_mask = np.zeros(bonds.get_atom_count(), dtype=bool)
129
129
  while not visited_mask.all():
@@ -148,15 +148,15 @@ def get_molecule_masks(array):
148
148
  array : AtomArray, shape=(n,) or AtomArrayStack, shape=(m,n) or BondList
149
149
  The input structure with an associated :class:`BondList`.
150
150
  Alternatively, the :class:`BondList` can be directly supplied.
151
-
151
+
152
152
  Returns
153
153
  -------
154
- masks : ndarray, shape=(k,n), dtype=bool,
154
+ masks : ndarray, shape=(k,n), dtype=bool,
155
155
  Each element in the array is a boolean mask referring to the
156
156
  atoms of a single molecule.
157
157
  Consequently, the length of this list is equal to the number of
158
158
  molecules in the input `array`.
159
-
159
+
160
160
  See also
161
161
  --------
162
162
  get_molecule_indices
@@ -181,54 +181,54 @@ def get_molecule_masks(array):
181
181
  >>> print(len(masks))
182
182
  2
183
183
  >>> print(atp[masks[0]])
184
- HET 0 ATP PG P 1.200 -0.226 -6.850
185
- HET 0 ATP O1G O 1.740 1.140 -6.672
186
- HET 0 ATP O2G O 2.123 -1.036 -7.891
187
- HET 0 ATP O3G O -0.302 -0.139 -7.421
188
- HET 0 ATP PB P 0.255 -0.130 -4.446
189
- HET 0 ATP O1B O 0.810 1.234 -4.304
190
- HET 0 ATP O2B O -1.231 -0.044 -5.057
191
- HET 0 ATP O3B O 1.192 -0.990 -5.433
192
- HET 0 ATP PA P -0.745 0.068 -2.071
193
- HET 0 ATP O1A O -2.097 0.143 -2.669
194
- HET 0 ATP O2A O -0.125 1.549 -1.957
195
- HET 0 ATP O3A O 0.203 -0.840 -3.002
196
- HET 0 ATP HOG2 H 2.100 -0.546 -8.725
197
- HET 0 ATP HOG3 H -0.616 -1.048 -7.522
198
- HET 0 ATP HOB2 H -1.554 -0.952 -5.132
199
- HET 0 ATP HOA2 H 0.752 1.455 -1.563
184
+ HET 0 ATP PG P 1.200 -0.230 -6.850
185
+ HET 0 ATP O1G O 1.740 1.140 -6.670
186
+ HET 0 ATP O2G O 2.120 -1.040 -7.890
187
+ HET 0 ATP O3G O -0.300 -0.140 -7.420
188
+ HET 0 ATP PB P 0.260 -0.130 -4.450
189
+ HET 0 ATP O1B O 0.810 1.230 -4.300
190
+ HET 0 ATP O2B O -1.230 -0.040 -5.060
191
+ HET 0 ATP O3B O 1.190 -0.990 -5.430
192
+ HET 0 ATP PA P -0.740 0.070 -2.070
193
+ HET 0 ATP O1A O -2.100 0.140 -2.670
194
+ HET 0 ATP O2A O -0.120 1.550 -1.960
195
+ HET 0 ATP O3A O 0.200 -0.840 -3.000
196
+ HET 0 ATP HOG2 H 2.100 -0.550 -8.730
197
+ HET 0 ATP HOG3 H -0.620 -1.050 -7.520
198
+ HET 0 ATP HOB2 H -1.550 -0.950 -5.130
199
+ HET 0 ATP HOA2 H 0.750 1.460 -1.560
200
200
  >>> print(atp[masks[1]])
201
- HET 0 ATP O5' O -0.844 -0.587 -0.604
202
- HET 0 ATP C5' C -1.694 0.260 0.170
203
- HET 0 ATP C4' C -1.831 -0.309 1.584
204
- HET 0 ATP O4' O -0.542 -0.355 2.234
205
- HET 0 ATP C3' C -2.683 0.630 2.465
206
- HET 0 ATP O3' O -4.033 0.165 2.534
207
- HET 0 ATP C2' C -2.011 0.555 3.856
208
- HET 0 ATP O2' O -2.926 0.043 4.827
209
- HET 0 ATP C1' C -0.830 -0.418 3.647
210
- HET 0 ATP N9 N 0.332 0.015 4.425
211
- HET 0 ATP C8 C 1.302 0.879 4.012
212
- HET 0 ATP N7 N 2.184 1.042 4.955
213
- HET 0 ATP C5 C 1.833 0.300 6.033
214
- HET 0 ATP C6 C 2.391 0.077 7.303
215
- HET 0 ATP N6 N 3.564 0.706 7.681
216
- HET 0 ATP N1 N 1.763 -0.747 8.135
217
- HET 0 ATP C2 C 0.644 -1.352 7.783
218
- HET 0 ATP N3 N 0.088 -1.178 6.602
219
- HET 0 ATP C4 C 0.644 -0.371 5.704
220
- HET 0 ATP H5'1 H -2.678 0.312 -0.296
221
- HET 0 ATP H5'2 H -1.263 1.259 0.221
222
- HET 0 ATP H4' H -2.275 -1.304 1.550
223
- HET 0 ATP H3' H -2.651 1.649 2.078
224
- HET 0 ATP HO3' H -4.515 0.788 3.094
225
- HET 0 ATP H2' H -1.646 1.537 4.157
226
- HET 0 ATP HO2' H -3.667 0.662 4.867
227
- HET 0 ATP H1' H -1.119 -1.430 3.931
228
- HET 0 ATP H8 H 1.334 1.357 3.044
229
- HET 0 ATP HN61 H 3.938 0.548 8.562
230
- HET 0 ATP HN62 H 4.015 1.303 7.064
231
- HET 0 ATP H2 H 0.166 -2.014 8.490
201
+ HET 0 ATP O5' O -0.840 -0.590 -0.600
202
+ HET 0 ATP C5' C -1.690 0.260 0.170
203
+ HET 0 ATP C4' C -1.830 -0.310 1.580
204
+ HET 0 ATP O4' O -0.540 -0.360 2.230
205
+ HET 0 ATP C3' C -2.680 0.630 2.460
206
+ HET 0 ATP O3' O -4.030 0.160 2.530
207
+ HET 0 ATP C2' C -2.010 0.560 3.860
208
+ HET 0 ATP O2' O -2.930 0.040 4.830
209
+ HET 0 ATP C1' C -0.830 -0.420 3.650
210
+ HET 0 ATP N9 N 0.330 0.020 4.430
211
+ HET 0 ATP C8 C 1.300 0.880 4.010
212
+ HET 0 ATP N7 N 2.180 1.040 4.960
213
+ HET 0 ATP C5 C 1.830 0.300 6.030
214
+ HET 0 ATP C6 C 2.390 0.080 7.300
215
+ HET 0 ATP N6 N 3.560 0.710 7.680
216
+ HET 0 ATP N1 N 1.760 -0.750 8.140
217
+ HET 0 ATP C2 C 0.640 -1.350 7.780
218
+ HET 0 ATP N3 N 0.090 -1.180 6.600
219
+ HET 0 ATP C4 C 0.640 -0.370 5.700
220
+ HET 0 ATP H5'1 H -2.680 0.310 -0.300
221
+ HET 0 ATP H5'2 H -1.260 1.260 0.220
222
+ HET 0 ATP H4' H -2.280 -1.300 1.550
223
+ HET 0 ATP H3' H -2.650 1.650 2.080
224
+ HET 0 ATP HO3' H -4.520 0.790 3.090
225
+ HET 0 ATP H2' H -1.650 1.540 4.160
226
+ HET 0 ATP HO2' H -3.670 0.660 4.870
227
+ HET 0 ATP H1' H -1.120 -1.430 3.930
228
+ HET 0 ATP H8 H 1.330 1.360 3.040
229
+ HET 0 ATP HN61 H 3.940 0.550 8.560
230
+ HET 0 ATP HN62 H 4.020 1.300 7.060
231
+ HET 0 ATP H2 H 0.170 -2.010 8.490
232
232
  """
233
233
  if isinstance(array, BondList):
234
234
  bonds = array
@@ -241,7 +241,7 @@ def get_molecule_masks(array):
241
241
  f"Expected a 'BondList', 'AtomArray' or 'AtomArrayStack', "
242
242
  f"not '{type(array).__name__}'"
243
243
  )
244
-
244
+
245
245
  molecule_indices = get_molecule_indices(bonds)
246
246
  molecule_masks = np.zeros(
247
247
  (len(molecule_indices), bonds.get_atom_count()),
@@ -265,12 +265,12 @@ def molecule_iter(array):
265
265
  ----------
266
266
  array : AtomArray or AtomArrayStack
267
267
  The input structure with an associated :class:`BondList`.
268
-
268
+
269
269
  Yields
270
270
  ------
271
271
  molecule : AtomArray or AtomArrayStack
272
272
  A single molecule of the input `array`.
273
-
273
+
274
274
  See also
275
275
  --------
276
276
  get_molecule_indices
@@ -289,61 +289,61 @@ def molecule_iter(array):
289
289
  ... print(molecule)
290
290
  ... print()
291
291
  New molecule
292
- HET 0 ATP PG P 1.200 -0.226 -6.850
293
- HET 0 ATP O1G O 1.740 1.140 -6.672
294
- HET 0 ATP O2G O 2.123 -1.036 -7.891
295
- HET 0 ATP O3G O -0.302 -0.139 -7.421
296
- HET 0 ATP PB P 0.255 -0.130 -4.446
297
- HET 0 ATP O1B O 0.810 1.234 -4.304
298
- HET 0 ATP O2B O -1.231 -0.044 -5.057
299
- HET 0 ATP O3B O 1.192 -0.990 -5.433
300
- HET 0 ATP PA P -0.745 0.068 -2.071
301
- HET 0 ATP O1A O -2.097 0.143 -2.669
302
- HET 0 ATP O2A O -0.125 1.549 -1.957
303
- HET 0 ATP O3A O 0.203 -0.840 -3.002
304
- HET 0 ATP HOG2 H 2.100 -0.546 -8.725
305
- HET 0 ATP HOG3 H -0.616 -1.048 -7.522
306
- HET 0 ATP HOB2 H -1.554 -0.952 -5.132
307
- HET 0 ATP HOA2 H 0.752 1.455 -1.563
292
+ HET 0 ATP PG P 1.200 -0.230 -6.850
293
+ HET 0 ATP O1G O 1.740 1.140 -6.670
294
+ HET 0 ATP O2G O 2.120 -1.040 -7.890
295
+ HET 0 ATP O3G O -0.300 -0.140 -7.420
296
+ HET 0 ATP PB P 0.260 -0.130 -4.450
297
+ HET 0 ATP O1B O 0.810 1.230 -4.300
298
+ HET 0 ATP O2B O -1.230 -0.040 -5.060
299
+ HET 0 ATP O3B O 1.190 -0.990 -5.430
300
+ HET 0 ATP PA P -0.740 0.070 -2.070
301
+ HET 0 ATP O1A O -2.100 0.140 -2.670
302
+ HET 0 ATP O2A O -0.120 1.550 -1.960
303
+ HET 0 ATP O3A O 0.200 -0.840 -3.000
304
+ HET 0 ATP HOG2 H 2.100 -0.550 -8.730
305
+ HET 0 ATP HOG3 H -0.620 -1.050 -7.520
306
+ HET 0 ATP HOB2 H -1.550 -0.950 -5.130
307
+ HET 0 ATP HOA2 H 0.750 1.460 -1.560
308
308
  <BLANKLINE>
309
309
  New molecule
310
- HET 0 ATP O5' O -0.844 -0.587 -0.604
311
- HET 0 ATP C5' C -1.694 0.260 0.170
312
- HET 0 ATP C4' C -1.831 -0.309 1.584
313
- HET 0 ATP O4' O -0.542 -0.355 2.234
314
- HET 0 ATP C3' C -2.683 0.630 2.465
315
- HET 0 ATP O3' O -4.033 0.165 2.534
316
- HET 0 ATP C2' C -2.011 0.555 3.856
317
- HET 0 ATP O2' O -2.926 0.043 4.827
318
- HET 0 ATP C1' C -0.830 -0.418 3.647
319
- HET 0 ATP N9 N 0.332 0.015 4.425
320
- HET 0 ATP C8 C 1.302 0.879 4.012
321
- HET 0 ATP N7 N 2.184 1.042 4.955
322
- HET 0 ATP C5 C 1.833 0.300 6.033
323
- HET 0 ATP C6 C 2.391 0.077 7.303
324
- HET 0 ATP N6 N 3.564 0.706 7.681
325
- HET 0 ATP N1 N 1.763 -0.747 8.135
326
- HET 0 ATP C2 C 0.644 -1.352 7.783
327
- HET 0 ATP N3 N 0.088 -1.178 6.602
328
- HET 0 ATP C4 C 0.644 -0.371 5.704
329
- HET 0 ATP H5'1 H -2.678 0.312 -0.296
330
- HET 0 ATP H5'2 H -1.263 1.259 0.221
331
- HET 0 ATP H4' H -2.275 -1.304 1.550
332
- HET 0 ATP H3' H -2.651 1.649 2.078
333
- HET 0 ATP HO3' H -4.515 0.788 3.094
334
- HET 0 ATP H2' H -1.646 1.537 4.157
335
- HET 0 ATP HO2' H -3.667 0.662 4.867
336
- HET 0 ATP H1' H -1.119 -1.430 3.931
337
- HET 0 ATP H8 H 1.334 1.357 3.044
338
- HET 0 ATP HN61 H 3.938 0.548 8.562
339
- HET 0 ATP HN62 H 4.015 1.303 7.064
340
- HET 0 ATP H2 H 0.166 -2.014 8.490
310
+ HET 0 ATP O5' O -0.840 -0.590 -0.600
311
+ HET 0 ATP C5' C -1.690 0.260 0.170
312
+ HET 0 ATP C4' C -1.830 -0.310 1.580
313
+ HET 0 ATP O4' O -0.540 -0.360 2.230
314
+ HET 0 ATP C3' C -2.680 0.630 2.460
315
+ HET 0 ATP O3' O -4.030 0.160 2.530
316
+ HET 0 ATP C2' C -2.010 0.560 3.860
317
+ HET 0 ATP O2' O -2.930 0.040 4.830
318
+ HET 0 ATP C1' C -0.830 -0.420 3.650
319
+ HET 0 ATP N9 N 0.330 0.020 4.430
320
+ HET 0 ATP C8 C 1.300 0.880 4.010
321
+ HET 0 ATP N7 N 2.180 1.040 4.960
322
+ HET 0 ATP C5 C 1.830 0.300 6.030
323
+ HET 0 ATP C6 C 2.390 0.080 7.300
324
+ HET 0 ATP N6 N 3.560 0.710 7.680
325
+ HET 0 ATP N1 N 1.760 -0.750 8.140
326
+ HET 0 ATP C2 C 0.640 -1.350 7.780
327
+ HET 0 ATP N3 N 0.090 -1.180 6.600
328
+ HET 0 ATP C4 C 0.640 -0.370 5.700
329
+ HET 0 ATP H5'1 H -2.680 0.310 -0.300
330
+ HET 0 ATP H5'2 H -1.260 1.260 0.220
331
+ HET 0 ATP H4' H -2.280 -1.300 1.550
332
+ HET 0 ATP H3' H -2.650 1.650 2.080
333
+ HET 0 ATP HO3' H -4.520 0.790 3.090
334
+ HET 0 ATP H2' H -1.650 1.540 4.160
335
+ HET 0 ATP HO2' H -3.670 0.660 4.870
336
+ HET 0 ATP H1' H -1.120 -1.430 3.930
337
+ HET 0 ATP H8 H 1.330 1.360 3.040
338
+ HET 0 ATP HN61 H 3.940 0.550 8.560
339
+ HET 0 ATP HN62 H 4.020 1.300 7.060
340
+ HET 0 ATP H2 H 0.170 -2.010 8.490
341
341
  <BLANKLINE>
342
342
  """
343
343
  if array.bonds is None:
344
344
  raise ValueError("An associated BondList is required")
345
345
  bonds = array.bonds
346
-
346
+
347
347
  visited_mask = np.zeros(bonds.get_atom_count(), dtype=bool)
348
348
  while not visited_mask.all():
349
349
  # Take the first atom that has not been considered yet as root
@@ -23,10 +23,10 @@ def get_residue_starts(array, add_exclusive_stop=False):
23
23
  """
24
24
  Get indices for an atom array, each indicating the beginning of
25
25
  a residue.
26
-
26
+
27
27
  A new residue starts, either when the chain ID, residue ID,
28
28
  insertion code or residue name changes from one to the next atom.
29
-
29
+
30
30
  Parameters
31
31
  ----------
32
32
  array : AtomArray or AtomArrayStack
@@ -35,12 +35,12 @@ def get_residue_starts(array, add_exclusive_stop=False):
35
35
  If true, the exclusive stop of the input atom array, i.e.
36
36
  ``array.array_length()``, is added to the returned array of
37
37
  start indices as last element.
38
-
38
+
39
39
  Returns
40
40
  -------
41
41
  starts : ndarray, dtype=int
42
42
  The start indices of residues in `array`.
43
-
43
+
44
44
  Notes
45
45
  -----
46
46
  This method is internally used by all other residue-related
@@ -64,17 +64,17 @@ def get_residue_starts(array, add_exclusive_stop=False):
64
64
 
65
65
  # If any of these annotation arrays change, a new residue starts
66
66
  residue_change_mask = (
67
- chain_id_changes |
67
+ chain_id_changes |
68
68
  res_id_changes |
69
- ins_code_changes |
69
+ ins_code_changes |
70
70
  res_name_changes
71
71
  )
72
-
72
+
73
73
  # Convert mask to indices
74
74
  # Add 1, to shift the indices from the end of a residue
75
75
  # to the start of a new residue
76
76
  residue_starts = np.where(residue_change_mask)[0] +1
77
-
77
+
78
78
  # The first residue is not included yet -> Insert '[0]'
79
79
  if add_exclusive_stop:
80
80
  return np.concatenate(([0], residue_starts, [array.array_length()]))
@@ -86,7 +86,7 @@ def apply_residue_wise(array, data, function, axis=None):
86
86
  """
87
87
  Apply a function to intervals of data, where each interval
88
88
  corresponds to one residue.
89
-
89
+
90
90
  The function takes an atom array (stack) and an data array
91
91
  (`ndarray`) of the same length. The function iterates through the
92
92
  residue IDs of the atom array (stack) and identifies intervals of
@@ -94,8 +94,8 @@ def apply_residue_wise(array, data, function, axis=None):
94
94
  partitioned into the same intervals, and each interval (also an
95
95
  :class:`ndarray`) is put as parameter into `function`. Each return value is
96
96
  stored as element in the resulting :class:`ndarray`, therefore each element
97
- corresponds to one residue.
98
-
97
+ corresponds to one residue.
98
+
99
99
  Parameters
100
100
  ----------
101
101
  array : AtomArray or AtomArrayStack
@@ -109,19 +109,19 @@ def apply_residue_wise(array, data, function, axis=None):
109
109
  must return a value with the same shape and data type.
110
110
  axis : int, optional
111
111
  This value is given to the `axis` parameter of `function`.
112
-
112
+
113
113
  Returns
114
114
  -------
115
115
  processed_data : ndarray
116
116
  Residue-wise evaluation of `data` by `function`. The size of the
117
117
  first dimension of this array is equal to the amount of
118
118
  residues.
119
-
119
+
120
120
  Examples
121
121
  --------
122
122
  Calculate residue-wise SASA from atom-wise SASA of a 20 residue
123
123
  peptide.
124
-
124
+
125
125
  >>> sasa_per_atom = sasa(atom_array)
126
126
  >>> print(len(sasa_per_atom))
127
127
  304
@@ -134,7 +134,7 @@ def apply_residue_wise(array, data, function, axis=None):
134
134
  47.811 172.035]
135
135
 
136
136
  Calculate the centroids of each residue for the same peptide.
137
-
137
+
138
138
  >>> print(len(atom_array))
139
139
  304
140
140
  >>> centroids = apply_residue_wise(atom_array, atom_array.coord,
@@ -173,11 +173,11 @@ def spread_residue_wise(array, input_data):
173
173
 
174
174
  Each value in the residue-wise input is assigned to all atoms of
175
175
  this residue:
176
-
176
+
177
177
  ``output_data[i] = input_data[j]``,
178
178
  *i* is incremented from atom to atom,
179
179
  *j* is incremented every residue change.
180
-
180
+
181
181
  Parameters
182
182
  ----------
183
183
  array : AtomArray or AtomArrayStack
@@ -185,18 +185,18 @@ def spread_residue_wise(array, input_data):
185
185
  input_data : ndarray
186
186
  The data to be spread. The length of axis=0 must be equal to
187
187
  the amount of different residue IDs in `array`.
188
-
188
+
189
189
  Returns
190
190
  -------
191
191
  output_data : ndarray
192
192
  Residue-wise spread `input_data`. Length is the same as
193
193
  `array_length()` of `array`.
194
-
194
+
195
195
  Examples
196
196
  --------
197
197
  Spread secondary structure annotation to every atom of a 20 residue
198
198
  peptide (with 304 atoms).
199
-
199
+
200
200
  >>> sse = annotate_sse(atom_array, "A")
201
201
  >>> print(len(sse))
202
202
  20
@@ -242,19 +242,19 @@ def get_residue_masks(array, indices):
242
242
  These indices indicate the atoms to get the corresponding
243
243
  residues for.
244
244
  Negative indices are not allowed.
245
-
245
+
246
246
  Returns
247
247
  -------
248
248
  residues_masks : ndarray, dtype=bool, shape=(k,n)
249
249
  Multiple boolean masks, one for each given index in `indices`.
250
250
  Each array masks the atoms that belong to the same residue as
251
251
  the atom at the given index.
252
-
252
+
253
253
  See also
254
254
  --------
255
255
  get_residue_starts_for
256
256
  get_residue_positions
257
-
257
+
258
258
  Examples
259
259
  --------
260
260
 
@@ -321,18 +321,18 @@ def get_residue_starts_for(array, indices):
321
321
  These indices point to the atoms to get the corresponding
322
322
  residue starts for.
323
323
  Negative indices are not allowed.
324
-
324
+
325
325
  Returns
326
326
  -------
327
327
  start_indices : ndarray, dtype=int, shape=(k,)
328
328
  The indices that point to the residue starts for the input
329
329
  `indices`.
330
-
330
+
331
331
  See also
332
332
  --------
333
333
  get_residue_masks
334
334
  get_residue_positions
335
-
335
+
336
336
  Examples
337
337
  --------
338
338
 
@@ -369,12 +369,12 @@ def get_residue_positions(array, indices):
369
369
  These indices point to the atoms to get the corresponding
370
370
  residue positions for.
371
371
  Negative indices are not allowed.
372
-
372
+
373
373
  Returns
374
374
  -------
375
375
  start_indices : ndarray, dtype=int, shape=(k,)
376
376
  The indices that point to the position of the residues.
377
-
377
+
378
378
  See also
379
379
  --------
380
380
  get_residue_masks
@@ -402,26 +402,26 @@ def get_residue_positions(array, indices):
402
402
  def get_residues(array):
403
403
  """
404
404
  Get the residue IDs and names of an atom array (stack).
405
-
405
+
406
406
  The residues are listed in the same order they occur in the array
407
407
  (stack).
408
-
408
+
409
409
  Parameters
410
410
  ----------
411
411
  array : AtomArray or AtomArrayStack
412
412
  The atom array (stack) to determine the residues from.
413
-
413
+
414
414
  Returns
415
415
  -------
416
416
  ids : ndarray, dtype=int
417
417
  List of residue IDs.
418
- names : ndarray, dtype="U3"
418
+ names : ndarray, dtype="U5"
419
419
  List of residue names.
420
-
420
+
421
421
  Examples
422
422
  --------
423
423
  Get the residue names of a 20 residue peptide.
424
-
424
+
425
425
  >>> print(atom_array.res_name)
426
426
  ['ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN' 'ASN'
427
427
  'ASN' 'ASN' 'ASN' 'ASN' 'LEU' 'LEU' 'LEU' 'LEU' 'LEU' 'LEU' 'LEU' 'LEU'
@@ -461,16 +461,16 @@ def get_residues(array):
461
461
  def get_residue_count(array):
462
462
  """
463
463
  Get the amount of residues in an atom array (stack).
464
-
464
+
465
465
  The count is determined from the `res_id` and `chain_id` annotation.
466
466
  Each time the residue ID or chain ID changes,
467
467
  the count is incremented. Special rules apply to hetero residues.
468
-
468
+
469
469
  Parameters
470
470
  ----------
471
471
  array : AtomArray or AtomArrayStack
472
472
  The atom array (stack) to determine the residues from.
473
-
473
+
474
474
  Returns
475
475
  -------
476
476
  count : int
@@ -482,17 +482,17 @@ def get_residue_count(array):
482
482
  def residue_iter(array):
483
483
  """
484
484
  Iterate over all residues in an atom array (stack).
485
-
485
+
486
486
  Parameters
487
487
  ----------
488
488
  array : AtomArray or AtomArrayStack
489
489
  The atom array (stack) to iterate over.
490
-
490
+
491
491
  Yields
492
492
  ------
493
493
  residue : AtomArray or AtomArrayStack
494
494
  A single residue of the input `array`.
495
-
495
+
496
496
  Examples
497
497
  --------
498
498