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.

Files changed (155) hide show
  1. biotite/application/application.py +3 -3
  2. biotite/application/autodock/app.py +1 -1
  3. biotite/application/blast/webapp.py +1 -1
  4. biotite/application/clustalo/app.py +1 -1
  5. biotite/application/localapp.py +2 -2
  6. biotite/application/msaapp.py +10 -10
  7. biotite/application/muscle/app3.py +3 -3
  8. biotite/application/muscle/app5.py +3 -3
  9. biotite/application/sra/app.py +0 -5
  10. biotite/application/util.py +21 -1
  11. biotite/application/viennarna/rnaalifold.py +8 -8
  12. biotite/application/viennarna/rnaplot.py +3 -1
  13. biotite/application/viennarna/util.py +1 -1
  14. biotite/application/webapp.py +1 -1
  15. biotite/database/afdb/__init__.py +12 -0
  16. biotite/database/afdb/download.py +191 -0
  17. biotite/database/entrez/dbnames.py +10 -0
  18. biotite/database/entrez/download.py +9 -10
  19. biotite/database/entrez/key.py +1 -1
  20. biotite/database/entrez/query.py +5 -4
  21. biotite/database/pubchem/download.py +6 -6
  22. biotite/database/pubchem/error.py +10 -0
  23. biotite/database/pubchem/query.py +12 -23
  24. biotite/database/rcsb/download.py +3 -2
  25. biotite/database/rcsb/query.py +2 -3
  26. biotite/database/uniprot/check.py +2 -2
  27. biotite/database/uniprot/download.py +2 -5
  28. biotite/database/uniprot/query.py +3 -4
  29. biotite/file.py +14 -2
  30. biotite/interface/__init__.py +19 -0
  31. biotite/interface/openmm/__init__.py +16 -0
  32. biotite/interface/openmm/state.py +93 -0
  33. biotite/interface/openmm/system.py +227 -0
  34. biotite/interface/pymol/__init__.py +198 -0
  35. biotite/interface/pymol/cgo.py +346 -0
  36. biotite/interface/pymol/convert.py +185 -0
  37. biotite/interface/pymol/display.py +267 -0
  38. biotite/interface/pymol/object.py +1226 -0
  39. biotite/interface/pymol/shapes.py +178 -0
  40. biotite/interface/pymol/startup.py +169 -0
  41. biotite/interface/rdkit/__init__.py +15 -0
  42. biotite/interface/rdkit/mol.py +490 -0
  43. biotite/interface/version.py +71 -0
  44. biotite/interface/warning.py +19 -0
  45. biotite/sequence/align/__init__.py +0 -4
  46. biotite/sequence/align/alignment.py +33 -11
  47. biotite/sequence/align/banded.cp313-win_amd64.pyd +0 -0
  48. biotite/sequence/align/banded.pyx +21 -21
  49. biotite/sequence/align/cigar.py +2 -2
  50. biotite/sequence/align/kmeralphabet.cp313-win_amd64.pyd +0 -0
  51. biotite/sequence/align/kmeralphabet.pyx +2 -2
  52. biotite/sequence/align/kmersimilarity.cp313-win_amd64.pyd +0 -0
  53. biotite/sequence/align/kmertable.cp313-win_amd64.pyd +0 -0
  54. biotite/sequence/align/kmertable.pyx +6 -6
  55. biotite/sequence/align/localgapped.cp313-win_amd64.pyd +0 -0
  56. biotite/sequence/align/localgapped.pyx +47 -47
  57. biotite/sequence/align/localungapped.cp313-win_amd64.pyd +0 -0
  58. biotite/sequence/align/localungapped.pyx +10 -10
  59. biotite/sequence/align/matrix.py +12 -3
  60. biotite/sequence/align/multiple.cp313-win_amd64.pyd +0 -0
  61. biotite/sequence/align/pairwise.cp313-win_amd64.pyd +0 -0
  62. biotite/sequence/align/pairwise.pyx +35 -35
  63. biotite/sequence/align/permutation.cp313-win_amd64.pyd +0 -0
  64. biotite/sequence/align/selector.cp313-win_amd64.pyd +0 -0
  65. biotite/sequence/align/selector.pyx +2 -2
  66. biotite/sequence/align/statistics.py +1 -1
  67. biotite/sequence/align/tracetable.cp313-win_amd64.pyd +0 -0
  68. biotite/sequence/alphabet.py +2 -2
  69. biotite/sequence/annotation.py +19 -13
  70. biotite/sequence/codec.cp313-win_amd64.pyd +0 -0
  71. biotite/sequence/codon.py +1 -2
  72. biotite/sequence/graphics/alignment.py +25 -39
  73. biotite/sequence/graphics/dendrogram.py +4 -2
  74. biotite/sequence/graphics/features.py +2 -2
  75. biotite/sequence/graphics/logo.py +10 -12
  76. biotite/sequence/io/fasta/convert.py +1 -2
  77. biotite/sequence/io/fasta/file.py +1 -1
  78. biotite/sequence/io/fastq/file.py +3 -3
  79. biotite/sequence/io/genbank/file.py +3 -3
  80. biotite/sequence/io/genbank/sequence.py +2 -0
  81. biotite/sequence/io/gff/convert.py +1 -1
  82. biotite/sequence/io/gff/file.py +1 -2
  83. biotite/sequence/phylo/nj.cp313-win_amd64.pyd +0 -0
  84. biotite/sequence/phylo/tree.cp313-win_amd64.pyd +0 -0
  85. biotite/sequence/phylo/upgma.cp313-win_amd64.pyd +0 -0
  86. biotite/sequence/profile.py +19 -25
  87. biotite/sequence/search.py +0 -1
  88. biotite/sequence/seqtypes.py +12 -5
  89. biotite/sequence/sequence.py +1 -2
  90. biotite/structure/__init__.py +2 -0
  91. biotite/structure/alphabet/i3d.py +1 -2
  92. biotite/structure/alphabet/pb.py +1 -2
  93. biotite/structure/alphabet/unkerasify.py +8 -2
  94. biotite/structure/atoms.py +35 -27
  95. biotite/structure/basepairs.py +26 -26
  96. biotite/structure/bonds.cp313-win_amd64.pyd +0 -0
  97. biotite/structure/bonds.pyx +8 -5
  98. biotite/structure/box.py +19 -21
  99. biotite/structure/celllist.cp313-win_amd64.pyd +0 -0
  100. biotite/structure/celllist.pyx +83 -67
  101. biotite/structure/chains.py +5 -37
  102. biotite/structure/charges.cp313-win_amd64.pyd +0 -0
  103. biotite/structure/compare.py +420 -13
  104. biotite/structure/density.py +1 -1
  105. biotite/structure/dotbracket.py +27 -28
  106. biotite/structure/filter.py +8 -8
  107. biotite/structure/geometry.py +15 -15
  108. biotite/structure/hbond.py +17 -19
  109. biotite/structure/info/atoms.py +11 -2
  110. biotite/structure/info/ccd.py +0 -2
  111. biotite/structure/info/components.bcif +0 -0
  112. biotite/structure/info/groups.py +0 -3
  113. biotite/structure/info/misc.py +0 -1
  114. biotite/structure/info/radii.py +92 -22
  115. biotite/structure/info/standardize.py +1 -2
  116. biotite/structure/integrity.py +4 -6
  117. biotite/structure/io/general.py +2 -2
  118. biotite/structure/io/gro/file.py +8 -9
  119. biotite/structure/io/mol/convert.py +1 -1
  120. biotite/structure/io/mol/ctab.py +33 -28
  121. biotite/structure/io/mol/mol.py +1 -1
  122. biotite/structure/io/mol/sdf.py +39 -13
  123. biotite/structure/io/pdb/convert.py +2 -3
  124. biotite/structure/io/pdb/file.py +11 -22
  125. biotite/structure/io/pdb/hybrid36.cp313-win_amd64.pyd +0 -0
  126. biotite/structure/io/pdbqt/file.py +4 -4
  127. biotite/structure/io/pdbx/bcif.py +22 -7
  128. biotite/structure/io/pdbx/cif.py +20 -7
  129. biotite/structure/io/pdbx/component.py +6 -0
  130. biotite/structure/io/pdbx/compress.py +2 -2
  131. biotite/structure/io/pdbx/convert.py +222 -33
  132. biotite/structure/io/pdbx/encoding.cp313-win_amd64.pyd +0 -0
  133. biotite/structure/io/trajfile.py +9 -6
  134. biotite/structure/io/util.py +38 -0
  135. biotite/structure/mechanics.py +0 -1
  136. biotite/structure/molecules.py +0 -15
  137. biotite/structure/pseudoknots.py +7 -13
  138. biotite/structure/repair.py +2 -4
  139. biotite/structure/residues.py +13 -24
  140. biotite/structure/rings.py +335 -0
  141. biotite/structure/sasa.cp313-win_amd64.pyd +0 -0
  142. biotite/structure/sasa.pyx +2 -1
  143. biotite/structure/segments.py +68 -9
  144. biotite/structure/sequence.py +0 -1
  145. biotite/structure/sse.py +0 -2
  146. biotite/structure/superimpose.py +74 -62
  147. biotite/structure/tm.py +581 -0
  148. biotite/structure/transform.py +12 -25
  149. biotite/structure/util.py +3 -3
  150. biotite/version.py +9 -4
  151. biotite/visualize.py +111 -1
  152. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/METADATA +5 -3
  153. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/RECORD +155 -135
  154. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/WHEEL +0 -0
  155. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/licenses/LICENSE.rst +0 -0
@@ -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 also
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 also
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 also
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 also
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 also
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 also
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 also
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
- atoms: AtomArray or AtomArrayStack
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, " "the box must be set explicitly"
606
+ "If `atoms` are coordinates, the box must be set explicitly"
607
607
  )
608
608
  else:
609
609
  box = None
@@ -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 or None
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. (Default: None)
51
- selection1_type: {'acceptor', 'donor', 'both'}, optional (default: 'both')
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. (Default: 2.5)
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 (default: 120).
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
  --------
@@ -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(get_ccd(), res_name=res_name)
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
@@ -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
@@ -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
 
@@ -127,7 +127,6 @@ def one_letter_code(res_name):
127
127
  alpha-D-mannopyranose
128
128
  >>> print(one_letter_code("MAN"))
129
129
  None
130
-
131
130
  """
132
131
  column = get_from_ccd("chem_comp", res_name.upper(), "one_letter_code")
133
132
  if column is None:
@@ -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 _SINGLE_RADII
30
- ("CL", 1, 0) : 1.75, # Taken from _SINGLE_RADII
31
- ("BR", 1, 0) : 1.85, # Taken from _SINGLE_RADII
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
- _SINGLE_RADII = {
36
- "H": 1.20,
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.85,
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 an non-hydrogen atom,
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 non-hydrogen atom and the amount of normally
76
- bonded hydrogen atoms is taken from the chemical compound dictionary
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
- The Van-der-Waals radius of the given atom.
90
- If the radius cannot be estimated for the atom, `None` is returned.
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 also
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 " f"'{atom_name}'"
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:`Bondi1964`
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
- The Van-der-Waals radius of the atom.
180
- If the radius is unknown for the element, `None` is returned.
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 also
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 _SINGLE_RADII.get(element.upper())
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
@@ -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
- biotite.structure.filter.filter_linear_bond_continuity :
100
- A function to filter for atoms preserving the continuity (used here).
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.
@@ -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
 
@@ -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 get_atom_line_i(model_start_i, model_atom_counts):
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 set_box_dimen(box_param):
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 = get_atom_line_i(model_start_i[0], length)
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 = get_atom_line_i(model_start_i[model - 1], length)
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 = set_box_dimen(box_param)
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 = get_atom_line_i(model_start_i[m], model_atom_counts[m])
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 = set_box_dimen(box_param)
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
 
@@ -52,7 +52,7 @@ def set_structure(
52
52
  ----------
53
53
  mol_file : MOLFile
54
54
  The MOL file.
55
- array : AtomArray
55
+ atoms : AtomArray
56
56
  The array to be saved into this file.
57
57
  Must have an associated :class:`BondList`.
58
58
  Bond type fallback for the *Bond block*, if a