biotite 0.38.0__cp311-cp311-win_amd64.whl → 0.40.0__cp311-cp311-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.
- biotite/__init__.py +3 -3
- biotite/application/application.py +33 -28
- biotite/application/dssp/app.py +18 -18
- biotite/application/sra/__init__.py +5 -0
- biotite/application/sra/app.py +337 -55
- biotite/database/entrez/__init__.py +2 -1
- biotite/database/entrez/check.py +14 -3
- biotite/database/entrez/download.py +20 -13
- biotite/database/entrez/key.py +44 -0
- biotite/database/entrez/query.py +38 -34
- biotite/database/pubchem/query.py +44 -44
- biotite/database/rcsb/download.py +19 -14
- biotite/database/rcsb/query.py +46 -46
- biotite/sequence/align/__init__.py +5 -1
- biotite/sequence/align/banded.c +1408 -1025
- biotite/sequence/align/banded.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/buckets.py +69 -0
- biotite/sequence/align/cigar.py +389 -0
- biotite/sequence/align/kmeralphabet.c +3220 -2850
- biotite/sequence/align/kmeralphabet.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmersimilarity.c +713 -663
- biotite/sequence/align/kmersimilarity.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.cpp +68398 -0
- biotite/sequence/align/localgapped.c +1507 -1074
- biotite/sequence/align/localgapped.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/localungapped.c +1143 -833
- biotite/sequence/align/localungapped.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/multiple.c +1569 -1092
- biotite/sequence/align/multiple.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.c +1612 -1212
- biotite/sequence/align/pairwise.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/permutation.c +33259 -0
- biotite/sequence/align/permutation.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/primes.txt +821 -0
- biotite/sequence/align/{kmertable.c → selector.c} +9129 -16497
- biotite/sequence/align/selector.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/tracetable.c +685 -646
- biotite/sequence/align/tracetable.cp311-win_amd64.pyd +0 -0
- biotite/sequence/codec.c +1159 -841
- biotite/sequence/codec.cp311-win_amd64.pyd +0 -0
- biotite/sequence/graphics/alignment.py +212 -2
- biotite/sequence/io/genbank/annotation.py +11 -11
- biotite/sequence/phylo/nj.c +684 -636
- biotite/sequence/phylo/nj.cp311-win_amd64.pyd +0 -0
- biotite/sequence/phylo/tree.c +970 -673
- biotite/sequence/phylo/tree.cp311-win_amd64.pyd +0 -0
- biotite/sequence/phylo/upgma.c +672 -626
- biotite/sequence/phylo/upgma.cp311-win_amd64.pyd +0 -0
- biotite/structure/__init__.py +1 -1
- biotite/structure/atoms.py +1 -1
- biotite/structure/basepairs.py +7 -12
- biotite/structure/bonds.c +3861 -3749
- biotite/structure/bonds.cp311-win_amd64.pyd +0 -0
- biotite/structure/celllist.c +727 -707
- biotite/structure/celllist.cp311-win_amd64.pyd +0 -0
- biotite/structure/charges.c +1561 -1560
- biotite/structure/charges.cp311-win_amd64.pyd +0 -0
- biotite/structure/filter.py +30 -37
- biotite/structure/info/__init__.py +5 -8
- biotite/structure/info/atoms.py +25 -67
- biotite/structure/info/bonds.py +46 -100
- biotite/structure/info/ccd/README.rst +8 -0
- biotite/structure/info/ccd/amino_acids.txt +1646 -0
- biotite/structure/info/ccd/carbohydrates.txt +1133 -0
- biotite/structure/info/ccd/components.bcif +0 -0
- biotite/structure/info/ccd/nucleotides.txt +797 -0
- biotite/structure/info/ccd.py +95 -0
- biotite/structure/info/groups.py +90 -0
- biotite/structure/info/masses.py +21 -20
- biotite/structure/info/misc.py +11 -22
- biotite/structure/info/standardize.py +17 -12
- biotite/structure/io/__init__.py +2 -4
- biotite/structure/io/ctab.py +1 -1
- biotite/structure/io/general.py +37 -43
- biotite/structure/io/mmtf/__init__.py +3 -0
- biotite/structure/io/mmtf/convertarray.c +528 -365
- biotite/structure/io/mmtf/convertarray.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/convertfile.c +725 -676
- biotite/structure/io/mmtf/convertfile.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/decode.c +1070 -754
- biotite/structure/io/mmtf/decode.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/encode.c +727 -677
- biotite/structure/io/mmtf/encode.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/file.py +34 -26
- biotite/structure/io/npz/__init__.py +3 -0
- biotite/structure/io/npz/file.py +21 -18
- biotite/structure/io/pdb/__init__.py +3 -3
- biotite/structure/io/pdb/file.py +72 -70
- biotite/structure/io/pdb/hybrid36.c +540 -478
- biotite/structure/io/pdb/hybrid36.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/pdbqt/file.py +82 -68
- biotite/structure/io/pdbx/__init__.py +13 -6
- biotite/structure/io/pdbx/bcif.py +649 -0
- biotite/structure/io/pdbx/cif.py +1028 -0
- biotite/structure/io/pdbx/component.py +243 -0
- biotite/structure/io/pdbx/convert.py +707 -359
- biotite/structure/io/pdbx/encoding.c +112813 -0
- biotite/structure/io/pdbx/encoding.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/pdbx/error.py +14 -0
- biotite/structure/io/pdbx/legacy.py +267 -0
- biotite/structure/molecules.py +151 -151
- biotite/structure/residues.py +40 -40
- biotite/structure/sasa.c +713 -644
- biotite/structure/sasa.cp311-win_amd64.pyd +0 -0
- biotite/structure/superimpose.py +158 -115
- biotite/visualize.py +9 -11
- {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/METADATA +2 -2
- {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/RECORD +112 -102
- {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/WHEEL +1 -1
- biotite/structure/info/amino_acids.json +0 -1556
- biotite/structure/info/amino_acids.py +0 -42
- biotite/structure/info/carbohydrates.json +0 -1122
- biotite/structure/info/carbohydrates.py +0 -39
- biotite/structure/info/intra_bonds.msgpack +0 -0
- biotite/structure/info/link_types.msgpack +0 -1
- biotite/structure/info/nucleotides.json +0 -772
- biotite/structure/info/nucleotides.py +0 -39
- biotite/structure/info/residue_masses.msgpack +0 -0
- biotite/structure/info/residue_names.msgpack +0 -3
- biotite/structure/info/residues.msgpack +0 -0
- biotite/structure/io/pdbx/file.py +0 -652
- {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/LICENSE.rst +0 -0
- {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/top_level.txt +0 -0
biotite/structure/molecules.py
CHANGED
|
@@ -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.
|
|
67
|
-
HET 0 ATP O1G O 1.740 1.140 -6.
|
|
68
|
-
HET 0 ATP O2G O 2.
|
|
69
|
-
HET 0 ATP O3G O -0.
|
|
70
|
-
HET 0 ATP PB P 0.
|
|
71
|
-
HET 0 ATP O1B O 0.810 1.
|
|
72
|
-
HET 0 ATP O2B O -1.
|
|
73
|
-
HET 0 ATP O3B O 1.
|
|
74
|
-
HET 0 ATP PA P -0.
|
|
75
|
-
HET 0 ATP O1A O -2.
|
|
76
|
-
HET 0 ATP O2A O -0.
|
|
77
|
-
HET 0 ATP O3A O 0.
|
|
78
|
-
HET 0 ATP HOG2 H 2.100 -0.
|
|
79
|
-
HET 0 ATP HOG3 H -0.
|
|
80
|
-
HET 0 ATP HOB2 H -1.
|
|
81
|
-
HET 0 ATP HOA2 H 0.
|
|
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.
|
|
84
|
-
HET 0 ATP C5' C -1.
|
|
85
|
-
HET 0 ATP C4' C -1.
|
|
86
|
-
HET 0 ATP O4' O -0.
|
|
87
|
-
HET 0 ATP C3' C -2.
|
|
88
|
-
HET 0 ATP O3' O -4.
|
|
89
|
-
HET 0 ATP C2' C -2.
|
|
90
|
-
HET 0 ATP O2' O -2.
|
|
91
|
-
HET 0 ATP C1' C -0.830 -0.
|
|
92
|
-
HET 0 ATP N9 N 0.
|
|
93
|
-
HET 0 ATP C8 C 1.
|
|
94
|
-
HET 0 ATP N7 N 2.
|
|
95
|
-
HET 0 ATP C5 C 1.
|
|
96
|
-
HET 0 ATP C6 C 2.
|
|
97
|
-
HET 0 ATP N6 N 3.
|
|
98
|
-
HET 0 ATP N1 N 1.
|
|
99
|
-
HET 0 ATP C2 C 0.
|
|
100
|
-
HET 0 ATP N3 N 0.
|
|
101
|
-
HET 0 ATP C4 C 0.
|
|
102
|
-
HET 0 ATP H5'1 H -2.
|
|
103
|
-
HET 0 ATP H5'2 H -1.
|
|
104
|
-
HET 0 ATP H4' H -2.
|
|
105
|
-
HET 0 ATP H3' H -2.
|
|
106
|
-
HET 0 ATP HO3' H -4.
|
|
107
|
-
HET 0 ATP H2' H -1.
|
|
108
|
-
HET 0 ATP HO2' H -3.
|
|
109
|
-
HET 0 ATP H1' H -1.
|
|
110
|
-
HET 0 ATP H8 H 1.
|
|
111
|
-
HET 0 ATP HN61 H 3.
|
|
112
|
-
HET 0 ATP HN62 H 4.
|
|
113
|
-
HET 0 ATP H2 H 0.
|
|
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.
|
|
185
|
-
HET 0 ATP O1G O 1.740 1.140 -6.
|
|
186
|
-
HET 0 ATP O2G O 2.
|
|
187
|
-
HET 0 ATP O3G O -0.
|
|
188
|
-
HET 0 ATP PB P 0.
|
|
189
|
-
HET 0 ATP O1B O 0.810 1.
|
|
190
|
-
HET 0 ATP O2B O -1.
|
|
191
|
-
HET 0 ATP O3B O 1.
|
|
192
|
-
HET 0 ATP PA P -0.
|
|
193
|
-
HET 0 ATP O1A O -2.
|
|
194
|
-
HET 0 ATP O2A O -0.
|
|
195
|
-
HET 0 ATP O3A O 0.
|
|
196
|
-
HET 0 ATP HOG2 H 2.100 -0.
|
|
197
|
-
HET 0 ATP HOG3 H -0.
|
|
198
|
-
HET 0 ATP HOB2 H -1.
|
|
199
|
-
HET 0 ATP HOA2 H 0.
|
|
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.
|
|
202
|
-
HET 0 ATP C5' C -1.
|
|
203
|
-
HET 0 ATP C4' C -1.
|
|
204
|
-
HET 0 ATP O4' O -0.
|
|
205
|
-
HET 0 ATP C3' C -2.
|
|
206
|
-
HET 0 ATP O3' O -4.
|
|
207
|
-
HET 0 ATP C2' C -2.
|
|
208
|
-
HET 0 ATP O2' O -2.
|
|
209
|
-
HET 0 ATP C1' C -0.830 -0.
|
|
210
|
-
HET 0 ATP N9 N 0.
|
|
211
|
-
HET 0 ATP C8 C 1.
|
|
212
|
-
HET 0 ATP N7 N 2.
|
|
213
|
-
HET 0 ATP C5 C 1.
|
|
214
|
-
HET 0 ATP C6 C 2.
|
|
215
|
-
HET 0 ATP N6 N 3.
|
|
216
|
-
HET 0 ATP N1 N 1.
|
|
217
|
-
HET 0 ATP C2 C 0.
|
|
218
|
-
HET 0 ATP N3 N 0.
|
|
219
|
-
HET 0 ATP C4 C 0.
|
|
220
|
-
HET 0 ATP H5'1 H -2.
|
|
221
|
-
HET 0 ATP H5'2 H -1.
|
|
222
|
-
HET 0 ATP H4' H -2.
|
|
223
|
-
HET 0 ATP H3' H -2.
|
|
224
|
-
HET 0 ATP HO3' H -4.
|
|
225
|
-
HET 0 ATP H2' H -1.
|
|
226
|
-
HET 0 ATP HO2' H -3.
|
|
227
|
-
HET 0 ATP H1' H -1.
|
|
228
|
-
HET 0 ATP H8 H 1.
|
|
229
|
-
HET 0 ATP HN61 H 3.
|
|
230
|
-
HET 0 ATP HN62 H 4.
|
|
231
|
-
HET 0 ATP H2 H 0.
|
|
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.
|
|
293
|
-
HET 0 ATP O1G O 1.740 1.140 -6.
|
|
294
|
-
HET 0 ATP O2G O 2.
|
|
295
|
-
HET 0 ATP O3G O -0.
|
|
296
|
-
HET 0 ATP PB P 0.
|
|
297
|
-
HET 0 ATP O1B O 0.810 1.
|
|
298
|
-
HET 0 ATP O2B O -1.
|
|
299
|
-
HET 0 ATP O3B O 1.
|
|
300
|
-
HET 0 ATP PA P -0.
|
|
301
|
-
HET 0 ATP O1A O -2.
|
|
302
|
-
HET 0 ATP O2A O -0.
|
|
303
|
-
HET 0 ATP O3A O 0.
|
|
304
|
-
HET 0 ATP HOG2 H 2.100 -0.
|
|
305
|
-
HET 0 ATP HOG3 H -0.
|
|
306
|
-
HET 0 ATP HOB2 H -1.
|
|
307
|
-
HET 0 ATP HOA2 H 0.
|
|
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.
|
|
311
|
-
HET 0 ATP C5' C -1.
|
|
312
|
-
HET 0 ATP C4' C -1.
|
|
313
|
-
HET 0 ATP O4' O -0.
|
|
314
|
-
HET 0 ATP C3' C -2.
|
|
315
|
-
HET 0 ATP O3' O -4.
|
|
316
|
-
HET 0 ATP C2' C -2.
|
|
317
|
-
HET 0 ATP O2' O -2.
|
|
318
|
-
HET 0 ATP C1' C -0.830 -0.
|
|
319
|
-
HET 0 ATP N9 N 0.
|
|
320
|
-
HET 0 ATP C8 C 1.
|
|
321
|
-
HET 0 ATP N7 N 2.
|
|
322
|
-
HET 0 ATP C5 C 1.
|
|
323
|
-
HET 0 ATP C6 C 2.
|
|
324
|
-
HET 0 ATP N6 N 3.
|
|
325
|
-
HET 0 ATP N1 N 1.
|
|
326
|
-
HET 0 ATP C2 C 0.
|
|
327
|
-
HET 0 ATP N3 N 0.
|
|
328
|
-
HET 0 ATP C4 C 0.
|
|
329
|
-
HET 0 ATP H5'1 H -2.
|
|
330
|
-
HET 0 ATP H5'2 H -1.
|
|
331
|
-
HET 0 ATP H4' H -2.
|
|
332
|
-
HET 0 ATP H3' H -2.
|
|
333
|
-
HET 0 ATP HO3' H -4.
|
|
334
|
-
HET 0 ATP H2' H -1.
|
|
335
|
-
HET 0 ATP HO2' H -3.
|
|
336
|
-
HET 0 ATP H1' H -1.
|
|
337
|
-
HET 0 ATP H8 H 1.
|
|
338
|
-
HET 0 ATP HN61 H 3.
|
|
339
|
-
HET 0 ATP HN62 H 4.
|
|
340
|
-
HET 0 ATP H2 H 0.
|
|
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
|
biotite/structure/residues.py
CHANGED
|
@@ -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="
|
|
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
|
|