biotite 1.1.0__cp311-cp311-macosx_11_0_arm64.whl → 1.2.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 (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.cpython-311-darwin.so +0 -0
  48. biotite/sequence/align/banded.pyx +21 -21
  49. biotite/sequence/align/cigar.py +2 -2
  50. biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
  51. biotite/sequence/align/kmeralphabet.pyx +2 -2
  52. biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
  53. biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
  54. biotite/sequence/align/kmertable.pyx +6 -6
  55. biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
  56. biotite/sequence/align/localgapped.pyx +47 -47
  57. biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
  58. biotite/sequence/align/localungapped.pyx +10 -10
  59. biotite/sequence/align/matrix.py +12 -3
  60. biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
  61. biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
  62. biotite/sequence/align/pairwise.pyx +35 -35
  63. biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
  64. biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
  65. biotite/sequence/align/selector.pyx +2 -2
  66. biotite/sequence/align/statistics.py +1 -1
  67. biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
  68. biotite/sequence/alphabet.py +2 -2
  69. biotite/sequence/annotation.py +19 -13
  70. biotite/sequence/codec.cpython-311-darwin.so +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.cpython-311-darwin.so +0 -0
  84. biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
  85. biotite/sequence/phylo/upgma.cpython-311-darwin.so +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.cpython-311-darwin.so +0 -0
  97. biotite/structure/bonds.pyx +8 -5
  98. biotite/structure/box.py +19 -21
  99. biotite/structure/celllist.cpython-311-darwin.so +0 -0
  100. biotite/structure/celllist.pyx +83 -67
  101. biotite/structure/chains.py +5 -37
  102. biotite/structure/charges.cpython-311-darwin.so +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.cpython-311-darwin.so +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.cpython-311-darwin.so +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.cpython-311-darwin.so +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
biotite/structure/util.py CHANGED
@@ -3,7 +3,7 @@
3
3
  # information.
4
4
 
5
5
  """
6
- Utility functions for in internal use in `Bio.Structure` package
6
+ Utility functions for in internal use in `Bio.Structure` package.
7
7
  """
8
8
 
9
9
  __name__ = "biotite.structure"
@@ -28,7 +28,7 @@ def vector_dot(v1, v2):
28
28
 
29
29
  Parameters
30
30
  ----------
31
- v1,v2 : ndarray
31
+ v1, v2 : ndarray
32
32
  The arrays to calculate the product from.
33
33
  The vectors are represented by the last axis.
34
34
 
@@ -63,7 +63,7 @@ def distance(v1, v2):
63
63
 
64
64
  Parameters
65
65
  ----------
66
- v1,v2 : ndarray
66
+ v1, v2 : ndarray
67
67
  The arrays to calculate the product from.
68
68
  The vectors are represented by the last axis.
69
69
 
biotite/version.py CHANGED
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '1.1.0'
16
- __version_tuple__ = version_tuple = (1, 1, 0)
20
+ __version__ = version = '1.2.0'
21
+ __version_tuple__ = version_tuple = (1, 2, 0)
biotite/visualize.py CHANGED
@@ -4,12 +4,16 @@
4
4
 
5
5
  __name__ = "biotite"
6
6
  __author__ = "Patrick Kunzmann"
7
- __all__ = ["colors", "set_font_size_in_coord", "AdaptiveFancyArrow"]
7
+ __all__ = ["colors", "plot_scaled_text", "set_font_size_in_coord", "AdaptiveFancyArrow"]
8
8
 
9
+ import warnings
9
10
  from collections import OrderedDict
10
11
  import numpy as np
11
12
  from numpy.linalg import norm
12
13
 
14
+ _FONT_PROPERTY_KEYS = ["family", "style", "variant", "weight", "stretch", "size"]
15
+
16
+
13
17
  # Biotite themed colors
14
18
  colors = OrderedDict(
15
19
  [
@@ -27,6 +31,105 @@ colors = OrderedDict(
27
31
  )
28
32
 
29
33
 
34
+ def plot_scaled_text(
35
+ axes, text, x, y, width=None, height=None, mode="unlocked", **kwargs
36
+ ):
37
+ """
38
+ Create a :class:`matplotlib.textpath.TextPath`, whose text size is given in
39
+ coordinates instead of font size.
40
+
41
+ Parameters
42
+ ----------
43
+ axes : Axes
44
+ The axes to draw the text on.
45
+ text : str
46
+ The text to be drawn.
47
+ x, y : float
48
+ The lower left position of the text.
49
+ width, height : float, optional
50
+ The width/height `text` should have in its reference coordinate system.
51
+ At least one value must be supplied.
52
+ mode : {'proportional', 'unlocked', 'maximum', 'minimum'}, optional
53
+ Defines how the text size is scaled.
54
+ The scaling mode:
55
+
56
+ - *proportional* - The width and height are scaled by the
57
+ same extent.
58
+ Either `width` or `height` must be set for this mode.
59
+ - *unlocked* - The width and the height are scaled by
60
+ different extents, changing the aspect ratio of the text.
61
+ Both `width` and `height` must be set for this mode.
62
+ - *maximum* - The width and the height are scaled by
63
+ the same extent, so that they are at maximum as large
64
+ as the supplied `width`/`height`.
65
+ Both `width` and `height` must be set for this mode.
66
+ - *minimum* - The width and the height are scaled by
67
+ the same extent, so that they are at minimum as large
68
+ as the supplied `width`/`height`.
69
+ Both `width` and `height` must be set for this mode.
70
+
71
+ **kwargs
72
+ Additional parameters for the :class:`matplotlib.font_manager.FontProperties`
73
+ of the text or the created :class:`matplotlib.patches.PathPatch`.
74
+
75
+ Returns
76
+ -------
77
+ patch : matplotlib.patches.PathPatch
78
+ The patch that represents the text.
79
+ """
80
+ from matplotlib.patches import PathPatch
81
+ from matplotlib.textpath import TextPath
82
+ from matplotlib.transforms import Affine2D
83
+
84
+ # The larger the size, the more there is an offset at the x-axis
85
+ # -> Keep font size small to reduce this error to a minimum
86
+ # The size is transformed to the desired size afterwards anyway
87
+ font_property_kwargs = {
88
+ key: kwargs.pop(key) for key in _FONT_PROPERTY_KEYS if key in kwargs
89
+ }
90
+ path = TextPath((x, y), text, size=1e-3, prop=font_property_kwargs)
91
+ bbox = path.get_extents()
92
+
93
+ if mode == "proportional":
94
+ if width is None:
95
+ # Proportional scaling based on height
96
+ scale_y = height / bbox.height
97
+ scale_x = scale_y
98
+ elif height is None:
99
+ # Proportional scaling based on width
100
+ scale_x = width / bbox.width
101
+ scale_y = scale_x
102
+ else:
103
+ raise ValueError(
104
+ "width or height are mutually exclusive in 'proportional' mode"
105
+ )
106
+ elif mode == "unlocked":
107
+ scale_x = width / bbox.width
108
+ scale_y = height / bbox.height
109
+ elif mode == "minimum":
110
+ scale_x = width / bbox.width
111
+ scale_y = height / bbox.height
112
+ scale = max(scale_x, scale_y)
113
+ scale_x, scale_y = scale, scale
114
+ elif mode == "maximum":
115
+ scale_x = width / bbox.width
116
+ scale_y = height / bbox.height
117
+ scale = min(scale_x, scale_y)
118
+ scale_x, scale_y = scale, scale
119
+
120
+ path = (
121
+ Affine2D()
122
+ .translate(-bbox.x0, -bbox.y0)
123
+ .scale(scale_x, scale_y)
124
+ .translate(bbox.x0, bbox.y0)
125
+ .transform_path(path)
126
+ )
127
+ patch = PathPatch(path, **kwargs)
128
+ axes.add_patch(patch)
129
+
130
+ return patch
131
+
132
+
30
133
  def set_font_size_in_coord(text, width=None, height=None, mode="unlocked"):
31
134
  """
32
135
  Specifiy the font size of an existing `Text` object in coordinates
@@ -38,6 +141,8 @@ def set_font_size_in_coord(text, width=None, height=None, mode="unlocked"):
38
141
  The scaling can be proportional or non-proportional, depending
39
142
  the `mode`.
40
143
 
144
+ DEPRECATED: Use :func:`plot_scaled_text()` instead.
145
+
41
146
  Parameters
42
147
  ----------
43
148
  text : Text:
@@ -125,6 +230,11 @@ def set_font_size_in_coord(text, width=None, height=None, mode="unlocked"):
125
230
  affine = Affine2D().scale(scale_x, scale_y) + affine
126
231
  renderer.draw_path(gc, tpath, affine, rgbFace)
127
232
 
233
+ warnings.warn(
234
+ "Deprecated, use 'biotite.graphics.text.plot_scaled_text()' instead.",
235
+ DeprecationWarning,
236
+ )
237
+
128
238
  if mode in ["unlocked", "minimum", "maximum"]:
129
239
  if width is None or height is None:
130
240
  raise TypeError(f"Width and height must be set in '{mode}' mode")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: biotite
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: A comprehensive library for computational molecular biology
5
5
  Project-URL: homepage, https://www.biotite-python.org
6
6
  Project-URL: repository, https://github.com/biotite-dev/biotite
@@ -53,9 +53,11 @@ Requires-Dist: biotraj<2.0,>=1.0
53
53
  Requires-Dist: msgpack>=0.5.6
54
54
  Requires-Dist: networkx>=2.0
55
55
  Requires-Dist: numpy>=1.25
56
+ Requires-Dist: packaging>=24.0
56
57
  Requires-Dist: requests>=2.12
57
58
  Provides-Extra: lint
58
- Requires-Dist: ruff==0.6.9; extra == 'lint'
59
+ Requires-Dist: numpydoc==1.8.0; extra == 'lint'
60
+ Requires-Dist: ruff==0.9.7; extra == 'lint'
59
61
  Provides-Extra: test
60
62
  Requires-Dist: pytest; extra == 'test'
61
63
  Requires-Dist: pytest-codspeed; extra == 'test'
@@ -186,5 +188,5 @@ Contribution
186
188
 
187
189
  Interested in improving *Biotite*?
188
190
  Have a look at the
189
- `contribution guidelines <https://www.biotite-python.org/contribute.html>`_.
191
+ `contribution guidelines <https://www.biotite-python.org/latest/contribution/index.html>`_.
190
192
  Feel free to join our community chat on `Discord <https://discord.gg/cUjDguF>`_.