biotite 1.2.0__cp311-cp311-macosx_11_0_arm64.whl → 1.3.0__cp311-cp311-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 (56) hide show
  1. biotite/application/viennarna/rnaplot.py +7 -7
  2. biotite/interface/openmm/__init__.py +4 -0
  3. biotite/interface/pymol/__init__.py +3 -0
  4. biotite/interface/rdkit/__init__.py +4 -0
  5. biotite/interface/version.py +23 -0
  6. biotite/sequence/align/banded.cpython-311-darwin.so +0 -0
  7. biotite/sequence/align/banded.pyx +1 -1
  8. biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
  9. biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
  10. biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
  11. biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
  12. biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
  13. biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
  14. biotite/sequence/align/multiple.pyx +1 -2
  15. biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
  16. biotite/sequence/align/pairwise.pyx +2 -4
  17. biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
  18. biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
  19. biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
  20. biotite/sequence/codec.cpython-311-darwin.so +0 -0
  21. biotite/sequence/phylo/nj.cpython-311-darwin.so +0 -0
  22. biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
  23. biotite/sequence/phylo/upgma.cpython-311-darwin.so +0 -0
  24. biotite/structure/basepairs.py +13 -14
  25. biotite/structure/bonds.cpython-311-darwin.so +0 -0
  26. biotite/structure/box.py +140 -2
  27. biotite/structure/celllist.cpython-311-darwin.so +0 -0
  28. biotite/structure/celllist.pyx +0 -1
  29. biotite/structure/chains.py +15 -21
  30. biotite/structure/charges.cpython-311-darwin.so +0 -0
  31. biotite/structure/dotbracket.py +4 -4
  32. biotite/structure/graphics/rna.py +19 -16
  33. biotite/structure/hbond.py +1 -2
  34. biotite/structure/info/components.bcif +0 -0
  35. biotite/structure/io/pdb/convert.py +84 -2
  36. biotite/structure/io/pdb/file.py +79 -2
  37. biotite/structure/io/pdb/hybrid36.cpython-311-darwin.so +0 -0
  38. biotite/structure/io/pdbx/compress.py +69 -32
  39. biotite/structure/io/pdbx/convert.py +207 -44
  40. biotite/structure/io/pdbx/encoding.cpython-311-darwin.so +0 -0
  41. biotite/structure/io/pdbx/encoding.pyx +39 -23
  42. biotite/structure/pseudoknots.py +6 -6
  43. biotite/structure/residues.py +10 -27
  44. biotite/structure/rings.py +1 -1
  45. biotite/structure/sasa.cpython-311-darwin.so +0 -0
  46. biotite/structure/sasa.pyx +28 -29
  47. biotite/structure/segments.py +55 -0
  48. biotite/structure/spacegroups.json +1567 -0
  49. biotite/structure/spacegroups.license +26 -0
  50. biotite/structure/superimpose.py +1 -191
  51. biotite/structure/transform.py +220 -1
  52. biotite/version.py +2 -2
  53. {biotite-1.2.0.dist-info → biotite-1.3.0.dist-info}/METADATA +4 -34
  54. {biotite-1.2.0.dist-info → biotite-1.3.0.dist-info}/RECORD +56 -54
  55. {biotite-1.2.0.dist-info → biotite-1.3.0.dist-info}/WHEEL +3 -1
  56. {biotite-1.2.0.dist-info → biotite-1.3.0.dist-info}/licenses/LICENSE.rst +0 -0
@@ -28,15 +28,15 @@ class RNAplotApp(LocalApp):
28
28
 
29
29
  Parameters
30
30
  ----------
31
- dot_bracket : str, optional (default: None)
31
+ dot_bracket : str, optional
32
32
  The structure in dot bracket notation.
33
- base_pairs : ndarray, shape=(n,2), optional (default: None)
33
+ base_pairs : ndarray, shape=(n,2), optional
34
34
  Each row corresponds to the positions of the bases in the
35
35
  strand. This parameter is mutually exclusive to ``dot_bracket``.
36
- length : int, optional (default: None)
36
+ length : int, optional
37
37
  The number of bases in the strand. This parameter is required if
38
38
  ``base_pairs`` is given.
39
- layout_type : RNAplotApp.Layout, optional (default: RNAplotApp.Layout.NAVIEW)
39
+ layout_type : RNAplotApp.Layout, optional
40
40
  The layout type according to the *RNAplot* documentation.
41
41
  bin_path : str, optional
42
42
  Path of the *RNAplot* binary.
@@ -176,13 +176,13 @@ class RNAplotApp(LocalApp):
176
176
 
177
177
  Parameters
178
178
  ----------
179
- dot_bracket : str, optional (default: None)
179
+ dot_bracket : str, optional
180
180
  The structure in dot bracket notation.
181
- base_pairs : ndarray, shape=(n,2), optional (default: None)
181
+ base_pairs : ndarray, shape=(n,2), optional
182
182
  Each row corresponds to the positions of the bases in the
183
183
  strand. This parameter is mutually exclusive to
184
184
  ``dot_bracket``.
185
- length : int, optional (default: None)
185
+ length : int, optional
186
186
  The number of bases in the strand. This parameter is
187
187
  required if ``base_pairs`` is given.
188
188
  layout_type : Layout
@@ -12,5 +12,9 @@ structure-related objects from *OpenMM*.
12
12
  __name__ = "biotite.interface.openmm"
13
13
  __author__ = "Patrick Kunzmann"
14
14
 
15
+ from biotite.interface.version import require_package
16
+
17
+ require_package("openmm")
18
+
15
19
  from .state import *
16
20
  from .system import *
@@ -162,6 +162,9 @@ or ``pymol_interface.cmd`` at the required places in your code.
162
162
  __name__ = "biotite.interface.pymol"
163
163
  __author__ = "Patrick Kunzmann"
164
164
 
165
+ from biotite.interface.version import require_package
166
+
167
+ require_package("pymol")
165
168
 
166
169
  from .cgo import *
167
170
  from .convert import *
@@ -12,4 +12,8 @@ objects.
12
12
  __name__ = "biotite.interface.rdkit"
13
13
  __author__ = "Patrick Kunzmann"
14
14
 
15
+ from biotite.interface.version import require_package
16
+
17
+ require_package("rdkit")
18
+
15
19
  from .mol import *
@@ -26,6 +26,29 @@ class VersionError(Exception):
26
26
  pass
27
27
 
28
28
 
29
+ def require_package(package):
30
+ """
31
+ Check if the given package is installed and raise an exception if not.
32
+
33
+ Parameters
34
+ ----------
35
+ package : str
36
+ The name of the package to be checked.
37
+
38
+ Raises
39
+ ------
40
+ ImportError
41
+ If the package is not installed.
42
+
43
+ Notes
44
+ -----
45
+ It is useful to call this function in the ``__init__.py`` of each ``interface``
46
+ subpackage, to obtain clear error messages about missing dependencies.
47
+ """
48
+ if importlib.util.find_spec(package) is None:
49
+ raise ImportError(f"'{package}' is not installed")
50
+
51
+
29
52
  def requires_version(package, version_specifier):
30
53
  """
31
54
  Declare a function variant that is compatible with a specific version range of the
@@ -76,7 +76,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
76
76
  If a tuple is provided, an affine gap penalty is used.
77
77
  The first integer in the tuple is the gap opening penalty,
78
78
  the second integer is the gap extension penalty.
79
- The values need to be negative. (Default: *-10*)
79
+ The values need to be negative.
80
80
  local : bool, optional
81
81
  If set to true, a local alignment is performed.
82
82
  Otherwise (default) a semi-global alignment is performed.
@@ -92,10 +92,9 @@ def align_multiple(sequences, matrix, gap_penalty=-10, terminal_penalty=True,
92
92
  penalty is used. The first integer in the tuple is the gap
93
93
  opening penalty, the second integer is the gap extension
94
94
  penalty.
95
- The values need to be negative. (Default: *-10*)
95
+ The values need to be negative.
96
96
  terminal_penalty : bool, optional
97
97
  If true, gap penalties are applied to terminal gaps.
98
- (Default: True)
99
98
  distances : ndarray, shape=(n,n)
100
99
  Pairwise distances of the sequences.
101
100
  The matrix must be symmetric and all entries must be larger
@@ -138,19 +138,17 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
138
138
  If a tuple is provided, an affine gap penalty is used.
139
139
  The first integer in the tuple is the gap opening penalty,
140
140
  the second integer is the gap extension penalty.
141
- The values need to be negative. (Default: *-10*)
141
+ The values need to be negative.
142
142
  terminal_penalty : bool, optional
143
143
  If true, gap penalties are applied to terminal gaps.
144
144
  If `local` is true, this parameter has no effect.
145
- (Default: True)
146
145
  local : bool, optional
147
146
  If false, a global alignment is performed, otherwise a local
148
- alignment is performed. (Default: False)
147
+ alignment is performed.
149
148
  max_number : int, optional
150
149
  The maximum number of alignments returned.
151
150
  When the number of branches exceeds this value in the traceback
152
151
  step, no further branches are created.
153
- (Default: 1000)
154
152
 
155
153
  Returns
156
154
  -------
@@ -638,7 +638,7 @@ def base_stacking(atom_array, min_atoms_per_base=3):
638
638
  ----------
639
639
  atom_array : AtomArray
640
640
  The :class:`AtomArray` to find stacked bases in.
641
- min_atoms_per_base : integer, optional (default: 3)
641
+ min_atoms_per_base : integer, optional
642
642
  The number of atoms a nucleotides' base must have to be
643
643
  considered a candidate for a stacking interaction.
644
644
 
@@ -783,10 +783,10 @@ def base_pairs(atom_array, min_atoms_per_base=3, unique=True):
783
783
  ----------
784
784
  atom_array : AtomArray
785
785
  The :class:`AtomArray` to find base pairs in.
786
- min_atoms_per_base : integer, optional (default: 3)
786
+ min_atoms_per_base : integer, optional
787
787
  The number of atoms a nucleotides' base must have to be
788
788
  considered a candidate for a base pair.
789
- unique : bool, optional (default: True)
789
+ unique : bool, optional
790
790
  If ``True``, each base is assumed to be only paired with one
791
791
  other base. If multiple pairings are plausible, the pairing with
792
792
  the most hydrogen bonds is selected.
@@ -1203,26 +1203,25 @@ def map_nucleotide(residue, min_atoms_per_base=3, rmsd_cutoff=0.28):
1203
1203
  If a different nucleotide is given, it is mapped to the best
1204
1204
  fitting base using the algorithm described below.
1205
1205
 
1206
- (i) The number of matching atom names with the reference bases is
1207
- counted. If the number of matching atoms with all reference
1208
- bases is less than the specified `min_atoms_per_base`
1209
- (default 3) the nucleotide cannot be mapped and ``None`` is
1206
+ (i) The number of matching atom names with the reference bases is counted.
1207
+ If the number of matching atoms with all reference bases is less than the
1208
+ specified `min_atoms_per_base` the nucleotide cannot be mapped and ``None`` is
1210
1209
  returned.
1211
1210
 
1212
- (ii) The bases with maximum number of matching atoms are selected
1213
- and superimposed with each reference. The base with lowest RMSD
1214
- is chosen. If the RMSD is more than the specified
1215
- `rmsd_cutoff` (default 0.28) the nucleotide cannot be mapped
1216
- and ``None`` is returned.
1211
+ (ii) The bases with maximum number of matching atoms are selected and superimposed
1212
+ with each reference.
1213
+ The base with lowest RMSD is chosen.
1214
+ If the RMSD is more than the specified `rmsd_cutoff`, the nucleotide cannot be
1215
+ mapped and ``None`` is returned.
1217
1216
 
1218
1217
  Parameters
1219
1218
  ----------
1220
1219
  residue : AtomArray
1221
1220
  The nucleotide to be mapped.
1222
- min_atoms_per_base : int, optional (default: 3)
1221
+ min_atoms_per_base : int, optional
1223
1222
  The number of atoms the residue must have in common with the
1224
1223
  reference.
1225
- rmsd_cutoff : float, optional (default: 0.28)
1224
+ rmsd_cutoff : float, optional
1226
1225
  The maximum RSMD that is allowed for a mapping to occur.
1227
1226
 
1228
1227
  Returns
biotite/structure/box.py CHANGED
@@ -4,12 +4,13 @@
4
4
 
5
5
  """
6
6
  Functions related to working with the simulation box or unit cell
7
- of a structure
7
+ of a structure.
8
8
  """
9
9
 
10
10
  __name__ = "biotite.structure"
11
11
  __author__ = "Patrick Kunzmann"
12
12
  __all__ = [
13
+ "space_group_transforms",
13
14
  "vectors_from_unitcell",
14
15
  "unitcell_from_vectors",
15
16
  "box_volume",
@@ -23,16 +24,127 @@ __all__ = [
23
24
  "is_orthogonal",
24
25
  ]
25
26
 
27
+ import functools
28
+ import json
26
29
  from numbers import Integral
30
+ from pathlib import Path
27
31
  import numpy as np
28
32
  import numpy.linalg as linalg
29
33
  from biotite.structure.atoms import repeat
30
34
  from biotite.structure.chains import get_chain_masks, get_chain_starts
31
35
  from biotite.structure.error import BadStructureError
32
36
  from biotite.structure.molecules import get_molecule_masks
37
+ from biotite.structure.transform import AffineTransformation
33
38
  from biotite.structure.util import vector_dot
34
39
 
35
40
 
41
+ def space_group_transforms(space_group):
42
+ """
43
+ Get the coordinate transformations for a given space group.
44
+
45
+ Applying each transformation to a structure (in fractional coordinates) reproduces
46
+ the entire unit cell.
47
+
48
+ Parameters
49
+ ----------
50
+ space_group : str or int
51
+ The space group name (full *Hermann-Mauguin* symbol) or
52
+ *International Table*'s number.
53
+
54
+ Returns
55
+ -------
56
+ transformations : list of AffineTransformation
57
+ The transformations that creates the symmetric copies of a structure in a unit
58
+ cell of the given space group.
59
+ Note that the transformations need to be applied to coordinates in fractions
60
+ of the unit cell and also return fractional coordinates, when applied.
61
+
62
+ See Also
63
+ --------
64
+ coord_to_fraction : Used to convert to fractional coordinates.
65
+ fraction_to_coord : Used to convert back to Cartesian coordinates.
66
+
67
+ Examples
68
+ --------
69
+
70
+ >>> transforms = space_group_transforms("P 21 21 21")
71
+ >>> for transform in transforms:
72
+ ... print(transform.rotation)
73
+ ... print(transform.target_translation)
74
+ ... print()
75
+ [[[1. 0. 0.]
76
+ [0. 1. 0.]
77
+ [0. 0. 1.]]]
78
+ [[0. 0. 0.]]
79
+ <BLANKLINE>
80
+ [[[-1. 0. 0.]
81
+ [ 0. -1. 0.]
82
+ [ 0. 0. 1.]]]
83
+ [[0.5 0.0 0.5]]
84
+ <BLANKLINE>
85
+ [[[-1. 0. 0.]
86
+ [ 0. 1. 0.]
87
+ [ 0. 0. -1.]]]
88
+ [[0.0 0.5 0.5]]
89
+ <BLANKLINE>
90
+ [[[ 1. 0. 0.]
91
+ [ 0. -1. 0.]
92
+ [ 0. 0. -1.]]]
93
+ [[0.5 0.5 0.0]]
94
+ <BLANKLINE>
95
+
96
+ Reproduce the unit cell for some coordinates (in this case only one atom).
97
+
98
+ >>> asym_coord = np.array([[1.0, 2.0, 3.0]])
99
+ >>> box = np.eye(3) * 10
100
+ >>> transforms = space_group_transforms("P 21 21 21")
101
+ >>> # Apply the transformations to fractional coordinates of the asymmetric unit
102
+ >>> unit_cell = np.concatenate(
103
+ ... [
104
+ ... fraction_to_coord(transform.apply(coord_to_fraction(asym_coord, box)), box)
105
+ ... for transform in transforms
106
+ ... ]
107
+ ... )
108
+ >>> print(unit_cell)
109
+ [[ 1. 2. 3.]
110
+ [ 4. -2. 8.]
111
+ [-1. 7. 2.]
112
+ [ 6. 3. -3.]]
113
+ """
114
+ transformation_data = _get_transformation_data()
115
+
116
+ if isinstance(space_group, str):
117
+ try:
118
+ space_group_index = transformation_data["group_names"][space_group]
119
+ except KeyError:
120
+ raise ValueError(f"Space group '{space_group}' does not exist")
121
+ else:
122
+ try:
123
+ space_group_index = transformation_data["group_numbers"][str(space_group)]
124
+ except KeyError:
125
+ raise ValueError(f"Space group number {space_group} does not exist")
126
+
127
+ space_group = transformation_data["space_groups"][space_group_index]
128
+ transformations = []
129
+ for transformation_index in space_group:
130
+ matrix = np.zeros((3, 3), dtype=np.float32)
131
+ translation = np.zeros(3, dtype=np.float32)
132
+ for i, part_index in enumerate(
133
+ transformation_data["transformations"][transformation_index]
134
+ ):
135
+ part = transformation_data["transformation_parts"][part_index]
136
+ matrix[i, :] = part[:3]
137
+ translation[i] = part[3]
138
+ transformations.append(
139
+ AffineTransformation(
140
+ center_translation=np.zeros(3, dtype=np.float32),
141
+ rotation=matrix,
142
+ target_translation=translation,
143
+ )
144
+ )
145
+ return transformations
146
+
147
+
36
148
  def vectors_from_unitcell(len_a, len_b, len_c, alpha, beta, gamma):
37
149
  """
38
150
  Calculate the three vectors spanning a box from the unit cell
@@ -160,6 +272,8 @@ def repeat_box(atoms, amount=1):
160
272
  The repeated atoms.
161
273
  Includes the original atoms (central box) in the beginning of
162
274
  the atom array (stack).
275
+ If the input contains the ``sym_id`` annotation, the IDs are continued in the
276
+ repeated atoms, i.e. they do not start at 0 again.
163
277
  indices : ndarray, dtype=int, shape=(n,3)
164
278
  Indices to the atoms in the original atom array (stack).
165
279
  Equal to
@@ -234,6 +348,15 @@ def repeat_box(atoms, amount=1):
234
348
  >>> print(indices)
235
349
  [0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
236
350
  1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1]
351
+
352
+ The ``sym_id`` is continued in the repeated atoms.
353
+
354
+ >>> array.set_annotation("sym_id", np.array([0, 0]))
355
+ >>> repeated, indices = repeat_box(array)
356
+ >>> print(repeated.sym_id)
357
+ [ 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11
358
+ 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23
359
+ 24 24 25 25 26 26]
237
360
  """
238
361
  if atoms.box is None:
239
362
  raise BadStructureError("Structure has no box")
@@ -247,7 +370,16 @@ def repeat_box(atoms, amount=1):
247
370
  atoms.stack_depth(), -1, atoms.array_length(), 3
248
371
  )
249
372
  repeat_coord = np.swapaxes(repeat_coord, 0, 1)
250
- return repeat(atoms, repeat_coord), indices
373
+
374
+ repeated_atoms = repeat(atoms, repeat_coord)
375
+ if "sym_id" in atoms.get_annotation_categories():
376
+ max_sym_id = np.max(atoms.sym_id)
377
+ # for the first repeat, (max_sym_id + 1) is added,
378
+ # for the second repeat 2*(max_sym_id + 1) etc.
379
+ repeated_atoms.sym_id += (max_sym_id + 1) * (
380
+ np.arange(repeated_atoms.array_length()) // atoms.array_length()
381
+ )
382
+ return repeated_atoms, indices
251
383
 
252
384
 
253
385
  def repeat_box_coord(coord, box, amount=1):
@@ -584,3 +716,9 @@ def is_orthogonal(box):
584
716
  & (np.abs(vector_dot(box[..., 0, :], box[..., 2, :])) < tol)
585
717
  & (np.abs(vector_dot(box[..., 1, :], box[..., 2, :])) < tol)
586
718
  )
719
+
720
+
721
+ @functools.cache
722
+ def _get_transformation_data():
723
+ with open(Path(__file__).parent / "spacegroups.json") as file:
724
+ return json.load(file)
@@ -55,7 +55,6 @@ cdef class CellList:
55
55
  periodic : bool, optional
56
56
  If true, the cell list considers periodic copies of atoms.
57
57
  The periodicity is based on the `box` attribute of `atom_array`.
58
- (Default: False)
59
58
  box : ndarray, dtype=float, shape=(3,3), optional
60
59
  If provided, the periodicity is based on this parameter instead
61
60
  of the :attr:`box` attribute of `atom_array`.
@@ -22,23 +22,23 @@ __all__ = [
22
22
  "chain_iter",
23
23
  ]
24
24
 
25
- import numpy as np
26
25
  from biotite.structure.segments import (
27
26
  apply_segment_wise,
28
27
  get_segment_masks,
29
28
  get_segment_positions,
29
+ get_segment_starts,
30
30
  get_segment_starts_for,
31
31
  segment_iter,
32
32
  spread_segment_wise,
33
33
  )
34
34
 
35
35
 
36
- def get_chain_starts(array, add_exclusive_stop=False):
36
+ def get_chain_starts(array, add_exclusive_stop=False, extra_categories=()):
37
37
  """
38
38
  Get the indices in an atom array, which indicates the beginning of
39
39
  a new chain.
40
40
 
41
- A new chain starts, when the chain ID changes or when the residue ID
41
+ A new chain starts, when the chain or sym ID changes or when the residue ID
42
42
  decreases.
43
43
 
44
44
  Parameters
@@ -49,6 +49,9 @@ def get_chain_starts(array, add_exclusive_stop=False):
49
49
  If true, the exclusive stop of the input atom array, i.e.
50
50
  ``array.array_length()``, is added to the returned array of
51
51
  start indices as last element.
52
+ extra_categories : tuple of str, optional
53
+ Additional annotation categories that induce the start of a new chain,
54
+ when their value change from one atom to the next.
52
55
 
53
56
  Returns
54
57
  -------
@@ -60,24 +63,15 @@ def get_chain_starts(array, add_exclusive_stop=False):
60
63
  This method is internally used by all other chain-related
61
64
  functions.
62
65
  """
63
- if array.array_length() == 0:
64
- return np.array([], dtype=int)
65
-
66
- diff = np.diff(array.res_id)
67
- res_id_decrement = diff < 0
68
- # This mask is 'true' at indices where the value changes
69
- chain_id_changes = array.chain_id[1:] != array.chain_id[:-1]
70
-
71
- # Convert mask to indices
72
- # Add 1, to shift the indices from the end of a chain
73
- # to the start of a new chain
74
- chain_starts = np.where(res_id_decrement | chain_id_changes)[0] + 1
75
-
76
- # The first chain is not included yet -> Insert '[0]'
77
- if add_exclusive_stop:
78
- return np.concatenate(([0], chain_starts, [array.array_length()]))
79
- else:
80
- return np.concatenate(([0], chain_starts))
66
+ categories = ["chain_id"] + list(extra_categories)
67
+ if "sym_id" in array.get_annotation_categories():
68
+ categories.append("sym_id")
69
+ return get_segment_starts(
70
+ array,
71
+ add_exclusive_stop,
72
+ continuous_categories=("res_id",),
73
+ equal_categories=categories,
74
+ )
81
75
 
82
76
 
83
77
  def apply_chain_wise(array, data, function, axis=None):
@@ -33,10 +33,10 @@ def dot_bracket_from_structure(
33
33
  ----------
34
34
  nucleic_acid_strand : AtomArray
35
35
  The nucleic acid strand to be represented in DBL-notation.
36
- scores : ndarray, dtype=int, shape=(n,) (default: None)
36
+ scores : ndarray, dtype=int, shape=(n,)
37
37
  The score for each base pair, which is passed on to
38
38
  :func:`pseudoknots()`.
39
- max_pseudoknot_order : int (default: None)
39
+ max_pseudoknot_order : int
40
40
  The maximum pseudoknot order to be found. If a base pair would
41
41
  be of a higher order, it is represented as unpaired. If ``None``
42
42
  is given, all base pairs are evaluated.
@@ -82,9 +82,9 @@ def dot_bracket(basepairs, length, scores=None, max_pseudoknot_order=None):
82
82
  strand.
83
83
  length : int
84
84
  The number of bases in the strand.
85
- scores : ndarray, dtype=int, shape=(n,) (default: None)
85
+ scores : ndarray, dtype=int, shape=(n,)
86
86
  The score for each base pair, which is passed on to :func:`pseudoknots()`.
87
- max_pseudoknot_order : int (default: None)
87
+ max_pseudoknot_order : int
88
88
  The maximum pseudoknot order to be found. If a base pair would
89
89
  be of a higher order, it is represented as unpaired. If ``None``
90
90
  is given, all pseudoknot orders are evaluated.
@@ -57,59 +57,62 @@ def plot_nucleotide_secondary_structure(
57
57
  sequence. The positions are counted from zero.
58
58
  length : int
59
59
  The number of bases in the sequence.
60
- layout_type : RNAplotApp.Layout, optional (default: RNAplotApp.Layout.NAVIEW)
60
+ layout_type : RNAplotApp.Layout, optional
61
61
  The layout type according to the *RNAplot* documentation.
62
- draw_pseudoknots : bool, optional (default: True)
62
+ draw_pseudoknots : bool, optional
63
63
  Whether pseudoknotted bonds should be drawn.
64
- pseudoknot_order : iterable, optional (default: None)
64
+ pseudoknot_order : iterable, optional
65
65
  The pseudoknot order of each pair in the input `base_pairs`.
66
66
  If no pseudoknot order is given, a solution determined by
67
67
  :func:`biotite.structure.pseudoknots` is picked at random.
68
- angle : int or float, optional (default: 0)
68
+ angle : int or float, optional
69
69
  The angle the plot should be rotated.
70
- bond_linewidth : float or int or iterable, optional (default: 1)
70
+ bond_linewidth : float or int or iterable, optional
71
71
  The linewidth of each bond. Provide a single value to set the
72
72
  linewidth for all bonds or an iterable to set the linewidth for
73
73
  each individual bond.
74
- bond_linestyle : str or iterable, optional (default: None)
74
+ bond_linestyle : str or iterable, optional
75
75
  The *Matplotlib* compatible linestyle of each bond. Provide a
76
76
  single value to set the linewidth for all bonds or an iterable
77
77
  to set the linewidth for each individual bond. By default, solid
78
78
  lines are used for non-pseudoknotted bonds and dashed lines are
79
79
  used for pseudoknotted bonds.
80
- bond_color : str or ndarray, shape(n,) or shape(n,3) or shape(n,4), optional (default: 'black')
80
+ bond_color : str or ndarray, shape(n,) or shape(n,3) or shape(n,4), optional
81
81
  The *Matplotlib* compatible color of each bond. Provide a single
82
82
  string to set the color for all bonds or an array to set the
83
83
  color for each individual bond.
84
- backbone_linewidth : float, optional (default: 1)
84
+ backbone_linewidth : float, optional
85
85
  The linewidth of the backbone.
86
- backbone_linestyle : str, optional (default: 'solid')
86
+ backbone_linestyle : str, optional
87
87
  The *Matplotlib* compatible linestyle of the backbone.
88
- backbone_color : str or ndarray, shape=(3,) or shape=(4,), dtype=float, optional (default: 'grey')
88
+ backbone_color : str or ndarray, shape=(3,) or shape=(4,), dtype=float, optional
89
89
  The *Matplotlib* compatible color of the backbone.
90
- base_text : dict or iterable, optional (default: {'size': 'small'})
90
+ base_text : dict or iterable, optional
91
91
  The keyword parameters for the *Matplotlib* ``Text`` objects
92
92
  denoting the type of each base. Provide a single value to set
93
93
  the parameters for all labels or an iterable to set the
94
94
  parameters for each individual label.
95
- base_box : dict or iterable, optional (default: {'pad'=0, 'color'='white'})
95
+ The default is ``{'size': 'small'}``.
96
+ base_box : dict or iterable, optional)
96
97
  The *Matplotlib* compatible properties of the ``FancyBboxPatch``
97
98
  surrounding the base labels. Provide a single dictionary to
98
99
  set the properties of all base lables or an iterable to set the
99
100
  properties for each individual label.
100
- annotation_positions : iterable, optional (default: None)
101
+ The default is ``{'pad'=0, 'color'='white'}``.
102
+ annotation_positions : iterable, optional
101
103
  The positions of the bases to be numbered. By default every
102
104
  second base is annotated. Please note that while the positions
103
105
  in the sequence are counted from zero, they are displayed on the
104
106
  graph counted from one.
105
- annotation_offset : int or float, optional (default: 8.5)
107
+ annotation_offset : int or float, optional
106
108
  The offset of the annotations from the base labels.
107
- annotation_text : dict or iterable, optional (default: {'size': 'small'})
109
+ annotation_text : dict or iterable, optional
108
110
  The keyword parameters for the *Matplotlib* ``Text`` objects
109
111
  annotating the sequence. Provide a single value to set the
110
112
  parameters for all annotations or an iterable to set the
111
113
  parameters for each individual annotation.
112
- border : float, optional (default: 0.03)
114
+ The default is ``{'size': 'small'}``.
115
+ border : float, optional
113
116
  The percentage of the coordinate range to be left as whitespace
114
117
  to create a border around the plot.
115
118
  bin_path : str, optional
@@ -59,8 +59,7 @@ def hbond(
59
59
  The angle cutoff in degree between Donor-H..Acceptor to be
60
60
  considered a hydrogen bond.
61
61
  donor_elements, acceptor_elements : tuple of str
62
- Elements to be considered as possible donors or acceptors
63
- (Default: O, N, S).
62
+ Elements to be considered as possible donors or acceptors.
64
63
  periodic : bool, optional
65
64
  If true, hydrogen bonds can also be detected in periodic
66
65
  boundary conditions.
Binary file