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
@@ -35,39 +35,38 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
35
35
  point_number=1000, point_distr="Fibonacci", vdw_radii="ProtOr")
36
36
 
37
37
  Calculate the Solvent Accessible Surface Area (SASA) of a protein.
38
-
38
+
39
39
  This function uses the Shrake-Rupley ("rolling probe")
40
40
  algorithm :footcite:`Shrake1973`:
41
41
  Every atom is occupied by a evenly distributed point mesh. The
42
42
  points that can be reached by the "rolling probe", are surface
43
43
  accessible.
44
-
44
+
45
45
  Parameters
46
46
  ----------
47
47
  array : AtomArray
48
48
  The protein model to calculate the SASA for.
49
49
  probe_radius : float, optional
50
- The VdW-radius of the solvent molecules (default: 1.4).
50
+ The VdW-radius of the solvent molecules.
51
51
  atom_filter : ndarray, dtype=bool, optional
52
52
  If this parameter is given, SASA is only calculated for the
53
53
  filtered atoms.
54
54
  ignore_ions : bool, optional
55
- If true, all monoatomic ions are removed before SASA calculation
56
- (default: True).
55
+ If true, all monoatomic ions are removed before SASA calculation.
57
56
  point_number : int, optional
58
57
  The number of points in the mesh occupying each atom for SASA
59
- calculation (default: 100). The SASA calculation time is
60
- proportional to the amount of sphere points.
58
+ calculation.
59
+ The SASA calculation time is proportional to the amount of sphere points.
61
60
  point_distr : str or function, optional
62
61
  If a function is given, the function is used to calculate the
63
62
  point distribution for the mesh (the function must take `float`
64
63
  *n* as parameter and return a *(n x 3)* :class:`ndarray`).
65
64
  Alternatively a string can be given to choose a built-in
66
65
  distribution:
67
-
66
+
68
67
  - **Fibonacci** - Distribute points using a golden section
69
68
  spiral.
70
-
69
+
71
70
  By default *Fibonacci* is used.
72
71
  vdw_radii : str or ndarray, dtype=float, optional
73
72
  Indicates the set of VdW radii to be used. If an `array`-length
@@ -76,7 +75,7 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
76
75
  SASA calculation (e.g. solvent atoms) can have arbitrary values
77
76
  (e.g. `NaN`). If instead a string is given, one of the
78
77
  built-in sets is used:
79
-
78
+
80
79
  - **ProtOr** - A set, which does not require hydrogen atoms
81
80
  in the model. Suitable for crystal structures.
82
81
  :footcite:`Tsai1999`
@@ -85,25 +84,25 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
85
84
  in the model (e.g. NMR elucidated structures).
86
85
  Values for main group elements are taken from :footcite:`Mantina2009`,
87
86
  and for relevant transition metals from the :footcite:`RDKit`.
88
-
87
+
89
88
  By default *ProtOr* is used.
90
-
91
-
89
+
90
+
92
91
  Returns
93
92
  -------
94
93
  sasa : ndarray, dtype=bool, shape=(n,)
95
- Atom-wise SASA. `NaN` for atoms where SASA has not been
94
+ Atom-wise SASA. `NaN` for atoms where SASA has not been
96
95
  calculated
97
96
  (solvent atoms, hydrogen atoms (ProtOr), atoms not in `filter`).
98
-
97
+
99
98
  References
100
99
  ----------
101
-
100
+
102
101
  .. footbibliography::
103
-
102
+
104
103
  """
105
104
  cdef int i=0, j=0, k=0, adj_atom_i=0, rel_atom_i=0
106
-
105
+
107
106
  cdef np.ndarray sasa_filter
108
107
  cdef np.ndarray occl_filter
109
108
  if atom_filter is not None:
@@ -122,7 +121,7 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
122
121
  filter = ~filter_monoatomic_ions(array)
123
122
  sasa_filter = sasa_filter & filter
124
123
  occl_filter = occl_filter & filter
125
-
124
+
126
125
  cdef np.ndarray sphere_points
127
126
  if callable(point_distr):
128
127
  sphere_points = point_distr(point_number)
@@ -131,7 +130,7 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
131
130
  else:
132
131
  raise ValueError(f"'{point_distr}' is not a valid point distribution")
133
132
  sphere_points = sphere_points.astype(np.float32)
134
-
133
+
135
134
  cdef np.ndarray radii
136
135
  if isinstance(vdw_radii, np.ndarray):
137
136
  radii = vdw_radii.astype(np.float32)
@@ -159,17 +158,17 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
159
158
  raise KeyError(f"'{vdw_radii}' is not a valid radii set")
160
159
  # Increase atom radii by probe size ("rolling probe")
161
160
  radii += probe_radius
162
-
161
+
163
162
  # Memoryview for filter
164
163
  # Problem with creating boolean memoryviews
165
164
  # -> Type uint8 is used
166
165
  cdef np_bool[:] sasa_filter_view = np.frombuffer(sasa_filter,
167
166
  dtype=np.uint8)
168
-
167
+
169
168
  cdef np.ndarray occl_r = radii[occl_filter]
170
169
  # Atom array containing occluding atoms
171
170
  occl_array = array[occl_filter]
172
-
171
+
173
172
  # Memoryviews for coordinates of entire (main) array
174
173
  # and for coordinates of occluding atom array
175
174
  cdef float32[:,:] main_coord = array.coord.astype(np.float32,
@@ -191,10 +190,10 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
191
190
  cdef float32[:] occl_radii_sq = occl_r * occl_r
192
191
  # Memoryview for atomwise SASA
193
192
  cdef float32[:] sasa = np.full(len(array), np.nan, dtype=np.float32)
194
-
193
+
195
194
  # Area of a sphere point on a unit sphere
196
195
  cdef float32 area_per_point = 4.0 * np.pi / point_number
197
-
196
+
198
197
  # Define further statically typed variables
199
198
  # that are needed for SASA calculation
200
199
  cdef int n_accesible = 0
@@ -213,8 +212,8 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
213
212
  cdef float32 occl_y = 0
214
213
  cdef float32 occl_z = 0
215
214
  cdef float32[:,:] relevant_occl_coord = None
216
-
217
- # Cell size is as large as the maximum distance,
215
+
216
+ # Cell size is as large as the maximum distance,
218
217
  # where two atom can intersect.
219
218
  # Therefore intersecting atoms are always in the same or adjacent cell.
220
219
  cell_list = CellList(occl_array, np.max(radii[occl_filter])*2)
@@ -227,7 +226,7 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
227
226
  cell_indices = cell_list.get_atoms_in_cells(array.coord)
228
227
  cell_indices_view = cell_indices
229
228
  max_adj_list_length = cell_indices.shape[0]
230
-
229
+
231
230
  # Later on, this array stores coordinates for actual
232
231
  # occluding atoms for a certain atom to calculate the
233
232
  # SASA for
@@ -237,7 +236,7 @@ def sasa(array, float probe_radius=1.4, np.ndarray atom_filter=None,
237
236
  # adjacent atoms
238
237
  relevant_occl_coord = np.zeros((max_adj_list_length, 4),
239
238
  dtype=np.float32)
240
-
239
+
241
240
  # Actual SASA calculation
242
241
  for i in range(array_length):
243
242
  # First level: The atoms to calculate SASA for
@@ -5,6 +5,7 @@
5
5
  __name__ = "biotite.structure"
6
6
  __author__ = "Patrick Kunzmann"
7
7
  __all__ = [
8
+ "get_segment_starts",
8
9
  "apply_segment_wise",
9
10
  "spread_segment_wise",
10
11
  "get_segment_masks",
@@ -16,6 +17,60 @@ __all__ = [
16
17
  import numpy as np
17
18
 
18
19
 
20
+ def get_segment_starts(
21
+ array, add_exclusive_stop, continuous_categories=(), equal_categories=()
22
+ ):
23
+ """
24
+ Generalized version of :func:`get_residue_starts()` for residues and chains.
25
+
26
+ The starts are determined from value changes in the given annotations.
27
+
28
+ Parameters
29
+ ----------
30
+ array : AtomArray or AtomArrayStack
31
+ The atom array (stack) to get the segment starts from.
32
+ add_exclusive_stop : bool, optional
33
+ If true, the exclusive stop of the input atom array,
34
+ i.e. ``array.array_length()``, is added to the returned array of start indices
35
+ as last element.
36
+ continuous_categories : tuple of str, optional
37
+ Annotation categories that are expected to be continuously increasing within a
38
+ segment.
39
+ This means if the value of such an annotation decreases from one atom to
40
+ another, a new segment is started.
41
+ equal_categories : tuple of str, optional
42
+ Annotation categories that are expected to be equal within a segment.
43
+ This means if the value of such an annotation changes from one atom to
44
+ another, a new segment is started.
45
+
46
+ Returns
47
+ -------
48
+ starts : ndarray, dtype=int
49
+ The start indices of segments in `array`.
50
+ """
51
+ if array.array_length() == 0:
52
+ return np.array([], dtype=int)
53
+
54
+ segment_start_mask = np.zeros(array.array_length() - 1, dtype=bool)
55
+ for annot_name in continuous_categories:
56
+ annotation = array.get_annotation(annot_name)
57
+ segment_start_mask |= np.diff(annotation) < 0
58
+ for annot_name in equal_categories:
59
+ annotation = array.get_annotation(annot_name)
60
+ segment_start_mask |= annotation[1:] != annotation[:-1]
61
+
62
+ # Convert mask to indices
63
+ # Add 1, to shift the indices from the end of a segment
64
+ # to the start of a new segment
65
+ chain_starts = np.where(segment_start_mask)[0] + 1
66
+
67
+ # The first chain is not included yet -> Insert '[0]'
68
+ if add_exclusive_stop:
69
+ return np.concatenate(([0], chain_starts, [array.array_length()]))
70
+ else:
71
+ return np.concatenate(([0], chain_starts))
72
+
73
+
19
74
  def apply_segment_wise(starts, data, function, axis=None):
20
75
  """
21
76
  Generalized version of :func:`apply_residue_wise()` for