biotite 1.1.0__cp313-cp313-win_amd64.whl → 1.2.0__cp313-cp313-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/application/application.py +3 -3
- biotite/application/autodock/app.py +1 -1
- biotite/application/blast/webapp.py +1 -1
- biotite/application/clustalo/app.py +1 -1
- biotite/application/localapp.py +2 -2
- biotite/application/msaapp.py +10 -10
- biotite/application/muscle/app3.py +3 -3
- biotite/application/muscle/app5.py +3 -3
- biotite/application/sra/app.py +0 -5
- biotite/application/util.py +21 -1
- biotite/application/viennarna/rnaalifold.py +8 -8
- biotite/application/viennarna/rnaplot.py +3 -1
- biotite/application/viennarna/util.py +1 -1
- biotite/application/webapp.py +1 -1
- biotite/database/afdb/__init__.py +12 -0
- biotite/database/afdb/download.py +191 -0
- biotite/database/entrez/dbnames.py +10 -0
- biotite/database/entrez/download.py +9 -10
- biotite/database/entrez/key.py +1 -1
- biotite/database/entrez/query.py +5 -4
- biotite/database/pubchem/download.py +6 -6
- biotite/database/pubchem/error.py +10 -0
- biotite/database/pubchem/query.py +12 -23
- biotite/database/rcsb/download.py +3 -2
- biotite/database/rcsb/query.py +2 -3
- biotite/database/uniprot/check.py +2 -2
- biotite/database/uniprot/download.py +2 -5
- biotite/database/uniprot/query.py +3 -4
- biotite/file.py +14 -2
- biotite/interface/__init__.py +19 -0
- biotite/interface/openmm/__init__.py +16 -0
- biotite/interface/openmm/state.py +93 -0
- biotite/interface/openmm/system.py +227 -0
- biotite/interface/pymol/__init__.py +198 -0
- biotite/interface/pymol/cgo.py +346 -0
- biotite/interface/pymol/convert.py +185 -0
- biotite/interface/pymol/display.py +267 -0
- biotite/interface/pymol/object.py +1226 -0
- biotite/interface/pymol/shapes.py +178 -0
- biotite/interface/pymol/startup.py +169 -0
- biotite/interface/rdkit/__init__.py +15 -0
- biotite/interface/rdkit/mol.py +490 -0
- biotite/interface/version.py +71 -0
- biotite/interface/warning.py +19 -0
- biotite/sequence/align/__init__.py +0 -4
- biotite/sequence/align/alignment.py +33 -11
- biotite/sequence/align/banded.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/banded.pyx +21 -21
- biotite/sequence/align/cigar.py +2 -2
- biotite/sequence/align/kmeralphabet.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/kmeralphabet.pyx +2 -2
- biotite/sequence/align/kmersimilarity.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.pyx +6 -6
- biotite/sequence/align/localgapped.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/localgapped.pyx +47 -47
- biotite/sequence/align/localungapped.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/localungapped.pyx +10 -10
- biotite/sequence/align/matrix.py +12 -3
- biotite/sequence/align/multiple.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.pyx +35 -35
- biotite/sequence/align/permutation.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/selector.cp313-win_amd64.pyd +0 -0
- biotite/sequence/align/selector.pyx +2 -2
- biotite/sequence/align/statistics.py +1 -1
- biotite/sequence/align/tracetable.cp313-win_amd64.pyd +0 -0
- biotite/sequence/alphabet.py +2 -2
- biotite/sequence/annotation.py +19 -13
- biotite/sequence/codec.cp313-win_amd64.pyd +0 -0
- biotite/sequence/codon.py +1 -2
- biotite/sequence/graphics/alignment.py +25 -39
- biotite/sequence/graphics/dendrogram.py +4 -2
- biotite/sequence/graphics/features.py +2 -2
- biotite/sequence/graphics/logo.py +10 -12
- biotite/sequence/io/fasta/convert.py +1 -2
- biotite/sequence/io/fasta/file.py +1 -1
- biotite/sequence/io/fastq/file.py +3 -3
- biotite/sequence/io/genbank/file.py +3 -3
- biotite/sequence/io/genbank/sequence.py +2 -0
- biotite/sequence/io/gff/convert.py +1 -1
- biotite/sequence/io/gff/file.py +1 -2
- biotite/sequence/phylo/nj.cp313-win_amd64.pyd +0 -0
- biotite/sequence/phylo/tree.cp313-win_amd64.pyd +0 -0
- biotite/sequence/phylo/upgma.cp313-win_amd64.pyd +0 -0
- biotite/sequence/profile.py +19 -25
- biotite/sequence/search.py +0 -1
- biotite/sequence/seqtypes.py +12 -5
- biotite/sequence/sequence.py +1 -2
- biotite/structure/__init__.py +2 -0
- biotite/structure/alphabet/i3d.py +1 -2
- biotite/structure/alphabet/pb.py +1 -2
- biotite/structure/alphabet/unkerasify.py +8 -2
- biotite/structure/atoms.py +35 -27
- biotite/structure/basepairs.py +26 -26
- biotite/structure/bonds.cp313-win_amd64.pyd +0 -0
- biotite/structure/bonds.pyx +8 -5
- biotite/structure/box.py +19 -21
- biotite/structure/celllist.cp313-win_amd64.pyd +0 -0
- biotite/structure/celllist.pyx +83 -67
- biotite/structure/chains.py +5 -37
- biotite/structure/charges.cp313-win_amd64.pyd +0 -0
- biotite/structure/compare.py +420 -13
- biotite/structure/density.py +1 -1
- biotite/structure/dotbracket.py +27 -28
- biotite/structure/filter.py +8 -8
- biotite/structure/geometry.py +15 -15
- biotite/structure/hbond.py +17 -19
- biotite/structure/info/atoms.py +11 -2
- biotite/structure/info/ccd.py +0 -2
- biotite/structure/info/components.bcif +0 -0
- biotite/structure/info/groups.py +0 -3
- biotite/structure/info/misc.py +0 -1
- biotite/structure/info/radii.py +92 -22
- biotite/structure/info/standardize.py +1 -2
- biotite/structure/integrity.py +4 -6
- biotite/structure/io/general.py +2 -2
- biotite/structure/io/gro/file.py +8 -9
- biotite/structure/io/mol/convert.py +1 -1
- biotite/structure/io/mol/ctab.py +33 -28
- biotite/structure/io/mol/mol.py +1 -1
- biotite/structure/io/mol/sdf.py +39 -13
- biotite/structure/io/pdb/convert.py +2 -3
- biotite/structure/io/pdb/file.py +11 -22
- biotite/structure/io/pdb/hybrid36.cp313-win_amd64.pyd +0 -0
- biotite/structure/io/pdbqt/file.py +4 -4
- biotite/structure/io/pdbx/bcif.py +22 -7
- biotite/structure/io/pdbx/cif.py +20 -7
- biotite/structure/io/pdbx/component.py +6 -0
- biotite/structure/io/pdbx/compress.py +2 -2
- biotite/structure/io/pdbx/convert.py +222 -33
- biotite/structure/io/pdbx/encoding.cp313-win_amd64.pyd +0 -0
- biotite/structure/io/trajfile.py +9 -6
- biotite/structure/io/util.py +38 -0
- biotite/structure/mechanics.py +0 -1
- biotite/structure/molecules.py +0 -15
- biotite/structure/pseudoknots.py +7 -13
- biotite/structure/repair.py +2 -4
- biotite/structure/residues.py +13 -24
- biotite/structure/rings.py +335 -0
- biotite/structure/sasa.cp313-win_amd64.pyd +0 -0
- biotite/structure/sasa.pyx +2 -1
- biotite/structure/segments.py +68 -9
- biotite/structure/sequence.py +0 -1
- biotite/structure/sse.py +0 -2
- biotite/structure/superimpose.py +74 -62
- biotite/structure/tm.py +581 -0
- biotite/structure/transform.py +12 -25
- biotite/structure/util.py +3 -3
- biotite/version.py +9 -4
- biotite/visualize.py +111 -1
- {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/METADATA +5 -3
- {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/RECORD +155 -135
- {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/WHEEL +0 -0
- {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/licenses/LICENSE.rst +0 -0
biotite/structure/geometry.py
CHANGED
|
@@ -60,9 +60,9 @@ def displacement(atoms1, atoms2, box=None):
|
|
|
60
60
|
The displacement vector(s). The shape is equal to the shape of
|
|
61
61
|
the input `atoms` with the highest dimensionality.
|
|
62
62
|
|
|
63
|
-
See
|
|
63
|
+
See Also
|
|
64
64
|
--------
|
|
65
|
-
index_displacement
|
|
65
|
+
index_displacement : The same calculation, but using atom indices.
|
|
66
66
|
"""
|
|
67
67
|
v1 = coord(atoms1)
|
|
68
68
|
v2 = coord(atoms2)
|
|
@@ -191,7 +191,7 @@ def index_displacement(*args, **kwargs):
|
|
|
191
191
|
copy is found for non-orthorhombic boxes; this is especially true
|
|
192
192
|
for heavily skewed boxes.
|
|
193
193
|
|
|
194
|
-
See
|
|
194
|
+
See Also
|
|
195
195
|
--------
|
|
196
196
|
displacement
|
|
197
197
|
"""
|
|
@@ -224,9 +224,9 @@ def distance(atoms1, atoms2, box=None):
|
|
|
224
224
|
The shape is equal to the shape of the input `atoms` with the
|
|
225
225
|
highest dimensionality minus the last axis.
|
|
226
226
|
|
|
227
|
-
See
|
|
227
|
+
See Also
|
|
228
228
|
--------
|
|
229
|
-
index_distance
|
|
229
|
+
index_distance : The same calculation, but using atom indices.
|
|
230
230
|
"""
|
|
231
231
|
diff = displacement(atoms1, atoms2, box)
|
|
232
232
|
return np.sqrt(vector_dot(diff, diff))
|
|
@@ -282,7 +282,7 @@ def index_distance(*args, **kwargs):
|
|
|
282
282
|
copy is found for non-orthorhombic boxes; this is especially true
|
|
283
283
|
for heavily skewed boxes.
|
|
284
284
|
|
|
285
|
-
See
|
|
285
|
+
See Also
|
|
286
286
|
--------
|
|
287
287
|
distance
|
|
288
288
|
"""
|
|
@@ -312,9 +312,9 @@ def angle(atoms1, atoms2, atoms3, box=None):
|
|
|
312
312
|
of the input `atoms` with the highest dimensionality minus the
|
|
313
313
|
last axis.
|
|
314
314
|
|
|
315
|
-
See
|
|
315
|
+
See Also
|
|
316
316
|
--------
|
|
317
|
-
index_angle
|
|
317
|
+
index_angle : The same calculation, but using atom indices.
|
|
318
318
|
"""
|
|
319
319
|
v1 = displacement(atoms1, atoms2, box)
|
|
320
320
|
v2 = displacement(atoms3, atoms2, box)
|
|
@@ -371,7 +371,7 @@ def index_angle(*args, **kwargs):
|
|
|
371
371
|
copy is found for non-orthorhombic boxes; this is especially true
|
|
372
372
|
for heavily skewed boxes.
|
|
373
373
|
|
|
374
|
-
See
|
|
374
|
+
See Also
|
|
375
375
|
--------
|
|
376
376
|
angle
|
|
377
377
|
"""
|
|
@@ -404,8 +404,8 @@ def dihedral(atoms1, atoms2, atoms3, atoms4, box=None):
|
|
|
404
404
|
|
|
405
405
|
See Also
|
|
406
406
|
--------
|
|
407
|
-
index_dihedral
|
|
408
|
-
dihedral_backbone
|
|
407
|
+
index_dihedral : The same calculation, but using atom indices.
|
|
408
|
+
dihedral_backbone : Calculate the dihedral angle along a peptide backbone.
|
|
409
409
|
"""
|
|
410
410
|
v1 = displacement(atoms1, atoms2, box)
|
|
411
411
|
v2 = displacement(atoms2, atoms3, box)
|
|
@@ -472,7 +472,7 @@ def index_dihedral(*args, **kwargs):
|
|
|
472
472
|
copy is found for non-orthorhombic boxes; this is especially true
|
|
473
473
|
for heavily skewed boxes.
|
|
474
474
|
|
|
475
|
-
See
|
|
475
|
+
See Also
|
|
476
476
|
--------
|
|
477
477
|
dihedral
|
|
478
478
|
dihedral_backbone
|
|
@@ -486,7 +486,7 @@ def dihedral_backbone(atom_array):
|
|
|
486
486
|
|
|
487
487
|
Parameters
|
|
488
488
|
----------
|
|
489
|
-
|
|
489
|
+
atom_array : AtomArray or AtomArrayStack
|
|
490
490
|
The protein structure to measure the dihedral angles for.
|
|
491
491
|
For missing backbone atoms the corresponding angles are `NaN`.
|
|
492
492
|
|
|
@@ -568,7 +568,7 @@ def centroid(atoms):
|
|
|
568
568
|
|
|
569
569
|
Parameters
|
|
570
570
|
----------
|
|
571
|
-
atoms: ndarray or AtomArray or AtomArrayStack
|
|
571
|
+
atoms : ndarray or AtomArray or AtomArrayStack
|
|
572
572
|
The structures to determine the centroid from.
|
|
573
573
|
Alternatively an ndarray containing the coordinates can be
|
|
574
574
|
provided.
|
|
@@ -603,7 +603,7 @@ def _call_non_index_function(
|
|
|
603
603
|
box = atoms.box
|
|
604
604
|
else:
|
|
605
605
|
raise ValueError(
|
|
606
|
-
"If `atoms` are coordinates,
|
|
606
|
+
"If `atoms` are coordinates, the box must be set explicitly"
|
|
607
607
|
)
|
|
608
608
|
else:
|
|
609
609
|
box = None
|
biotite/structure/hbond.py
CHANGED
|
@@ -43,30 +43,28 @@ def hbond(
|
|
|
43
43
|
----------
|
|
44
44
|
atoms : AtomArray or AtomArrayStack
|
|
45
45
|
The atoms to find hydrogen bonds in.
|
|
46
|
-
selection1, selection2: ndarray
|
|
46
|
+
selection1, selection2 : ndarray, optional
|
|
47
47
|
Boolean mask for atoms to limit the hydrogen bond search to
|
|
48
48
|
specific sections of the model. The shape must match the
|
|
49
49
|
shape of the `atoms` argument. If None is given, the whole atoms
|
|
50
|
-
stack is used instead.
|
|
51
|
-
selection1_type: {'acceptor', 'donor', 'both'}, optional
|
|
50
|
+
stack is used instead.
|
|
51
|
+
selection1_type : {'acceptor', 'donor', 'both'}, optional
|
|
52
52
|
Determines the type of `selection1`.
|
|
53
53
|
The type of `selection2` is chosen accordingly
|
|
54
54
|
('both' or the opposite).
|
|
55
|
-
(Default: 'both')
|
|
56
55
|
cutoff_dist : float, optional
|
|
57
56
|
The maximal distance between the hydrogen and acceptor to be
|
|
58
|
-
considered a hydrogen bond.
|
|
57
|
+
considered a hydrogen bond.
|
|
59
58
|
cutoff_angle : float, optional
|
|
60
59
|
The angle cutoff in degree between Donor-H..Acceptor to be
|
|
61
|
-
considered a hydrogen bond
|
|
62
|
-
donor_elements, acceptor_elements: tuple of str
|
|
60
|
+
considered a hydrogen bond.
|
|
61
|
+
donor_elements, acceptor_elements : tuple of str
|
|
63
62
|
Elements to be considered as possible donors or acceptors
|
|
64
63
|
(Default: O, N, S).
|
|
65
64
|
periodic : bool, optional
|
|
66
65
|
If true, hydrogen bonds can also be detected in periodic
|
|
67
66
|
boundary conditions.
|
|
68
67
|
The `box` attribute of `atoms` is required in this case.
|
|
69
|
-
(Default: False).
|
|
70
68
|
|
|
71
69
|
Returns
|
|
72
70
|
-------
|
|
@@ -82,6 +80,10 @@ def hbond(
|
|
|
82
80
|
`triplets` is present in the model *m* of the input `atoms`.
|
|
83
81
|
Only returned if `atoms` is an :class:`AtomArrayStack`.
|
|
84
82
|
|
|
83
|
+
See Also
|
|
84
|
+
--------
|
|
85
|
+
hbond_frequency : Compute the frequency of each bond over the models.
|
|
86
|
+
|
|
85
87
|
Notes
|
|
86
88
|
-----
|
|
87
89
|
The result of this function may include false positives:
|
|
@@ -92,6 +94,11 @@ def hbond(
|
|
|
92
94
|
considered as acceptor atom by this method, although this does
|
|
93
95
|
make sense from a chemical perspective.
|
|
94
96
|
|
|
97
|
+
References
|
|
98
|
+
----------
|
|
99
|
+
|
|
100
|
+
.. footbibliography::
|
|
101
|
+
|
|
95
102
|
Examples
|
|
96
103
|
--------
|
|
97
104
|
Calculate the total number of hydrogen bonds found in each model:
|
|
@@ -122,15 +129,6 @@ def hbond(
|
|
|
122
129
|
A 15 GLY N N 8.320 -3.632 -0.318
|
|
123
130
|
A 16 ARG N N 8.043 -1.206 -1.866
|
|
124
131
|
A 6 TRP NE1 N 3.420 0.332 -0.121
|
|
125
|
-
|
|
126
|
-
See Also
|
|
127
|
-
--------
|
|
128
|
-
hbond_frequency
|
|
129
|
-
|
|
130
|
-
References
|
|
131
|
-
----------
|
|
132
|
-
|
|
133
|
-
.. footbibliography::
|
|
134
132
|
"""
|
|
135
133
|
if not (atoms.element == "H").any():
|
|
136
134
|
warnings.warn(
|
|
@@ -400,7 +398,7 @@ def hbond_frequency(mask):
|
|
|
400
398
|
|
|
401
399
|
Parameters
|
|
402
400
|
----------
|
|
403
|
-
mask: ndarray, dtype=bool, shape=(m,n)
|
|
401
|
+
mask : ndarray, dtype=bool, shape=(m,n)
|
|
404
402
|
Input mask obtained from `hbond` function.
|
|
405
403
|
|
|
406
404
|
Returns
|
|
@@ -412,7 +410,7 @@ def hbond_frequency(mask):
|
|
|
412
410
|
|
|
413
411
|
See Also
|
|
414
412
|
--------
|
|
415
|
-
hbond
|
|
413
|
+
hbond : Returns the mask that can be input into this function.
|
|
416
414
|
|
|
417
415
|
Examples
|
|
418
416
|
--------
|
biotite/structure/info/atoms.py
CHANGED
|
@@ -18,7 +18,7 @@ NON_HETERO_RESIDUES = set([
|
|
|
18
18
|
# fmt: on
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def residue(res_name):
|
|
21
|
+
def residue(res_name, allow_missing_coord=False):
|
|
22
22
|
"""
|
|
23
23
|
Get an atom array, representing the residue with the given name.
|
|
24
24
|
|
|
@@ -30,6 +30,11 @@ def residue(res_name):
|
|
|
30
30
|
----------
|
|
31
31
|
res_name : str
|
|
32
32
|
The up to 3-letter name of the residue.
|
|
33
|
+
allow_missing_coord : bool, optional
|
|
34
|
+
Whether to allow missing coordinate values in the residue.
|
|
35
|
+
If ``True``, these will be represented as ``nan`` values.
|
|
36
|
+
If ``False``, a ``ValueError`` is raised when missing coordinates
|
|
37
|
+
are encountered.
|
|
33
38
|
|
|
34
39
|
Returns
|
|
35
40
|
-------
|
|
@@ -74,7 +79,11 @@ def residue(res_name):
|
|
|
74
79
|
from biotite.structure.io.pdbx import get_component
|
|
75
80
|
|
|
76
81
|
try:
|
|
77
|
-
component = get_component(
|
|
82
|
+
component = get_component(
|
|
83
|
+
get_ccd(),
|
|
84
|
+
res_name=res_name,
|
|
85
|
+
allow_missing_coord=allow_missing_coord,
|
|
86
|
+
)
|
|
78
87
|
except KeyError:
|
|
79
88
|
raise KeyError(f"No atom information found for residue '{res_name}' in CCD")
|
|
80
89
|
component.hetero[:] = res_name not in NON_HETERO_RESIDUES
|
biotite/structure/info/ccd.py
CHANGED
|
@@ -44,7 +44,6 @@ def get_ccd():
|
|
|
44
44
|
----------
|
|
45
45
|
|
|
46
46
|
.. footbibliography::
|
|
47
|
-
|
|
48
47
|
"""
|
|
49
48
|
# Avoid circular import
|
|
50
49
|
from biotite.structure.io.pdbx.bcif import BinaryCIFFile
|
|
@@ -123,7 +122,6 @@ def get_from_ccd(category_name, comp_id, column_name=None):
|
|
|
123
122
|
----------
|
|
124
123
|
|
|
125
124
|
.. footbibliography::
|
|
126
|
-
|
|
127
125
|
"""
|
|
128
126
|
try:
|
|
129
127
|
start, stop = _residue_index(category_name)[comp_id]
|
|
Binary file
|
biotite/structure/info/groups.py
CHANGED
|
@@ -61,7 +61,6 @@ def amino_acid_names():
|
|
|
61
61
|
----------
|
|
62
62
|
|
|
63
63
|
.. footbibliography::
|
|
64
|
-
|
|
65
64
|
"""
|
|
66
65
|
return _get_group_members(_AMINO_ACID_TYPES)
|
|
67
66
|
|
|
@@ -83,7 +82,6 @@ def nucleotide_names():
|
|
|
83
82
|
----------
|
|
84
83
|
|
|
85
84
|
.. footbibliography::
|
|
86
|
-
|
|
87
85
|
"""
|
|
88
86
|
return _get_group_members(_NUCLEOTIDE_TYPES)
|
|
89
87
|
|
|
@@ -105,7 +103,6 @@ def carbohydrate_names():
|
|
|
105
103
|
----------
|
|
106
104
|
|
|
107
105
|
.. footbibliography::
|
|
108
|
-
|
|
109
106
|
"""
|
|
110
107
|
return _get_group_members(_CARBOHYDRATE_TYPES)
|
|
111
108
|
|
biotite/structure/info/misc.py
CHANGED
biotite/structure/info/radii.py
CHANGED
|
@@ -26,37 +26,106 @@ _PROTOR_RADII = {
|
|
|
26
26
|
("S", 1, 0) : 1.77,
|
|
27
27
|
("S", 2, 0) : 1.77, # Not official, added for completeness (MET)
|
|
28
28
|
("S", 2, 1) : 1.77,
|
|
29
|
-
("F", 1, 0) : 1.47, # Taken from
|
|
30
|
-
("CL", 1, 0) : 1.75, # Taken from
|
|
31
|
-
("BR", 1, 0) : 1.85, # Taken from
|
|
29
|
+
("F", 1, 0) : 1.47, # Taken from _SINGLE_ATOM_VDW_RADII
|
|
30
|
+
("CL", 1, 0) : 1.75, # Taken from _SINGLE_ATOM_VDW_RADII
|
|
31
|
+
("BR", 1, 0) : 1.85, # Taken from _SINGLE_ATOM_VDW_RADII
|
|
32
32
|
("I", 1, 0) : 1.98, # Taken from _SINGLE_RADII
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
_SINGLE_ATOM_VDW_RADII = {
|
|
36
|
+
# Main group
|
|
37
|
+
# Row 1 (Period 1)
|
|
38
|
+
"H": 1.10,
|
|
37
39
|
"HE": 1.40,
|
|
38
40
|
|
|
41
|
+
# Row 2 (Period 2)
|
|
42
|
+
"LI": 1.81,
|
|
43
|
+
"BE": 1.53,
|
|
44
|
+
"B": 1.92,
|
|
39
45
|
"C": 1.70,
|
|
40
46
|
"N": 1.55,
|
|
41
47
|
"O": 1.52,
|
|
42
48
|
"F": 1.47,
|
|
43
49
|
"NE": 1.54,
|
|
44
50
|
|
|
51
|
+
# Row 3 (Period 3)
|
|
52
|
+
"NA": 2.27,
|
|
53
|
+
"MG": 1.73,
|
|
54
|
+
"AL": 1.84,
|
|
45
55
|
"SI": 2.10,
|
|
46
56
|
"P": 1.80,
|
|
47
57
|
"S": 1.80,
|
|
48
58
|
"CL": 1.75,
|
|
49
59
|
"AR": 1.88,
|
|
50
60
|
|
|
61
|
+
# Row 4 (Period 4)
|
|
62
|
+
"K": 2.75,
|
|
63
|
+
"CA": 2.31,
|
|
64
|
+
"GA": 1.87,
|
|
65
|
+
"GE": 2.11,
|
|
51
66
|
"AS": 1.85,
|
|
52
67
|
"SE": 1.90,
|
|
53
|
-
"BR": 1.
|
|
68
|
+
"BR": 1.83,
|
|
54
69
|
"KR": 2.02,
|
|
55
70
|
|
|
71
|
+
# Row 5 (Period 5)
|
|
72
|
+
"RB": 3.03,
|
|
73
|
+
"SR": 2.49,
|
|
74
|
+
"IN": 1.93,
|
|
75
|
+
"SN": 2.17,
|
|
76
|
+
"SB": 2.06,
|
|
56
77
|
"TE": 2.06,
|
|
57
78
|
"I": 1.98,
|
|
58
79
|
"XE": 2.16,
|
|
80
|
+
|
|
81
|
+
# Row 6 (Period 6)
|
|
82
|
+
"CS": 3.43,
|
|
83
|
+
"BA": 2.68,
|
|
84
|
+
"TL": 1.96,
|
|
85
|
+
"PB": 2.02,
|
|
86
|
+
"BI": 2.07,
|
|
87
|
+
"PO": 1.97,
|
|
88
|
+
"AT": 2.02,
|
|
89
|
+
"RN": 2.20,
|
|
90
|
+
|
|
91
|
+
# Row 7 (Period 7)
|
|
92
|
+
"FR": 3.48,
|
|
93
|
+
"RA": 2.83,
|
|
94
|
+
|
|
95
|
+
# Transition metals (relevant ones only)
|
|
96
|
+
# Row 1
|
|
97
|
+
"FE": 2.05,
|
|
98
|
+
"CU": 2.00,
|
|
99
|
+
"ZN": 2.10,
|
|
100
|
+
"MN": 2.05,
|
|
101
|
+
"CO": 2.00,
|
|
102
|
+
"NI": 2.00,
|
|
103
|
+
|
|
104
|
+
# Row 2
|
|
105
|
+
'MO': 2.10,
|
|
106
|
+
'RU': 2.05,
|
|
107
|
+
|
|
108
|
+
# Row 3
|
|
109
|
+
'W': 2.10,
|
|
110
|
+
'PT': 2.05,
|
|
111
|
+
'AU': 2.10,
|
|
59
112
|
}
|
|
113
|
+
"""
|
|
114
|
+
Van der Waals radii for main group and transition elements.
|
|
115
|
+
|
|
116
|
+
Main group:
|
|
117
|
+
Source: https://pubs.acs.org/doi/10.1021/jp8111556, Table 12 (Mantina et al. 2009)
|
|
118
|
+
|
|
119
|
+
Transition metals:
|
|
120
|
+
Source: RDKit, 2024.9.4 Release
|
|
121
|
+
https://github.com/rdkit/rdkit/blob/af6347963f25cfe8fe4db0638410b2f3a8e8bd89/Code/GraphMol/atomic_data.cpp#L51
|
|
122
|
+
|
|
123
|
+
Where available, these values were cross-checked vs the CRC Handbook of
|
|
124
|
+
Chemistry and Physics (105th edition) and verified that they are closely
|
|
125
|
+
in line (barring very minor discrepancies, usually < 0.05 Å).
|
|
126
|
+
We cannot use the CRC values directly as they are not permissively licensed.
|
|
127
|
+
"""
|
|
128
|
+
|
|
60
129
|
# fmt: on
|
|
61
130
|
|
|
62
131
|
# A dictionary that caches radii for each residue
|
|
@@ -65,16 +134,15 @@ _protor_radii = {}
|
|
|
65
134
|
|
|
66
135
|
def vdw_radius_protor(res_name, atom_name):
|
|
67
136
|
"""
|
|
68
|
-
Estimate the Van-der-Waals radius of
|
|
137
|
+
Estimate the Van-der-Waals radius of a heavy atom,
|
|
69
138
|
that includes the radius added by potential bonded hydrogen atoms.
|
|
70
139
|
The respective radii are taken from the ProtOr dataset.
|
|
71
140
|
:footcite:`Tsai1999`
|
|
72
141
|
|
|
73
142
|
This is especially useful for macromolecular structures where no
|
|
74
143
|
hydrogen atoms are resolved, e.g. crystal structures.
|
|
75
|
-
The valency of the
|
|
76
|
-
bonded hydrogen atoms is taken from the
|
|
77
|
-
dataset.
|
|
144
|
+
The valency of the heavy atom and the amount of normally
|
|
145
|
+
bonded hydrogen atoms is taken from the *Chemical Component Dictionary*.
|
|
78
146
|
|
|
79
147
|
Parameters
|
|
80
148
|
----------
|
|
@@ -86,12 +154,13 @@ def vdw_radius_protor(res_name, atom_name):
|
|
|
86
154
|
|
|
87
155
|
Returns
|
|
88
156
|
-------
|
|
89
|
-
|
|
90
|
-
|
|
157
|
+
radius : float
|
|
158
|
+
The Van-der-Waals radius of the given atom.
|
|
159
|
+
If the radius cannot be estimated for the atom, `None` is returned.
|
|
91
160
|
|
|
92
|
-
See
|
|
161
|
+
See Also
|
|
93
162
|
--------
|
|
94
|
-
vdw_radius_single
|
|
163
|
+
vdw_radius_single : *Van-der-Waals* radii for structures with annotated hydrogen atoms.
|
|
95
164
|
|
|
96
165
|
References
|
|
97
166
|
----------
|
|
@@ -114,7 +183,7 @@ def vdw_radius_protor(res_name, atom_name):
|
|
|
114
183
|
# Use cached radii for the residue, if already calculated
|
|
115
184
|
if atom_name not in _protor_radii[res_name]:
|
|
116
185
|
raise KeyError(
|
|
117
|
-
f"Residue '{res_name}' does not contain an atom named
|
|
186
|
+
f"Residue '{res_name}' does not contain an atom named '{atom_name}'"
|
|
118
187
|
)
|
|
119
188
|
return _protor_radii[res_name].get(atom_name)
|
|
120
189
|
else:
|
|
@@ -166,8 +235,8 @@ def _calculate_protor_radii(res_name):
|
|
|
166
235
|
|
|
167
236
|
def vdw_radius_single(element):
|
|
168
237
|
"""
|
|
169
|
-
Get the Van-der-Waals radius of an atom from the given element.
|
|
170
|
-
:footcite:`
|
|
238
|
+
Get the *Van-der-Waals* radius of an atom from the given element.
|
|
239
|
+
:footcite:`Mantina2009`
|
|
171
240
|
|
|
172
241
|
Parameters
|
|
173
242
|
----------
|
|
@@ -176,12 +245,13 @@ def vdw_radius_single(element):
|
|
|
176
245
|
|
|
177
246
|
Returns
|
|
178
247
|
-------
|
|
179
|
-
|
|
180
|
-
|
|
248
|
+
radius : float
|
|
249
|
+
The Van-der-Waals radius of the atom.
|
|
250
|
+
If the radius is unknown for the element, `None` is returned.
|
|
181
251
|
|
|
182
|
-
See
|
|
252
|
+
See Also
|
|
183
253
|
--------
|
|
184
|
-
vdw_radius_protor
|
|
254
|
+
vdw_radius_protor : *Van-der-Waals* radii for structures without annotated hydrogen atoms.
|
|
185
255
|
|
|
186
256
|
References
|
|
187
257
|
----------
|
|
@@ -194,4 +264,4 @@ def vdw_radius_single(element):
|
|
|
194
264
|
>>> print(vdw_radius_single("C"))
|
|
195
265
|
1.7
|
|
196
266
|
"""
|
|
197
|
-
return
|
|
267
|
+
return _SINGLE_ATOM_VDW_RADII.get(element.upper())
|
|
@@ -125,8 +125,7 @@ def standardize_order(atoms):
|
|
|
125
125
|
if chem_comp_atom is None:
|
|
126
126
|
# If the residue is not in the CCD, keep the current order
|
|
127
127
|
warnings.warn(
|
|
128
|
-
f"Residue '{res_name}' is not in the CCD, "
|
|
129
|
-
f"keeping current atom order"
|
|
128
|
+
f"Residue '{res_name}' is not in the CCD, keeping current atom order"
|
|
130
129
|
)
|
|
131
130
|
reordered_indices[start:stop] = np.arange(start, stop)
|
|
132
131
|
continue
|
biotite/structure/integrity.py
CHANGED
|
@@ -47,7 +47,7 @@ def check_atom_id_continuity(array):
|
|
|
47
47
|
Returns
|
|
48
48
|
-------
|
|
49
49
|
discontinuity : ndarray, dtype=int
|
|
50
|
-
Contains the indices of atoms after a discontinuity
|
|
50
|
+
Contains the indices of atoms after a discontinuity.
|
|
51
51
|
"""
|
|
52
52
|
ids = array.atom_id
|
|
53
53
|
return _check_continuity(ids)
|
|
@@ -69,7 +69,7 @@ def check_res_id_continuity(array):
|
|
|
69
69
|
Returns
|
|
70
70
|
-------
|
|
71
71
|
discontinuity : ndarray, dtype=int
|
|
72
|
-
Contains the indices of atoms after a discontinuity
|
|
72
|
+
Contains the indices of atoms after a discontinuity.
|
|
73
73
|
"""
|
|
74
74
|
ids = array.res_id
|
|
75
75
|
return _check_continuity(ids)
|
|
@@ -96,10 +96,8 @@ def check_linear_continuity(array, min_len=1.2, max_len=1.8):
|
|
|
96
96
|
|
|
97
97
|
See Also
|
|
98
98
|
--------
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
biotite.structure.bonds.BondList :
|
|
102
|
-
A class that doesn't depend on the atoms' order to identify bonds.
|
|
99
|
+
filter_linear_bond_continuity : A function to filter for atoms preserving the continuity (used here).
|
|
100
|
+
BondList : A class that doesn't depend on the atoms' order to identify bonds.
|
|
103
101
|
"""
|
|
104
102
|
con_mask = filter_linear_bond_continuity(array, min_len, max_len)
|
|
105
103
|
# The continuity mask `con_mask` points to atoms for which the next atom is continuous.
|
biotite/structure/io/general.py
CHANGED
|
@@ -34,7 +34,7 @@ def load_structure(file_path, template=None, **kwargs):
|
|
|
34
34
|
The path to structure file.
|
|
35
35
|
template : AtomArray or AtomArrayStack or file-like object or str, optional
|
|
36
36
|
Only required when reading a trajectory file.
|
|
37
|
-
kwargs
|
|
37
|
+
**kwargs
|
|
38
38
|
Additional parameters will be passed to either the
|
|
39
39
|
:func:`get_structure()` or :func:`read()` method of the file
|
|
40
40
|
object.
|
|
@@ -146,7 +146,7 @@ def save_structure(file_path, array, **kwargs):
|
|
|
146
146
|
The path to structure file.
|
|
147
147
|
array : AtomArray or AtomArrayStack
|
|
148
148
|
The structure to be saved.
|
|
149
|
-
kwargs
|
|
149
|
+
**kwargs
|
|
150
150
|
Additional parameters will be passed to the respective `set_structure`
|
|
151
151
|
method.
|
|
152
152
|
|
biotite/structure/io/gro/file.py
CHANGED
|
@@ -48,7 +48,6 @@ class GROFile(TextFile):
|
|
|
48
48
|
>>> file = GROFile()
|
|
49
49
|
>>> file.set_structure(array_stack_mod)
|
|
50
50
|
>>> file.write(os.path.join(path_to_directory, "1l2y_mod.gro"))
|
|
51
|
-
|
|
52
51
|
"""
|
|
53
52
|
|
|
54
53
|
def get_model_count(self):
|
|
@@ -89,13 +88,13 @@ class GROFile(TextFile):
|
|
|
89
88
|
The return type depends on the `model` parameter.
|
|
90
89
|
"""
|
|
91
90
|
|
|
92
|
-
def
|
|
91
|
+
def _get_atom_line_i(model_start_i, model_atom_counts):
|
|
93
92
|
"""
|
|
94
93
|
Helper function to get the indices of all atoms for a model
|
|
95
94
|
"""
|
|
96
95
|
return np.arange(model_start_i + 1, model_start_i + 1 + model_atom_counts)
|
|
97
96
|
|
|
98
|
-
def
|
|
97
|
+
def _set_box_dimen(box_param):
|
|
99
98
|
"""
|
|
100
99
|
Helper function to create the box vectors from the values
|
|
101
100
|
in the GRO file
|
|
@@ -145,7 +144,7 @@ class GROFile(TextFile):
|
|
|
145
144
|
|
|
146
145
|
# Line indices for annotation determination is determined
|
|
147
146
|
# from model 1
|
|
148
|
-
annot_i =
|
|
147
|
+
annot_i = _get_atom_line_i(model_start_i[0], length)
|
|
149
148
|
else:
|
|
150
149
|
if model == 0:
|
|
151
150
|
raise ValueError("The model index must not be 0")
|
|
@@ -160,7 +159,7 @@ class GROFile(TextFile):
|
|
|
160
159
|
length = model_atom_counts[model - 1]
|
|
161
160
|
array = AtomArray(length)
|
|
162
161
|
|
|
163
|
-
annot_i =
|
|
162
|
+
annot_i = _get_atom_line_i(model_start_i[model - 1], length)
|
|
164
163
|
|
|
165
164
|
# Replace empty strings for elements with guessed types
|
|
166
165
|
# i is index in array, line_i is line index
|
|
@@ -183,11 +182,11 @@ class GROFile(TextFile):
|
|
|
183
182
|
# Box is stored in last line (after coordinates)
|
|
184
183
|
box_i = atom_i[-1] + 1
|
|
185
184
|
box_param = [float(e) * 10 for e in self.lines[box_i].split()]
|
|
186
|
-
array.box =
|
|
185
|
+
array.box = _set_box_dimen(box_param)
|
|
187
186
|
|
|
188
187
|
elif isinstance(array, AtomArrayStack):
|
|
189
188
|
for m in range(len(model_start_i)):
|
|
190
|
-
atom_i =
|
|
189
|
+
atom_i = _get_atom_line_i(model_start_i[m], model_atom_counts[m])
|
|
191
190
|
for i, line_i in enumerate(atom_i):
|
|
192
191
|
line = self.lines[line_i]
|
|
193
192
|
array.coord[m, i, 0] = float(line[20:28]) * 10
|
|
@@ -196,7 +195,7 @@ class GROFile(TextFile):
|
|
|
196
195
|
# Box is stored in last line (after coordinates)
|
|
197
196
|
box_i = atom_i[-1] + 1
|
|
198
197
|
box_param = [float(e) * 10 for e in self.lines[box_i].split()]
|
|
199
|
-
box =
|
|
198
|
+
box = _set_box_dimen(box_param)
|
|
200
199
|
# Create a box in the stack if not already existing
|
|
201
200
|
# and the box is not a dummy
|
|
202
201
|
if box is not None:
|
|
@@ -311,7 +310,7 @@ class GROFile(TextFile):
|
|
|
311
310
|
|
|
312
311
|
for i in range(array.stack_depth()):
|
|
313
312
|
self.lines.append(
|
|
314
|
-
f"Generated by Biotite at {datetime.now()}, model={i+1}"
|
|
313
|
+
f"Generated by Biotite at {datetime.now()}, model={i + 1}"
|
|
315
314
|
)
|
|
316
315
|
self.lines.append(str(array.array_length()))
|
|
317
316
|
|