biotite 1.0.1__cp311-cp311-macosx_10_9_x86_64.whl → 1.2.0__cp311-cp311-macosx_10_9_x86_64.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.
- biotite/application/application.py +3 -3
- biotite/application/autodock/app.py +1 -1
- biotite/application/blast/webapp.py +1 -1
- biotite/application/clustalo/app.py +1 -1
- biotite/application/dssp/app.py +13 -3
- biotite/application/localapp.py +36 -2
- biotite/application/msaapp.py +10 -10
- biotite/application/muscle/app3.py +5 -18
- biotite/application/muscle/app5.py +5 -5
- biotite/application/sra/app.py +0 -5
- biotite/application/util.py +22 -2
- biotite/application/viennarna/rnaalifold.py +8 -8
- biotite/application/viennarna/rnaplot.py +9 -3
- biotite/application/viennarna/util.py +1 -1
- biotite/application/webapp.py +1 -1
- biotite/database/afdb/__init__.py +12 -0
- biotite/database/afdb/download.py +191 -0
- biotite/database/entrez/dbnames.py +10 -0
- biotite/database/entrez/download.py +9 -10
- biotite/database/entrez/key.py +1 -1
- biotite/database/entrez/query.py +5 -4
- biotite/database/pubchem/download.py +6 -6
- biotite/database/pubchem/error.py +10 -0
- biotite/database/pubchem/query.py +12 -23
- biotite/database/rcsb/download.py +3 -2
- biotite/database/rcsb/query.py +8 -9
- biotite/database/uniprot/check.py +22 -17
- biotite/database/uniprot/download.py +3 -6
- biotite/database/uniprot/query.py +4 -5
- biotite/file.py +14 -2
- biotite/interface/__init__.py +19 -0
- biotite/interface/openmm/__init__.py +16 -0
- biotite/interface/openmm/state.py +93 -0
- biotite/interface/openmm/system.py +227 -0
- biotite/interface/pymol/__init__.py +198 -0
- biotite/interface/pymol/cgo.py +346 -0
- biotite/interface/pymol/convert.py +185 -0
- biotite/interface/pymol/display.py +267 -0
- biotite/interface/pymol/object.py +1226 -0
- biotite/interface/pymol/shapes.py +178 -0
- biotite/interface/pymol/startup.py +169 -0
- biotite/interface/rdkit/__init__.py +15 -0
- biotite/interface/rdkit/mol.py +490 -0
- biotite/interface/version.py +71 -0
- biotite/interface/warning.py +19 -0
- biotite/sequence/align/__init__.py +0 -4
- biotite/sequence/align/alignment.py +49 -14
- biotite/sequence/align/banded.cpython-311-darwin.so +0 -0
- biotite/sequence/align/banded.pyx +26 -26
- biotite/sequence/align/cigar.py +2 -2
- biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
- biotite/sequence/align/kmeralphabet.pyx +19 -2
- biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
- biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
- biotite/sequence/align/kmertable.pyx +58 -48
- biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
- biotite/sequence/align/localgapped.pyx +47 -47
- biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
- biotite/sequence/align/localungapped.pyx +10 -10
- biotite/sequence/align/matrix.py +284 -57
- biotite/sequence/align/matrix_data/3Di.mat +24 -0
- biotite/sequence/align/matrix_data/PB.license +21 -0
- biotite/sequence/align/matrix_data/PB.mat +18 -0
- biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
- biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
- biotite/sequence/align/pairwise.pyx +35 -35
- biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
- biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
- biotite/sequence/align/selector.pyx +2 -2
- biotite/sequence/align/statistics.py +1 -1
- biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
- biotite/sequence/alphabet.py +5 -2
- biotite/sequence/annotation.py +19 -13
- biotite/sequence/codec.cpython-311-darwin.so +0 -0
- biotite/sequence/codon.py +1 -2
- biotite/sequence/graphics/alignment.py +25 -39
- biotite/sequence/graphics/color_schemes/3di_flower.json +48 -0
- biotite/sequence/graphics/color_schemes/pb_flower.json +2 -1
- biotite/sequence/graphics/colorschemes.py +44 -11
- biotite/sequence/graphics/dendrogram.py +4 -2
- biotite/sequence/graphics/features.py +2 -2
- biotite/sequence/graphics/logo.py +10 -12
- biotite/sequence/io/fasta/convert.py +1 -2
- biotite/sequence/io/fasta/file.py +1 -1
- biotite/sequence/io/fastq/file.py +3 -3
- biotite/sequence/io/genbank/file.py +3 -3
- biotite/sequence/io/genbank/sequence.py +2 -0
- biotite/sequence/io/gff/convert.py +1 -1
- biotite/sequence/io/gff/file.py +1 -2
- biotite/sequence/phylo/nj.cpython-311-darwin.so +0 -0
- biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
- biotite/sequence/phylo/upgma.cpython-311-darwin.so +0 -0
- biotite/sequence/profile.py +105 -29
- biotite/sequence/search.py +0 -1
- biotite/sequence/seqtypes.py +136 -8
- biotite/sequence/sequence.py +1 -2
- biotite/setup_ccd.py +197 -0
- biotite/structure/__init__.py +6 -3
- biotite/structure/alphabet/__init__.py +25 -0
- biotite/structure/alphabet/encoder.py +332 -0
- biotite/structure/alphabet/encoder_weights_3di.kerasify +0 -0
- biotite/structure/alphabet/i3d.py +109 -0
- biotite/structure/alphabet/layers.py +86 -0
- biotite/structure/alphabet/pb.license +21 -0
- biotite/structure/alphabet/pb.py +170 -0
- biotite/structure/alphabet/unkerasify.py +128 -0
- biotite/structure/atoms.py +163 -66
- biotite/structure/basepairs.py +26 -26
- biotite/structure/bonds.cpython-311-darwin.so +0 -0
- biotite/structure/bonds.pyx +79 -25
- biotite/structure/box.py +19 -21
- biotite/structure/celllist.cpython-311-darwin.so +0 -0
- biotite/structure/celllist.pyx +83 -67
- biotite/structure/chains.py +5 -37
- biotite/structure/charges.cpython-311-darwin.so +0 -0
- biotite/structure/compare.py +420 -13
- biotite/structure/density.py +1 -1
- biotite/structure/dotbracket.py +27 -28
- biotite/structure/filter.py +8 -8
- biotite/structure/geometry.py +74 -127
- biotite/structure/hbond.py +17 -19
- biotite/structure/info/__init__.py +1 -0
- biotite/structure/info/atoms.py +24 -15
- biotite/structure/info/bonds.py +12 -6
- biotite/structure/info/ccd.py +125 -34
- biotite/structure/info/{ccd/components.bcif → components.bcif} +0 -0
- biotite/structure/info/groups.py +62 -19
- biotite/structure/info/masses.py +9 -6
- biotite/structure/info/misc.py +15 -22
- biotite/structure/info/radii.py +92 -22
- biotite/structure/info/standardize.py +4 -4
- biotite/structure/integrity.py +4 -6
- biotite/structure/io/general.py +2 -2
- biotite/structure/io/gro/file.py +8 -9
- biotite/structure/io/mol/convert.py +1 -1
- biotite/structure/io/mol/ctab.py +33 -28
- biotite/structure/io/mol/mol.py +1 -1
- biotite/structure/io/mol/sdf.py +80 -53
- biotite/structure/io/pdb/convert.py +4 -3
- biotite/structure/io/pdb/file.py +85 -25
- biotite/structure/io/pdb/hybrid36.cpython-311-darwin.so +0 -0
- biotite/structure/io/pdbqt/file.py +36 -36
- biotite/structure/io/pdbx/__init__.py +1 -0
- biotite/structure/io/pdbx/bcif.py +54 -15
- biotite/structure/io/pdbx/cif.py +92 -66
- biotite/structure/io/pdbx/component.py +15 -4
- biotite/structure/io/pdbx/compress.py +321 -0
- biotite/structure/io/pdbx/convert.py +410 -75
- biotite/structure/io/pdbx/encoding.cpython-311-darwin.so +0 -0
- biotite/structure/io/pdbx/encoding.pyx +98 -17
- biotite/structure/io/trajfile.py +9 -6
- biotite/structure/io/util.py +38 -0
- biotite/structure/mechanics.py +0 -1
- biotite/structure/molecules.py +141 -156
- biotite/structure/pseudoknots.py +7 -13
- biotite/structure/repair.py +2 -4
- biotite/structure/residues.py +13 -24
- biotite/structure/rings.py +335 -0
- biotite/structure/sasa.cpython-311-darwin.so +0 -0
- biotite/structure/sasa.pyx +2 -1
- biotite/structure/segments.py +69 -11
- biotite/structure/sequence.py +0 -1
- biotite/structure/sse.py +0 -2
- biotite/structure/superimpose.py +74 -62
- biotite/structure/tm.py +581 -0
- biotite/structure/transform.py +12 -25
- biotite/structure/util.py +76 -4
- biotite/version.py +9 -4
- biotite/visualize.py +111 -1
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/METADATA +6 -2
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/RECORD +173 -143
- biotite/structure/info/ccd/README.rst +0 -8
- biotite/structure/info/ccd/amino_acids.txt +0 -1663
- biotite/structure/info/ccd/carbohydrates.txt +0 -1135
- biotite/structure/info/ccd/nucleotides.txt +0 -798
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/WHEEL +0 -0
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/licenses/LICENSE.rst +0 -0
|
@@ -157,7 +157,7 @@ class Application(metaclass=abc.ABCMeta):
|
|
|
157
157
|
if timeout is not None and time.time() - self._start_time > timeout:
|
|
158
158
|
self.cancel()
|
|
159
159
|
raise TimeoutError(
|
|
160
|
-
f"The application expired its timeout
|
|
160
|
+
f"The application expired its timeout ({timeout:.1f} s)"
|
|
161
161
|
)
|
|
162
162
|
else:
|
|
163
163
|
time.sleep(self.wait_interval())
|
|
@@ -214,7 +214,7 @@ class Application(metaclass=abc.ABCMeta):
|
|
|
214
214
|
Returns
|
|
215
215
|
-------
|
|
216
216
|
finished : bool
|
|
217
|
-
True of the application has finished, false otherwise
|
|
217
|
+
True of the application has finished, false otherwise.
|
|
218
218
|
"""
|
|
219
219
|
pass
|
|
220
220
|
|
|
@@ -230,7 +230,7 @@ class Application(metaclass=abc.ABCMeta):
|
|
|
230
230
|
-------
|
|
231
231
|
interval : float
|
|
232
232
|
Time (in seconds) between calls of :func:`is_finished()` in
|
|
233
|
-
:func:`join()
|
|
233
|
+
:func:`join()`.
|
|
234
234
|
"""
|
|
235
235
|
pass
|
|
236
236
|
|
|
@@ -46,7 +46,7 @@ class BlastWebApp(WebApp):
|
|
|
46
46
|
obey_rules : bool, optional
|
|
47
47
|
If true, the application raises an :class:`RuleViolationError`,
|
|
48
48
|
if the server is contacted too often, based on the NCBI BLAST
|
|
49
|
-
usage rules.
|
|
49
|
+
usage rules.
|
|
50
50
|
mail : str, optional
|
|
51
51
|
If a mail address is provided, it will be appended in the
|
|
52
52
|
HTTP request. This allows the NCBI to contact you in case
|
|
@@ -172,7 +172,7 @@ class ClustalOmegaApp(MSAApp):
|
|
|
172
172
|
"""
|
|
173
173
|
if self._mbed:
|
|
174
174
|
raise ValueError(
|
|
175
|
-
"Getting the distance matrix requires
|
|
175
|
+
"Getting the distance matrix requires 'full_matrix_calculation()'"
|
|
176
176
|
)
|
|
177
177
|
return self._dist_matrix
|
|
178
178
|
|
biotite/application/dssp/app.py
CHANGED
|
@@ -6,10 +6,11 @@ __name__ = "biotite.application.dssp"
|
|
|
6
6
|
__author__ = "Patrick Kunzmann"
|
|
7
7
|
__all__ = ["DsspApp"]
|
|
8
8
|
|
|
9
|
+
from subprocess import SubprocessError
|
|
9
10
|
from tempfile import NamedTemporaryFile
|
|
10
11
|
import numpy as np
|
|
11
12
|
from biotite.application.application import AppState, requires_state
|
|
12
|
-
from biotite.application.localapp import LocalApp, cleanup_tempfile
|
|
13
|
+
from biotite.application.localapp import LocalApp, cleanup_tempfile, get_version
|
|
13
14
|
from biotite.structure.io.pdbx.cif import CIFFile
|
|
14
15
|
from biotite.structure.io.pdbx.convert import set_structure
|
|
15
16
|
|
|
@@ -72,7 +73,13 @@ class DsspApp(LocalApp):
|
|
|
72
73
|
self._array.set_annotation(
|
|
73
74
|
"occupancy", np.ones(self._array.array_length(), dtype=float)
|
|
74
75
|
)
|
|
75
|
-
|
|
76
|
+
try:
|
|
77
|
+
# The parameters have changed in version 4
|
|
78
|
+
self._new_cli = get_version(bin_path)[0] >= 4
|
|
79
|
+
except SubprocessError:
|
|
80
|
+
# In older versions, the no version is returned with `--version`
|
|
81
|
+
# -> a SubprocessError is raised
|
|
82
|
+
self._new_cli = False
|
|
76
83
|
self._in_file = NamedTemporaryFile("w", suffix=".cif", delete=False)
|
|
77
84
|
self._out_file = NamedTemporaryFile("r", suffix=".dssp", delete=False)
|
|
78
85
|
|
|
@@ -81,7 +88,10 @@ class DsspApp(LocalApp):
|
|
|
81
88
|
set_structure(in_file, self._array)
|
|
82
89
|
in_file.write(self._in_file)
|
|
83
90
|
self._in_file.flush()
|
|
84
|
-
|
|
91
|
+
if self._new_cli:
|
|
92
|
+
self.set_arguments([self._in_file.name, self._out_file.name])
|
|
93
|
+
else:
|
|
94
|
+
self.set_arguments(["-i", self._in_file.name, "-o", self._out_file.name])
|
|
85
95
|
super().run()
|
|
86
96
|
|
|
87
97
|
def evaluate(self):
|
biotite/application/localapp.py
CHANGED
|
@@ -8,7 +8,10 @@ __all__ = ["LocalApp"]
|
|
|
8
8
|
|
|
9
9
|
import abc
|
|
10
10
|
import copy
|
|
11
|
+
import re
|
|
12
|
+
import subprocess
|
|
11
13
|
from os import chdir, getcwd, remove
|
|
14
|
+
from pathlib import Path
|
|
12
15
|
from subprocess import PIPE, Popen, SubprocessError, TimeoutExpired
|
|
13
16
|
from biotite.application.application import (
|
|
14
17
|
Application,
|
|
@@ -175,7 +178,7 @@ class LocalApp(Application, metaclass=abc.ABCMeta):
|
|
|
175
178
|
Returns
|
|
176
179
|
-------
|
|
177
180
|
process : Popen
|
|
178
|
-
The `Popen` instance
|
|
181
|
+
The `Popen` instance.
|
|
179
182
|
"""
|
|
180
183
|
return self._process
|
|
181
184
|
|
|
@@ -276,7 +279,7 @@ class LocalApp(Application, metaclass=abc.ABCMeta):
|
|
|
276
279
|
if exit_code != 0:
|
|
277
280
|
err_msg = self.get_stderr().replace("\n", " ")
|
|
278
281
|
raise SubprocessError(
|
|
279
|
-
f"'{self._bin_path}' returned with exit code {exit_code}:
|
|
282
|
+
f"'{self._bin_path}' returned with exit code {exit_code}: {err_msg}"
|
|
280
283
|
)
|
|
281
284
|
|
|
282
285
|
def clean_up(self):
|
|
@@ -306,3 +309,34 @@ def cleanup_tempfile(temp_file):
|
|
|
306
309
|
except FileNotFoundError:
|
|
307
310
|
# File was already deleted, e.g. due to `TemporaryFile(delete=True)`
|
|
308
311
|
pass
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def get_version(bin_path, version_option="--version"):
|
|
315
|
+
"""
|
|
316
|
+
Get the version of a locally installed application.
|
|
317
|
+
|
|
318
|
+
Parameters
|
|
319
|
+
----------
|
|
320
|
+
bin_path : str or Path
|
|
321
|
+
Path of the application.
|
|
322
|
+
version_option : str, optional
|
|
323
|
+
The command line option to get the version.
|
|
324
|
+
|
|
325
|
+
Returns
|
|
326
|
+
-------
|
|
327
|
+
major, minor : int
|
|
328
|
+
The major and minor version number.
|
|
329
|
+
"""
|
|
330
|
+
output = subprocess.run(
|
|
331
|
+
[bin_path, version_option], capture_output=True, text=True
|
|
332
|
+
).stdout
|
|
333
|
+
# Find matches for version string containing major and minor version
|
|
334
|
+
match = re.search(r"\d+\.\d+", output)
|
|
335
|
+
if match is None:
|
|
336
|
+
raise subprocess.SubprocessError(
|
|
337
|
+
f"Could not determine '{Path(bin_path).name}' version "
|
|
338
|
+
f"from the string '{output}'"
|
|
339
|
+
)
|
|
340
|
+
version_string = match.group(0)
|
|
341
|
+
splitted = version_string.split(".")
|
|
342
|
+
return int(splitted[0]), int(splitted[1])
|
biotite/application/msaapp.py
CHANGED
|
@@ -68,7 +68,7 @@ class MSAApp(LocalApp, metaclass=abc.ABCMeta):
|
|
|
68
68
|
# Check matrix symmetry
|
|
69
69
|
if matrix is not None and not matrix.is_symmetric():
|
|
70
70
|
raise ValueError(
|
|
71
|
-
"A symmetric matrix is required for
|
|
71
|
+
"A symmetric matrix is required for multiple sequence alignments"
|
|
72
72
|
)
|
|
73
73
|
|
|
74
74
|
# Check whether the program supports the alignment for the given
|
|
@@ -274,12 +274,12 @@ class MSAApp(LocalApp, metaclass=abc.ABCMeta):
|
|
|
274
274
|
Check whether this class supports nucleotide sequences for
|
|
275
275
|
alignment.
|
|
276
276
|
|
|
277
|
+
PROTECTED: Override when inheriting.
|
|
278
|
+
|
|
277
279
|
Returns
|
|
278
280
|
-------
|
|
279
281
|
support : bool
|
|
280
282
|
True, if the class has support, false otherwise.
|
|
281
|
-
|
|
282
|
-
PROTECTED: Override when inheriting.
|
|
283
283
|
"""
|
|
284
284
|
pass
|
|
285
285
|
|
|
@@ -290,12 +290,12 @@ class MSAApp(LocalApp, metaclass=abc.ABCMeta):
|
|
|
290
290
|
Check whether this class supports nucleotide sequences for
|
|
291
291
|
alignment.
|
|
292
292
|
|
|
293
|
+
PROTECTED: Override when inheriting.
|
|
294
|
+
|
|
293
295
|
Returns
|
|
294
296
|
-------
|
|
295
297
|
support : bool
|
|
296
298
|
True, if the class has support, false otherwise.
|
|
297
|
-
|
|
298
|
-
PROTECTED: Override when inheriting.
|
|
299
299
|
"""
|
|
300
300
|
pass
|
|
301
301
|
|
|
@@ -306,12 +306,12 @@ class MSAApp(LocalApp, metaclass=abc.ABCMeta):
|
|
|
306
306
|
Check whether this class supports custom substitution matrices
|
|
307
307
|
for protein sequence alignment.
|
|
308
308
|
|
|
309
|
+
PROTECTED: Override when inheriting.
|
|
310
|
+
|
|
309
311
|
Returns
|
|
310
312
|
-------
|
|
311
313
|
support : bool
|
|
312
314
|
True, if the class has support, false otherwise.
|
|
313
|
-
|
|
314
|
-
PROTECTED: Override when inheriting.
|
|
315
315
|
"""
|
|
316
316
|
pass
|
|
317
317
|
|
|
@@ -322,12 +322,12 @@ class MSAApp(LocalApp, metaclass=abc.ABCMeta):
|
|
|
322
322
|
Check whether this class supports custom substitution matrices
|
|
323
323
|
for nucleotide sequence alignment.
|
|
324
324
|
|
|
325
|
+
PROTECTED: Override when inheriting.
|
|
326
|
+
|
|
325
327
|
Returns
|
|
326
328
|
-------
|
|
327
329
|
support : bool
|
|
328
330
|
True, if the class has support, false otherwise.
|
|
329
|
-
|
|
330
|
-
PROTECTED: Override when inheriting.
|
|
331
331
|
"""
|
|
332
332
|
pass
|
|
333
333
|
|
|
@@ -342,7 +342,7 @@ class MSAApp(LocalApp, metaclass=abc.ABCMeta):
|
|
|
342
342
|
Parameters
|
|
343
343
|
----------
|
|
344
344
|
sequences : iterable object of Sequence
|
|
345
|
-
The sequences to be aligned
|
|
345
|
+
The sequences to be aligned.
|
|
346
346
|
bin_path : str, optional
|
|
347
347
|
Path of the MSA software binary. By default, the default
|
|
348
348
|
path will be used.
|
|
@@ -7,13 +7,11 @@ __author__ = "Patrick Kunzmann"
|
|
|
7
7
|
__all__ = ["MuscleApp"]
|
|
8
8
|
|
|
9
9
|
import numbers
|
|
10
|
-
import re
|
|
11
|
-
import subprocess
|
|
12
10
|
import warnings
|
|
13
11
|
from collections.abc import Sequence
|
|
14
12
|
from tempfile import NamedTemporaryFile
|
|
15
13
|
from biotite.application.application import AppState, VersionError, requires_state
|
|
16
|
-
from biotite.application.localapp import cleanup_tempfile
|
|
14
|
+
from biotite.application.localapp import cleanup_tempfile, get_version
|
|
17
15
|
from biotite.application.msaapp import MSAApp
|
|
18
16
|
from biotite.sequence.phylo.tree import Tree
|
|
19
17
|
|
|
@@ -31,9 +29,9 @@ class MuscleApp(MSAApp):
|
|
|
31
29
|
matrix : SubstitutionMatrix, optional
|
|
32
30
|
A custom substitution matrix.
|
|
33
31
|
|
|
34
|
-
See
|
|
32
|
+
See Also
|
|
35
33
|
--------
|
|
36
|
-
Muscle5App
|
|
34
|
+
Muscle5App : Interface to MUSCLE version ``>=5``.
|
|
37
35
|
|
|
38
36
|
Examples
|
|
39
37
|
--------
|
|
@@ -54,7 +52,7 @@ class MuscleApp(MSAApp):
|
|
|
54
52
|
"""
|
|
55
53
|
|
|
56
54
|
def __init__(self, sequences, bin_path="muscle", matrix=None):
|
|
57
|
-
major_version = get_version(bin_path)[0]
|
|
55
|
+
major_version = get_version(bin_path, "-version")[0]
|
|
58
56
|
if major_version != 3:
|
|
59
57
|
raise VersionError(f"Muscle 3 is required, got version {major_version}")
|
|
60
58
|
|
|
@@ -199,7 +197,7 @@ class MuscleApp(MSAApp):
|
|
|
199
197
|
Parameters
|
|
200
198
|
----------
|
|
201
199
|
sequences : iterable object of Sequence
|
|
202
|
-
The sequences to be aligned
|
|
200
|
+
The sequences to be aligned.
|
|
203
201
|
bin_path : str, optional
|
|
204
202
|
Path of the MSA software binary. By default, the default path
|
|
205
203
|
will be used.
|
|
@@ -227,14 +225,3 @@ class MuscleApp(MSAApp):
|
|
|
227
225
|
app.start()
|
|
228
226
|
app.join()
|
|
229
227
|
return app.get_alignment()
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
def get_version(bin_path="muscle"):
|
|
233
|
-
output = subprocess.run([bin_path, "-version"], capture_output=True, text=True)
|
|
234
|
-
# Find matches for version string containing major and minor version
|
|
235
|
-
match = re.search(r"\d+\.\d+", output.stdout)
|
|
236
|
-
if match is None:
|
|
237
|
-
raise subprocess.SubprocessError("Could not determine Muscle version")
|
|
238
|
-
version_string = match.group(0)
|
|
239
|
-
splitted = version_string.split(".")
|
|
240
|
-
return int(splitted[0]), int(splitted[1])
|
|
@@ -7,8 +7,8 @@ __author__ = "Patrick Kunzmann"
|
|
|
7
7
|
__all__ = ["Muscle5App"]
|
|
8
8
|
|
|
9
9
|
from biotite.application.application import AppState, VersionError, requires_state
|
|
10
|
+
from biotite.application.localapp import get_version
|
|
10
11
|
from biotite.application.msaapp import MSAApp
|
|
11
|
-
from biotite.application.muscle.app3 import get_version
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class Muscle5App(MSAApp):
|
|
@@ -22,9 +22,9 @@ class Muscle5App(MSAApp):
|
|
|
22
22
|
bin_path : str, optional
|
|
23
23
|
Path of the MUSCLE binary.
|
|
24
24
|
|
|
25
|
-
See
|
|
25
|
+
See Also
|
|
26
26
|
--------
|
|
27
|
-
MuscleApp
|
|
27
|
+
MuscleApp : Interface to MUSCLE version ``<5``.
|
|
28
28
|
|
|
29
29
|
Notes
|
|
30
30
|
-----
|
|
@@ -49,7 +49,7 @@ class Muscle5App(MSAApp):
|
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
51
|
def __init__(self, sequences, bin_path="muscle"):
|
|
52
|
-
major_version = get_version(bin_path)[0]
|
|
52
|
+
major_version = get_version(bin_path, "-version")[0]
|
|
53
53
|
if major_version < 5:
|
|
54
54
|
raise VersionError(
|
|
55
55
|
f"At least Muscle 5 is required, got version {major_version}"
|
|
@@ -147,7 +147,7 @@ class Muscle5App(MSAApp):
|
|
|
147
147
|
Parameters
|
|
148
148
|
----------
|
|
149
149
|
sequences : iterable object of Sequence
|
|
150
|
-
The sequences to be aligned
|
|
150
|
+
The sequences to be aligned.
|
|
151
151
|
bin_path : str, optional
|
|
152
152
|
Path of the MSA software binary. By default, the default path
|
|
153
153
|
will be used.
|
biotite/application/sra/app.py
CHANGED
|
@@ -45,11 +45,6 @@ class _DumpApp(Application, metaclass=abc.ABCMeta):
|
|
|
45
45
|
prefetch_path, fasterq_dump_path : str, optional
|
|
46
46
|
Path to the ``prefetch_path`` and ``fasterq-dump`` binary,
|
|
47
47
|
respectively.
|
|
48
|
-
offset : int or {'Sanger', 'Solexa', 'Illumina-1.3', 'Illumina-1.5', 'Illumina-1.8'}, optional
|
|
49
|
-
This value is subtracted from the FASTQ ASCII code to obtain the
|
|
50
|
-
quality score.
|
|
51
|
-
Can either be directly the value, or a string that indicates
|
|
52
|
-
the score format.
|
|
53
48
|
"""
|
|
54
49
|
|
|
55
50
|
def __init__(
|
biotite/application/util.py
CHANGED
|
@@ -17,6 +17,16 @@ def map_sequence(sequence):
|
|
|
17
17
|
Map a sequence with an arbitrary alphabet into a
|
|
18
18
|
:class:`ProteinSequence`, in order to support arbitrary sequence
|
|
19
19
|
types in software that can handle protein sequences.
|
|
20
|
+
|
|
21
|
+
Parameters
|
|
22
|
+
----------
|
|
23
|
+
sequence : Sequence
|
|
24
|
+
The sequence to be mapped.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
mapped_sequence : ProteinSequence
|
|
29
|
+
The mapped sequence.
|
|
20
30
|
"""
|
|
21
31
|
if len(sequence.alphabet) > len(ProteinSequence.alphabet):
|
|
22
32
|
# Cannot map into a protein sequence if the alphabet
|
|
@@ -40,17 +50,27 @@ def map_matrix(matrix):
|
|
|
40
50
|
class:`SubstitutionMatrix` for protein sequences, in order to support
|
|
41
51
|
arbitrary sequence types in software that can handle protein
|
|
42
52
|
sequences.
|
|
53
|
+
|
|
54
|
+
Parameters
|
|
55
|
+
----------
|
|
56
|
+
matrix : SubstitutionMatrix
|
|
57
|
+
The substitution matrix to be mapped.
|
|
58
|
+
|
|
59
|
+
Returns
|
|
60
|
+
-------
|
|
61
|
+
mapped_matrix : SubstitutionMatrix
|
|
62
|
+
The mapped substitution matrix.
|
|
43
63
|
"""
|
|
44
64
|
if matrix is None:
|
|
45
65
|
raise TypeError(
|
|
46
|
-
"A substitution matrix must be provided for custom
|
|
66
|
+
"A substitution matrix must be provided for custom sequence types"
|
|
47
67
|
)
|
|
48
68
|
# Create a protein substitution matrix with the values taken
|
|
49
69
|
# from the original matrix
|
|
50
70
|
# All trailing symbols are filled with zeros
|
|
51
71
|
old_length = len(matrix.get_alphabet1())
|
|
52
72
|
new_length = len(ProteinSequence.alphabet)
|
|
53
|
-
new_score_matrix = np.zeros((new_length, new_length))
|
|
73
|
+
new_score_matrix = np.zeros((new_length, new_length), dtype=np.int32)
|
|
54
74
|
new_score_matrix[:old_length, :old_length] = matrix.score_matrix()
|
|
55
75
|
return SubstitutionMatrix(
|
|
56
76
|
ProteinSequence.alphabet, ProteinSequence.alphabet, new_score_matrix
|
|
@@ -167,15 +167,15 @@ class RNAalifoldApp(LocalApp):
|
|
|
167
167
|
free_energy : float
|
|
168
168
|
The free energy.
|
|
169
169
|
|
|
170
|
+
See Also
|
|
171
|
+
--------
|
|
172
|
+
get_covariance_energy : Get the energy of the artificial covariance term.
|
|
173
|
+
|
|
170
174
|
Notes
|
|
171
175
|
-----
|
|
172
176
|
The total energy of the secondary structure regarding the
|
|
173
177
|
minimization objective is the sum of the free energy and the
|
|
174
178
|
covariance term.
|
|
175
|
-
|
|
176
|
-
See also
|
|
177
|
-
--------
|
|
178
|
-
get_covariance_energy
|
|
179
179
|
"""
|
|
180
180
|
return self._free_energy
|
|
181
181
|
|
|
@@ -190,15 +190,15 @@ class RNAalifoldApp(LocalApp):
|
|
|
190
190
|
covariance_energy : float
|
|
191
191
|
The energy of the covariance term.
|
|
192
192
|
|
|
193
|
+
See Also
|
|
194
|
+
--------
|
|
195
|
+
get_free_energy : Get the free energy.
|
|
196
|
+
|
|
193
197
|
Notes
|
|
194
198
|
-----
|
|
195
199
|
The total energy of the secondary structure regarding the
|
|
196
200
|
minimization objective is the sum of the free energy and the
|
|
197
201
|
covariance term.
|
|
198
|
-
|
|
199
|
-
See also
|
|
200
|
-
--------
|
|
201
|
-
get_free_energy
|
|
202
202
|
"""
|
|
203
203
|
return self._covariance_energy
|
|
204
204
|
|
|
@@ -99,8 +99,12 @@ class RNAplotApp(LocalApp):
|
|
|
99
99
|
self._in_file.write(self._dot_bracket)
|
|
100
100
|
self._in_file.flush()
|
|
101
101
|
self.set_arguments(
|
|
102
|
-
[
|
|
103
|
-
|
|
102
|
+
[
|
|
103
|
+
"-i", self._in_file.name,
|
|
104
|
+
"--output-format", "xrna",
|
|
105
|
+
"-t", self._layout_type,
|
|
106
|
+
]
|
|
107
|
+
) # fmt: skip
|
|
104
108
|
super().run()
|
|
105
109
|
|
|
106
110
|
def evaluate(self):
|
|
@@ -120,7 +124,7 @@ class RNAplotApp(LocalApp):
|
|
|
120
124
|
|
|
121
125
|
Parameters
|
|
122
126
|
----------
|
|
123
|
-
|
|
127
|
+
layout_type : RNAplotApp.Layout
|
|
124
128
|
The layout type.
|
|
125
129
|
"""
|
|
126
130
|
self._layout_type = str(layout_type)
|
|
@@ -181,6 +185,8 @@ class RNAplotApp(LocalApp):
|
|
|
181
185
|
length : int, optional (default: None)
|
|
182
186
|
The number of bases in the strand. This parameter is
|
|
183
187
|
required if ``base_pairs`` is given.
|
|
188
|
+
layout_type : Layout
|
|
189
|
+
The desired layout of the plot.
|
|
184
190
|
bin_path : str, optional
|
|
185
191
|
Path of the *RNAplot* binary.
|
|
186
192
|
|
biotite/application/webapp.py
CHANGED
|
@@ -29,7 +29,7 @@ class WebApp(Application, metaclass=abc.ABCMeta):
|
|
|
29
29
|
URL of the web app.
|
|
30
30
|
obey_rules : bool, optional
|
|
31
31
|
If true, the application raises an :class:`RuleViolationError`, if
|
|
32
|
-
the server rules are violated.
|
|
32
|
+
the server rules are violated.
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
35
|
def __init__(self, app_url, obey_rules=True):
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This source code is part of the Biotite package and is distributed
|
|
2
|
+
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
|
|
3
|
+
# information.
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
A subpackage for downloading predicted protein structures from the AlphaFold DB.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__name__ = "biotite.database.afdb"
|
|
10
|
+
__author__ = "Alex Carlin"
|
|
11
|
+
|
|
12
|
+
from .download import *
|