biotite 0.41.2__cp312-cp312-macosx_11_0_arm64.whl → 1.0.1__cp312-cp312-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 (205) hide show
  1. biotite/__init__.py +2 -3
  2. biotite/application/__init__.py +1 -1
  3. biotite/application/application.py +20 -10
  4. biotite/application/autodock/__init__.py +1 -1
  5. biotite/application/autodock/app.py +74 -79
  6. biotite/application/blast/__init__.py +1 -1
  7. biotite/application/blast/alignment.py +19 -10
  8. biotite/application/blast/webapp.py +92 -85
  9. biotite/application/clustalo/__init__.py +1 -1
  10. biotite/application/clustalo/app.py +46 -61
  11. biotite/application/dssp/__init__.py +1 -1
  12. biotite/application/dssp/app.py +8 -11
  13. biotite/application/localapp.py +62 -60
  14. biotite/application/mafft/__init__.py +1 -1
  15. biotite/application/mafft/app.py +16 -22
  16. biotite/application/msaapp.py +78 -89
  17. biotite/application/muscle/__init__.py +1 -1
  18. biotite/application/muscle/app3.py +50 -64
  19. biotite/application/muscle/app5.py +23 -31
  20. biotite/application/sra/__init__.py +1 -1
  21. biotite/application/sra/app.py +64 -68
  22. biotite/application/tantan/__init__.py +1 -1
  23. biotite/application/tantan/app.py +22 -45
  24. biotite/application/util.py +7 -9
  25. biotite/application/viennarna/rnaalifold.py +34 -28
  26. biotite/application/viennarna/rnafold.py +24 -39
  27. biotite/application/viennarna/rnaplot.py +36 -21
  28. biotite/application/viennarna/util.py +17 -12
  29. biotite/application/webapp.py +13 -14
  30. biotite/copyable.py +13 -13
  31. biotite/database/__init__.py +1 -1
  32. biotite/database/entrez/__init__.py +1 -1
  33. biotite/database/entrez/check.py +2 -3
  34. biotite/database/entrez/dbnames.py +7 -5
  35. biotite/database/entrez/download.py +55 -49
  36. biotite/database/entrez/key.py +1 -1
  37. biotite/database/entrez/query.py +62 -23
  38. biotite/database/error.py +2 -1
  39. biotite/database/pubchem/__init__.py +1 -1
  40. biotite/database/pubchem/download.py +43 -45
  41. biotite/database/pubchem/error.py +2 -2
  42. biotite/database/pubchem/query.py +34 -31
  43. biotite/database/pubchem/throttle.py +3 -4
  44. biotite/database/rcsb/__init__.py +1 -1
  45. biotite/database/rcsb/download.py +44 -52
  46. biotite/database/rcsb/query.py +85 -80
  47. biotite/database/uniprot/check.py +6 -3
  48. biotite/database/uniprot/download.py +6 -11
  49. biotite/database/uniprot/query.py +115 -31
  50. biotite/file.py +12 -31
  51. biotite/sequence/__init__.py +3 -3
  52. biotite/sequence/align/__init__.py +2 -2
  53. biotite/sequence/align/alignment.py +99 -90
  54. biotite/sequence/align/banded.cpython-312-darwin.so +0 -0
  55. biotite/sequence/align/buckets.py +12 -10
  56. biotite/sequence/align/cigar.py +43 -52
  57. biotite/sequence/align/kmeralphabet.cpython-312-darwin.so +0 -0
  58. biotite/sequence/align/kmeralphabet.pyx +55 -51
  59. biotite/sequence/align/kmersimilarity.cpython-312-darwin.so +0 -0
  60. biotite/sequence/align/kmertable.cpython-312-darwin.so +0 -0
  61. biotite/sequence/align/kmertable.pyx +3 -2
  62. biotite/sequence/align/localgapped.cpython-312-darwin.so +0 -0
  63. biotite/sequence/align/localungapped.cpython-312-darwin.so +0 -0
  64. biotite/sequence/align/matrix.py +81 -82
  65. biotite/sequence/align/multiple.cpython-312-darwin.so +0 -0
  66. biotite/sequence/align/multiple.pyx +1 -1
  67. biotite/sequence/align/pairwise.cpython-312-darwin.so +0 -0
  68. biotite/sequence/align/permutation.cpython-312-darwin.so +0 -0
  69. biotite/sequence/align/permutation.pyx +12 -4
  70. biotite/sequence/align/selector.cpython-312-darwin.so +0 -0
  71. biotite/sequence/align/selector.pyx +52 -54
  72. biotite/sequence/align/statistics.py +32 -33
  73. biotite/sequence/align/tracetable.cpython-312-darwin.so +0 -0
  74. biotite/sequence/alphabet.py +51 -65
  75. biotite/sequence/annotation.py +78 -77
  76. biotite/sequence/codec.cpython-312-darwin.so +0 -0
  77. biotite/sequence/codon.py +90 -79
  78. biotite/sequence/graphics/__init__.py +1 -1
  79. biotite/sequence/graphics/alignment.py +184 -103
  80. biotite/sequence/graphics/colorschemes.py +10 -12
  81. biotite/sequence/graphics/dendrogram.py +79 -34
  82. biotite/sequence/graphics/features.py +133 -99
  83. biotite/sequence/graphics/logo.py +22 -28
  84. biotite/sequence/graphics/plasmid.py +229 -178
  85. biotite/sequence/io/fasta/__init__.py +1 -1
  86. biotite/sequence/io/fasta/convert.py +44 -33
  87. biotite/sequence/io/fasta/file.py +42 -55
  88. biotite/sequence/io/fastq/__init__.py +1 -1
  89. biotite/sequence/io/fastq/convert.py +11 -14
  90. biotite/sequence/io/fastq/file.py +68 -112
  91. biotite/sequence/io/genbank/__init__.py +2 -2
  92. biotite/sequence/io/genbank/annotation.py +12 -20
  93. biotite/sequence/io/genbank/file.py +74 -76
  94. biotite/sequence/io/genbank/metadata.py +74 -62
  95. biotite/sequence/io/genbank/sequence.py +13 -14
  96. biotite/sequence/io/general.py +39 -30
  97. biotite/sequence/io/gff/__init__.py +2 -2
  98. biotite/sequence/io/gff/convert.py +10 -15
  99. biotite/sequence/io/gff/file.py +81 -65
  100. biotite/sequence/phylo/__init__.py +1 -1
  101. biotite/sequence/phylo/nj.cpython-312-darwin.so +0 -0
  102. biotite/sequence/phylo/tree.cpython-312-darwin.so +0 -0
  103. biotite/sequence/phylo/upgma.cpython-312-darwin.so +0 -0
  104. biotite/sequence/profile.py +57 -28
  105. biotite/sequence/search.py +17 -15
  106. biotite/sequence/seqtypes.py +200 -164
  107. biotite/sequence/sequence.py +15 -17
  108. biotite/structure/__init__.py +3 -3
  109. biotite/structure/atoms.py +246 -236
  110. biotite/structure/basepairs.py +260 -271
  111. biotite/structure/bonds.cpython-312-darwin.so +0 -0
  112. biotite/structure/bonds.pyx +29 -32
  113. biotite/structure/box.py +67 -71
  114. biotite/structure/celllist.cpython-312-darwin.so +0 -0
  115. biotite/structure/chains.py +55 -39
  116. biotite/structure/charges.cpython-312-darwin.so +0 -0
  117. biotite/structure/compare.py +32 -32
  118. biotite/structure/density.py +13 -18
  119. biotite/structure/dotbracket.py +20 -22
  120. biotite/structure/error.py +10 -2
  121. biotite/structure/filter.py +83 -78
  122. biotite/structure/geometry.py +130 -119
  123. biotite/structure/graphics/atoms.py +60 -43
  124. biotite/structure/graphics/rna.py +81 -68
  125. biotite/structure/hbond.py +112 -93
  126. biotite/structure/info/__init__.py +0 -2
  127. biotite/structure/info/atoms.py +10 -11
  128. biotite/structure/info/bonds.py +41 -43
  129. biotite/structure/info/ccd.py +4 -5
  130. biotite/structure/info/groups.py +1 -3
  131. biotite/structure/info/masses.py +5 -10
  132. biotite/structure/info/misc.py +1 -1
  133. biotite/structure/info/radii.py +20 -20
  134. biotite/structure/info/standardize.py +15 -26
  135. biotite/structure/integrity.py +18 -71
  136. biotite/structure/io/__init__.py +3 -4
  137. biotite/structure/io/dcd/__init__.py +1 -1
  138. biotite/structure/io/dcd/file.py +22 -20
  139. biotite/structure/io/general.py +47 -61
  140. biotite/structure/io/gro/__init__.py +1 -1
  141. biotite/structure/io/gro/file.py +73 -72
  142. biotite/structure/io/mol/__init__.py +1 -1
  143. biotite/structure/io/mol/convert.py +8 -11
  144. biotite/structure/io/mol/ctab.py +37 -36
  145. biotite/structure/io/mol/header.py +14 -10
  146. biotite/structure/io/mol/mol.py +9 -53
  147. biotite/structure/io/mol/sdf.py +47 -50
  148. biotite/structure/io/netcdf/__init__.py +1 -1
  149. biotite/structure/io/netcdf/file.py +24 -23
  150. biotite/structure/io/pdb/__init__.py +1 -1
  151. biotite/structure/io/pdb/convert.py +32 -20
  152. biotite/structure/io/pdb/file.py +151 -172
  153. biotite/structure/io/pdb/hybrid36.cpython-312-darwin.so +0 -0
  154. biotite/structure/io/pdbqt/__init__.py +1 -1
  155. biotite/structure/io/pdbqt/convert.py +17 -11
  156. biotite/structure/io/pdbqt/file.py +128 -80
  157. biotite/structure/io/pdbx/__init__.py +1 -2
  158. biotite/structure/io/pdbx/bcif.py +36 -44
  159. biotite/structure/io/pdbx/cif.py +140 -110
  160. biotite/structure/io/pdbx/component.py +10 -16
  161. biotite/structure/io/pdbx/convert.py +260 -258
  162. biotite/structure/io/pdbx/encoding.cpython-312-darwin.so +0 -0
  163. biotite/structure/io/trajfile.py +90 -107
  164. biotite/structure/io/trr/__init__.py +1 -1
  165. biotite/structure/io/trr/file.py +12 -15
  166. biotite/structure/io/xtc/__init__.py +1 -1
  167. biotite/structure/io/xtc/file.py +11 -14
  168. biotite/structure/mechanics.py +9 -11
  169. biotite/structure/molecules.py +3 -4
  170. biotite/structure/pseudoknots.py +53 -67
  171. biotite/structure/rdf.py +23 -21
  172. biotite/structure/repair.py +137 -86
  173. biotite/structure/residues.py +26 -16
  174. biotite/structure/sasa.cpython-312-darwin.so +0 -0
  175. biotite/structure/{resutil.py → segments.py} +24 -23
  176. biotite/structure/sequence.py +10 -11
  177. biotite/structure/sse.py +100 -119
  178. biotite/structure/superimpose.py +39 -77
  179. biotite/structure/transform.py +97 -71
  180. biotite/structure/util.py +11 -13
  181. biotite/version.py +2 -2
  182. biotite/visualize.py +69 -55
  183. {biotite-0.41.2.dist-info → biotite-1.0.1.dist-info}/METADATA +6 -5
  184. biotite-1.0.1.dist-info/RECORD +322 -0
  185. biotite/structure/io/ctab.py +0 -72
  186. biotite/structure/io/mmtf/__init__.py +0 -21
  187. biotite/structure/io/mmtf/assembly.py +0 -214
  188. biotite/structure/io/mmtf/convertarray.cpython-312-darwin.so +0 -0
  189. biotite/structure/io/mmtf/convertarray.pyx +0 -341
  190. biotite/structure/io/mmtf/convertfile.cpython-312-darwin.so +0 -0
  191. biotite/structure/io/mmtf/convertfile.pyx +0 -501
  192. biotite/structure/io/mmtf/decode.cpython-312-darwin.so +0 -0
  193. biotite/structure/io/mmtf/decode.pyx +0 -152
  194. biotite/structure/io/mmtf/encode.cpython-312-darwin.so +0 -0
  195. biotite/structure/io/mmtf/encode.pyx +0 -183
  196. biotite/structure/io/mmtf/file.py +0 -233
  197. biotite/structure/io/npz/__init__.py +0 -20
  198. biotite/structure/io/npz/file.py +0 -152
  199. biotite/structure/io/pdbx/legacy.py +0 -267
  200. biotite/structure/io/tng/__init__.py +0 -13
  201. biotite/structure/io/tng/file.py +0 -46
  202. biotite/temp.py +0 -86
  203. biotite-0.41.2.dist-info/RECORD +0 -340
  204. {biotite-0.41.2.dist-info → biotite-1.0.1.dist-info}/WHEEL +0 -0
  205. {biotite-0.41.2.dist-info → biotite-1.0.1.dist-info}/licenses/LICENSE.rst +0 -0
biotite/__init__.py CHANGED
@@ -12,8 +12,7 @@ modules.
12
12
  __name__ = "biotite"
13
13
  __author__ = "Patrick Kunzmann"
14
14
 
15
- from .file import *
16
- from .temp import *
17
15
  from .copyable import *
16
+ from .file import *
17
+ from .version import __version__, __version_tuple__ # noqa: F401
18
18
  from .visualize import *
19
- from .version import __version__, __version_tuple__
@@ -65,5 +65,5 @@ __author__ = "Patrick Kunzmann"
65
65
 
66
66
  from .application import *
67
67
  from .localapp import *
68
+ from .msaapp import *
68
69
  from .webapp import *
69
- from .msaapp import *
@@ -4,19 +4,26 @@
4
4
 
5
5
  __name__ = "biotite.application"
6
6
  __author__ = "Patrick Kunzmann"
7
- __all__ = ["Application", "AppStateError", "TimeoutError", "VersionError",
8
- "AppState", "requires_state"]
7
+ __all__ = [
8
+ "Application",
9
+ "AppStateError",
10
+ "TimeoutError",
11
+ "VersionError",
12
+ "AppState",
13
+ "requires_state",
14
+ ]
9
15
 
10
16
  import abc
11
17
  import time
12
- from functools import wraps
13
18
  from enum import Flag, auto
19
+ from functools import wraps
14
20
 
15
21
 
16
22
  class AppState(Flag):
17
23
  """
18
24
  This enum type represents the app states of an application.
19
25
  """
26
+
20
27
  CREATED = auto()
21
28
  RUNNING = auto()
22
29
  FINISHED = auto()
@@ -45,6 +52,7 @@ def requires_state(app_state):
45
52
  ... def function(self):
46
53
  ... pass
47
54
  """
55
+
48
56
  def decorator(func):
49
57
  @wraps(func)
50
58
  def wrapper(*args, **kwargs):
@@ -52,16 +60,16 @@ def requires_state(app_state):
52
60
  try:
53
61
  instance = args[0]
54
62
  except IndexError:
55
- raise TypeError(
56
- "This method must be called from a class instance"
57
- )
63
+ raise TypeError("This method must be called from a class instance")
58
64
  if not instance._state & app_state:
59
65
  raise AppStateError(
60
66
  f"The application is in {instance.get_app_state()} state, "
61
67
  f"but {app_state} state is required"
62
68
  )
63
69
  return func(*args, **kwargs)
70
+
64
71
  return wrapper
72
+
65
73
  return decorator
66
74
 
67
75
 
@@ -146,11 +154,10 @@ class Application(metaclass=abc.ABCMeta):
146
154
  """
147
155
  time.sleep(self.wait_interval())
148
156
  while self.get_app_state() != AppState.FINISHED:
149
- if timeout is not None and time.time()-self._start_time > timeout:
157
+ if timeout is not None and time.time() - self._start_time > timeout:
150
158
  self.cancel()
151
159
  raise TimeoutError(
152
- f"The application expired its timeout "
153
- f"({timeout:.1f} s)"
160
+ f"The application expired its timeout " f"({timeout:.1f} s)"
154
161
  )
155
162
  else:
156
163
  time.sleep(self.wait_interval())
@@ -249,6 +256,7 @@ class AppStateError(Exception):
249
256
  """
250
257
  Indicate that the application lifecycle was violated.
251
258
  """
259
+
252
260
  pass
253
261
 
254
262
 
@@ -256,6 +264,7 @@ class TimeoutError(Exception):
256
264
  """
257
265
  Indicate that the application's timeout expired.
258
266
  """
267
+
259
268
  pass
260
269
 
261
270
 
@@ -263,4 +272,5 @@ class VersionError(Exception):
263
272
  """
264
273
  Indicate that the application's version is invalid.
265
274
  """
266
- pass
275
+
276
+ pass
@@ -9,4 +9,4 @@ A subpackage for static ligand docking with *Autodock*.
9
9
  __name__ = "biotite.application.autodock"
10
10
  __author__ = "Patrick Kunzmann"
11
11
 
12
- from .app import *
12
+ from .app import *
@@ -9,12 +9,12 @@ __all__ = ["VinaApp"]
9
9
  import copy
10
10
  from tempfile import NamedTemporaryFile
11
11
  import numpy as np
12
- from ..localapp import LocalApp, cleanup_tempfile
13
- from ..application import AppState, requires_state
14
- from ...structure.io.pdbqt import PDBQTFile
15
- from ...structure.residues import get_residue_starts_for, get_residue_masks
16
- from ...structure.bonds import find_connected
17
- from ...structure.error import BadStructureError
12
+ from biotite.application.application import AppState, requires_state
13
+ from biotite.application.localapp import LocalApp, cleanup_tempfile
14
+ from biotite.structure.bonds import find_connected
15
+ from biotite.structure.error import BadStructureError
16
+ from biotite.structure.io.pdbqt import PDBQTFile
17
+ from biotite.structure.residues import get_residue_masks, get_residue_starts_for
18
18
 
19
19
 
20
20
  class VinaApp(LocalApp):
@@ -62,8 +62,8 @@ class VinaApp(LocalApp):
62
62
  ... flexible=(receptor.res_id == 2) | (receptor.res_id == 5)
63
63
  ... )
64
64
  """
65
- def __init__(self, ligand, receptor, center, size, flexible=None,
66
- bin_path="vina"):
65
+
66
+ def __init__(self, ligand, receptor, center, size, flexible=None, bin_path="vina"):
67
67
  super().__init__(bin_path)
68
68
 
69
69
  if ligand.bonds is None:
@@ -83,23 +83,17 @@ class VinaApp(LocalApp):
83
83
 
84
84
  if self._is_flexible:
85
85
  flexible_indices = np.where(flexible)[0]
86
- self._flex_res_starts = np.unique(get_residue_starts_for(
87
- receptor, flexible_indices
88
- ))
89
-
90
- self._ligand_file = NamedTemporaryFile(
91
- "w", suffix=".pdbqt", delete=False
92
- )
93
- self._receptor_file = NamedTemporaryFile(
94
- "w", suffix=".pdbqt", delete=False
95
- )
96
- self._receptor_flex_file = NamedTemporaryFile(
86
+ self._flex_res_starts = np.unique(
87
+ get_residue_starts_for(receptor, flexible_indices)
88
+ )
89
+
90
+ self._ligand_file = NamedTemporaryFile("w", suffix=".pdbqt", delete=False)
91
+ self._receptor_file = NamedTemporaryFile("w", suffix=".pdbqt", delete=False)
92
+ self._receptor_flex_file = NamedTemporaryFile(
97
93
  "w", suffix=".pdbqt", delete=False
98
94
  )
99
- self._out_file = NamedTemporaryFile(
100
- "r", suffix=".pdbqt", delete=False
101
- )
102
-
95
+ self._out_file = NamedTemporaryFile("r", suffix=".pdbqt", delete=False)
96
+
103
97
  @requires_state(AppState.CREATED)
104
98
  def set_seed(self, seed):
105
99
  """
@@ -114,7 +108,7 @@ class VinaApp(LocalApp):
114
108
  The seed for the random number generator.
115
109
  """
116
110
  self._seed = seed
117
-
111
+
118
112
  @requires_state(AppState.CREATED)
119
113
  def set_exhaustiveness(self, exhaustiveness):
120
114
  """
@@ -131,7 +125,7 @@ class VinaApp(LocalApp):
131
125
  Must be greater than 0.
132
126
  """
133
127
  self._exhaustiveness = exhaustiveness
134
-
128
+
135
129
  @requires_state(AppState.CREATED)
136
130
  def set_max_number_of_models(self, number):
137
131
  """
@@ -147,7 +141,7 @@ class VinaApp(LocalApp):
147
141
  The maximum number of generated modes/models.
148
142
  """
149
143
  self._number = number
150
-
144
+
151
145
  @requires_state(AppState.CREATED)
152
146
  def set_energy_range(self, energy_range):
153
147
  """
@@ -168,34 +162,31 @@ class VinaApp(LocalApp):
168
162
  # Use different atom ID ranges for atoms in ligand and receptor
169
163
  # for unambiguous assignment, if the receptor contains flexible
170
164
  # residues
171
- self._ligand.set_annotation("atom_id", np.arange(
172
- 1,
173
- self._ligand.array_length() + 1
174
- ))
175
- self._receptor.set_annotation("atom_id", np.arange(
176
- self._ligand.array_length() + 1,
177
- self._ligand.array_length() + self._receptor.array_length() + 1
178
- ))
165
+ self._ligand.set_annotation(
166
+ "atom_id", np.arange(1, self._ligand.array_length() + 1)
167
+ )
168
+ self._receptor.set_annotation(
169
+ "atom_id",
170
+ np.arange(
171
+ self._ligand.array_length() + 1,
172
+ self._ligand.array_length() + self._receptor.array_length() + 1,
173
+ ),
174
+ )
179
175
 
180
176
  ligand_file = PDBQTFile()
181
- # Contains 'true' entries for all atoms that have not been
177
+ # Contains 'true' entries for all atoms that have not been
182
178
  # removed from ligand
183
179
  self._ligand_mask = ligand_file.set_structure(
184
- self._ligand,
185
- rotatable_bonds="all"
180
+ self._ligand, rotatable_bonds="all"
186
181
  )
187
182
  ligand_file.write(self._ligand_file)
188
183
  self._ligand_file.flush()
189
-
184
+
190
185
  if self._is_flexible:
191
- self._rigid_mask = np.ones(
192
- self._receptor.array_length(), dtype=bool
193
- )
194
- # Contains 'true' entries for all atoms that have not been
186
+ self._rigid_mask = np.ones(self._receptor.array_length(), dtype=bool)
187
+ # Contains 'true' entries for all atoms that have not been
195
188
  # removed from receptor in flexible side chains
196
- self._receptor_mask = np.zeros(
197
- self._receptor.array_length(), dtype=bool
198
- )
189
+ self._receptor_mask = np.zeros(self._receptor.array_length(), dtype=bool)
199
190
  for i, start in enumerate(self._flex_res_starts):
200
191
  flex_mask, rigid_mask, root = self._get_flexible_residue(start)
201
192
  self._rigid_mask &= rigid_mask
@@ -207,7 +198,7 @@ class VinaApp(LocalApp):
207
198
  self._receptor[flex_mask],
208
199
  rotatable_bonds="all",
209
200
  root=root_in_flex_residue,
210
- include_torsdof=False
201
+ include_torsdof=False,
211
202
  )
212
203
  # Enclose each flexible residue
213
204
  # with BEGIN_RES and END_RES
@@ -220,7 +211,7 @@ class VinaApp(LocalApp):
220
211
  receptor_file.set_structure(
221
212
  self._receptor[self._rigid_mask],
222
213
  rotatable_bonds=None,
223
- include_torsdof=False
214
+ include_torsdof=False,
224
215
  )
225
216
  receptor_file.write(self._receptor_file)
226
217
  self._receptor_file.flush()
@@ -228,23 +219,30 @@ class VinaApp(LocalApp):
228
219
  else:
229
220
  receptor_file = PDBQTFile()
230
221
  receptor_file.set_structure(
231
- self._receptor,
232
- rotatable_bonds=None,
233
- include_torsdof=False
222
+ self._receptor, rotatable_bonds=None, include_torsdof=False
234
223
  )
235
224
  receptor_file.write(self._receptor_file)
236
225
  self._receptor_file.flush()
237
226
 
238
227
  arguments = [
239
- "--ligand", self._ligand_file.name,
240
- "--receptor", self._receptor_file.name,
241
- "--out", self._out_file.name,
242
- "--center_x", f"{self._center[0]:.3f}",
243
- "--center_y", f"{self._center[1]:.3f}",
244
- "--center_z", f"{self._center[2]:.3f}",
245
- "--size_x", f"{self._size[0]:.3f}",
246
- "--size_y", f"{self._size[1]:.3f}",
247
- "--size_z", f"{self._size[2]:.3f}",
228
+ "--ligand",
229
+ self._ligand_file.name,
230
+ "--receptor",
231
+ self._receptor_file.name,
232
+ "--out",
233
+ self._out_file.name,
234
+ "--center_x",
235
+ f"{self._center[0]:.3f}",
236
+ "--center_y",
237
+ f"{self._center[1]:.3f}",
238
+ "--center_z",
239
+ f"{self._center[2]:.3f}",
240
+ "--size_x",
241
+ f"{self._size[0]:.3f}",
242
+ "--size_y",
243
+ f"{self._size[1]:.3f}",
244
+ "--size_z",
245
+ f"{self._size[2]:.3f}",
248
246
  ]
249
247
  if self._seed is not None:
250
248
  arguments.extend(["--seed", str(self._seed)])
@@ -259,32 +257,32 @@ class VinaApp(LocalApp):
259
257
 
260
258
  self.set_arguments(arguments)
261
259
  super().run()
262
-
260
+
263
261
  def evaluate(self):
264
262
  super().evaluate()
265
263
  out_file = PDBQTFile.read(self._out_file)
266
-
264
+
267
265
  models = out_file.get_structure()
268
266
 
269
267
  n_ligand_atoms = np.count_nonzero(self._ligand_mask)
270
268
  self._ligand_models = models[..., :n_ligand_atoms]
271
269
  self._flex_models = models[..., n_ligand_atoms:]
272
270
  self._n_models = models.stack_depth()
273
-
271
+
274
272
  remarks = out_file.get_remarks()
275
273
  self._energies = np.array(
276
274
  # VINA RESULT: -5.8 0.000 0.000
277
275
  # ^
278
276
  [float(remark[12:].split()[0]) for remark in remarks]
279
277
  )
280
-
278
+
281
279
  def clean_up(self):
282
280
  super().clean_up()
283
281
  cleanup_tempfile(self._ligand_file)
284
282
  cleanup_tempfile(self._receptor_file)
285
283
  cleanup_tempfile(self._receptor_flex_file)
286
284
  cleanup_tempfile(self._out_file)
287
-
285
+
288
286
  @requires_state(AppState.JOINED)
289
287
  def get_energies(self):
290
288
  """
@@ -302,7 +300,7 @@ class VinaApp(LocalApp):
302
300
  @requires_state(AppState.JOINED)
303
301
  def get_ligand_models(self):
304
302
  """
305
- Get the ligand structure with the conformations for each
303
+ Get the ligand structure with the conformations for each
306
304
  generated binding mode.
307
305
 
308
306
  Returns
@@ -312,7 +310,7 @@ class VinaApp(LocalApp):
312
310
  Each model corresponds to one binding mode.
313
311
  The models are sorted from best to worst predicted binding
314
312
  affinity.
315
-
313
+
316
314
  Notes
317
315
  -----
318
316
  The returned structure may contain less atoms than the input
@@ -338,12 +336,11 @@ class VinaApp(LocalApp):
338
336
  atoms are set to *NaN*.
339
337
  """
340
338
  coord = np.full(
341
- (self._n_models, self._ligand.array_length(), 3),
342
- np.nan, dtype=np.float32
339
+ (self._n_models, self._ligand.array_length(), 3), np.nan, dtype=np.float32
343
340
  )
344
341
  coord[:, self._ligand_mask] = self._ligand_models.coord
345
342
  return coord
346
-
343
+
347
344
  @requires_state(AppState.JOINED)
348
345
  def get_flexible_residue_models(self):
349
346
  """
@@ -360,7 +357,7 @@ class VinaApp(LocalApp):
360
357
  Each model corresponds to one binding mode.
361
358
  The models are sorted from best to worst predicted binding
362
359
  affinity.
363
-
360
+
364
361
  Notes
365
362
  -----
366
363
  The returned structure may contain less atoms than the input
@@ -385,7 +382,7 @@ class VinaApp(LocalApp):
385
382
  affinity.
386
383
  Missing coordinates due to the removed nonpolar hydrogen
387
384
  atoms from flexible side chains are set to *NaN*.
388
-
385
+
389
386
  Notes
390
387
  -----
391
388
  The output is only meaningful, if flexible side chains were
@@ -394,8 +391,7 @@ class VinaApp(LocalApp):
394
391
  of the input receptor coordinates.
395
392
  """
396
393
  coord = np.repeat(
397
- self._receptor.coord[np.newaxis, ...],
398
- repeats=self._n_models, axis=0
394
+ self._receptor.coord[np.newaxis, ...], repeats=self._n_models, axis=0
399
395
  )
400
396
  if self._is_flexible:
401
397
  # Replace original coordinates with modeled coordinates
@@ -424,16 +420,16 @@ class VinaApp(LocalApp):
424
420
  root_connect_indices, _ = self._receptor.bonds.get_bonds(root_index)
425
421
  connected_index = None
426
422
  try:
427
- connected_index = root_connect_indices[np.isin(
428
- self._receptor.atom_name[root_connect_indices], ("CB",)
429
- )][0]
423
+ connected_index = root_connect_indices[
424
+ np.isin(self._receptor.atom_name[root_connect_indices], ("CB",))
425
+ ][0]
430
426
  except IndexError:
431
427
  # Residue has no appropriate connection (e.g. in glycine)
432
428
  # -> There is no atom in the flexible side chain
433
429
  flex_mask = np.zeros(self._receptor.array_length(), dtype=bool)
434
430
  rigid_mask = np.ones(self._receptor.array_length(), dtype=bool)
435
431
  return flex_mask, rigid_mask, root_index
436
-
432
+
437
433
  # Remove the root bond from the bond list
438
434
  # to find the atoms involved in the flexible part
439
435
  bonds = self._receptor.bonds.copy()
@@ -442,7 +438,7 @@ class VinaApp(LocalApp):
442
438
  if root_index in flexible_indices:
443
439
  raise BadStructureError(
444
440
  "There are multiple connections between the flexible and "
445
- "rigid part, maybe a cyclic residue like proline was selected"
441
+ "rigid part, maybe a cyclic residue like proline was selected"
446
442
  )
447
443
 
448
444
  flex_mask = np.zeros(self._receptor.array_length(), dtype=bool)
@@ -452,7 +448,6 @@ class VinaApp(LocalApp):
452
448
  flex_mask[root_index] = True
453
449
 
454
450
  return flex_mask, rigid_mask, root_index
455
-
456
451
 
457
452
  @staticmethod
458
453
  def dock(ligand, receptor, center, size, flexible=None, bin_path="vina"):
@@ -10,5 +10,5 @@ using BLAST.
10
10
  __name__ = "biotite.application.blast"
11
11
  __author__ = "Patrick Kunzmann"
12
12
 
13
+ from .alignment import *
13
14
  from .webapp import *
14
- from .alignment import *
@@ -6,7 +6,7 @@ __name__ = "biotite.application.blast"
6
6
  __author__ = "Patrick Kunzmann"
7
7
  __all__ = ["BlastAlignment"]
8
8
 
9
- from ...sequence.align.alignment import Alignment
9
+ from biotite.sequence.align.alignment import Alignment
10
10
 
11
11
 
12
12
  class BlastAlignment(Alignment):
@@ -14,10 +14,10 @@ class BlastAlignment(Alignment):
14
14
  A specialized :class:`Alignment` class for alignments using the
15
15
  BLAST application. It stores additional data, like the E-value,
16
16
  the HSP position and a description of the hit sequence.
17
-
17
+
18
18
  Like its superclass, all attributes of a :class:`BlastAlignment` are
19
19
  public. The attributes are the same as the constructor parameters.
20
-
20
+
21
21
  Parameters
22
22
  ----------
23
23
  sequences : list
@@ -44,16 +44,25 @@ class BlastAlignment(Alignment):
44
44
  hit_definition : str
45
45
  The name of the hit sequence.
46
46
  """
47
-
48
- def __init__(self, sequences, trace, score, e_value,
49
- query_interval, hit_interval, hit_id, hit_definition):
47
+
48
+ def __init__(
49
+ self,
50
+ sequences,
51
+ trace,
52
+ score,
53
+ e_value,
54
+ query_interval,
55
+ hit_interval,
56
+ hit_id,
57
+ hit_definition,
58
+ ):
50
59
  super().__init__(sequences, trace, score)
51
60
  self.e_value = e_value
52
61
  self.query_interval = query_interval
53
62
  self.hit_interval = hit_interval
54
63
  self.hit_id = hit_id
55
64
  self.hit_definition = hit_definition
56
-
65
+
57
66
  def __eq__(self, item):
58
67
  if not isinstance(item, BlastAlignment):
59
68
  return False
@@ -68,7 +77,7 @@ class BlastAlignment(Alignment):
68
77
  if self.hit_definition != item.hit_definition:
69
78
  return False
70
79
  return super().__eq__(item)
71
-
80
+
72
81
  def __getitem__(self, index):
73
82
  super_alignment = super().__getitem__(index)
74
83
  return BlastAlignment(
@@ -79,5 +88,5 @@ class BlastAlignment(Alignment):
79
88
  self.query_interval,
80
89
  self.hit_interval,
81
90
  self.hit_id,
82
- self.hit_definition
83
- )
91
+ self.hit_definition,
92
+ )