biotite 0.41.2__cp310-cp310-macosx_11_0_arm64.whl → 1.0.0__cp310-cp310-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.
- biotite/__init__.py +2 -3
- biotite/application/__init__.py +1 -1
- biotite/application/application.py +20 -10
- biotite/application/autodock/__init__.py +1 -1
- biotite/application/autodock/app.py +74 -79
- biotite/application/blast/__init__.py +1 -1
- biotite/application/blast/alignment.py +19 -10
- biotite/application/blast/webapp.py +92 -85
- biotite/application/clustalo/__init__.py +1 -1
- biotite/application/clustalo/app.py +46 -61
- biotite/application/dssp/__init__.py +1 -1
- biotite/application/dssp/app.py +8 -11
- biotite/application/localapp.py +62 -60
- biotite/application/mafft/__init__.py +1 -1
- biotite/application/mafft/app.py +16 -22
- biotite/application/msaapp.py +78 -89
- biotite/application/muscle/__init__.py +1 -1
- biotite/application/muscle/app3.py +50 -64
- biotite/application/muscle/app5.py +23 -31
- biotite/application/sra/__init__.py +1 -1
- biotite/application/sra/app.py +64 -68
- biotite/application/tantan/__init__.py +1 -1
- biotite/application/tantan/app.py +22 -45
- biotite/application/util.py +7 -9
- biotite/application/viennarna/rnaalifold.py +34 -28
- biotite/application/viennarna/rnafold.py +24 -39
- biotite/application/viennarna/rnaplot.py +36 -21
- biotite/application/viennarna/util.py +17 -12
- biotite/application/webapp.py +13 -14
- biotite/copyable.py +13 -13
- biotite/database/__init__.py +1 -1
- biotite/database/entrez/__init__.py +1 -1
- biotite/database/entrez/check.py +2 -3
- biotite/database/entrez/dbnames.py +7 -5
- biotite/database/entrez/download.py +55 -49
- biotite/database/entrez/key.py +1 -1
- biotite/database/entrez/query.py +62 -23
- biotite/database/error.py +2 -1
- biotite/database/pubchem/__init__.py +1 -1
- biotite/database/pubchem/download.py +43 -45
- biotite/database/pubchem/error.py +2 -2
- biotite/database/pubchem/query.py +34 -31
- biotite/database/pubchem/throttle.py +3 -4
- biotite/database/rcsb/__init__.py +1 -1
- biotite/database/rcsb/download.py +44 -52
- biotite/database/rcsb/query.py +85 -80
- biotite/database/uniprot/check.py +6 -3
- biotite/database/uniprot/download.py +6 -11
- biotite/database/uniprot/query.py +115 -31
- biotite/file.py +12 -31
- biotite/sequence/__init__.py +3 -3
- biotite/sequence/align/__init__.py +2 -2
- biotite/sequence/align/alignment.py +99 -90
- biotite/sequence/align/banded.cpython-310-darwin.so +0 -0
- biotite/sequence/align/buckets.py +12 -10
- biotite/sequence/align/cigar.py +43 -52
- biotite/sequence/align/kmeralphabet.cpython-310-darwin.so +0 -0
- biotite/sequence/align/kmeralphabet.pyx +55 -51
- biotite/sequence/align/kmersimilarity.cpython-310-darwin.so +0 -0
- biotite/sequence/align/kmertable.cpython-310-darwin.so +0 -0
- biotite/sequence/align/kmertable.pyx +3 -2
- biotite/sequence/align/localgapped.cpython-310-darwin.so +0 -0
- biotite/sequence/align/localungapped.cpython-310-darwin.so +0 -0
- biotite/sequence/align/matrix.py +81 -82
- biotite/sequence/align/multiple.cpython-310-darwin.so +0 -0
- biotite/sequence/align/multiple.pyx +1 -1
- biotite/sequence/align/pairwise.cpython-310-darwin.so +0 -0
- biotite/sequence/align/permutation.cpython-310-darwin.so +0 -0
- biotite/sequence/align/permutation.pyx +12 -4
- biotite/sequence/align/selector.cpython-310-darwin.so +0 -0
- biotite/sequence/align/selector.pyx +52 -54
- biotite/sequence/align/statistics.py +32 -33
- biotite/sequence/align/tracetable.cpython-310-darwin.so +0 -0
- biotite/sequence/alphabet.py +51 -65
- biotite/sequence/annotation.py +78 -77
- biotite/sequence/codec.cpython-310-darwin.so +0 -0
- biotite/sequence/codon.py +90 -79
- biotite/sequence/graphics/__init__.py +1 -1
- biotite/sequence/graphics/alignment.py +184 -103
- biotite/sequence/graphics/colorschemes.py +10 -12
- biotite/sequence/graphics/dendrogram.py +79 -34
- biotite/sequence/graphics/features.py +133 -99
- biotite/sequence/graphics/logo.py +22 -28
- biotite/sequence/graphics/plasmid.py +229 -178
- biotite/sequence/io/fasta/__init__.py +1 -1
- biotite/sequence/io/fasta/convert.py +44 -33
- biotite/sequence/io/fasta/file.py +42 -55
- biotite/sequence/io/fastq/__init__.py +1 -1
- biotite/sequence/io/fastq/convert.py +11 -14
- biotite/sequence/io/fastq/file.py +68 -112
- biotite/sequence/io/genbank/__init__.py +2 -2
- biotite/sequence/io/genbank/annotation.py +12 -20
- biotite/sequence/io/genbank/file.py +74 -76
- biotite/sequence/io/genbank/metadata.py +74 -62
- biotite/sequence/io/genbank/sequence.py +13 -14
- biotite/sequence/io/general.py +39 -30
- biotite/sequence/io/gff/__init__.py +2 -2
- biotite/sequence/io/gff/convert.py +10 -15
- biotite/sequence/io/gff/file.py +81 -65
- biotite/sequence/phylo/__init__.py +1 -1
- biotite/sequence/phylo/nj.cpython-310-darwin.so +0 -0
- biotite/sequence/phylo/tree.cpython-310-darwin.so +0 -0
- biotite/sequence/phylo/upgma.cpython-310-darwin.so +0 -0
- biotite/sequence/profile.py +57 -28
- biotite/sequence/search.py +17 -15
- biotite/sequence/seqtypes.py +200 -164
- biotite/sequence/sequence.py +15 -17
- biotite/structure/__init__.py +3 -3
- biotite/structure/atoms.py +221 -235
- biotite/structure/basepairs.py +260 -271
- biotite/structure/bonds.cpython-310-darwin.so +0 -0
- biotite/structure/bonds.pyx +29 -32
- biotite/structure/box.py +67 -71
- biotite/structure/celllist.cpython-310-darwin.so +0 -0
- biotite/structure/chains.py +55 -39
- biotite/structure/charges.cpython-310-darwin.so +0 -0
- biotite/structure/compare.py +32 -32
- biotite/structure/density.py +13 -18
- biotite/structure/dotbracket.py +20 -22
- biotite/structure/error.py +10 -2
- biotite/structure/filter.py +82 -77
- biotite/structure/geometry.py +130 -119
- biotite/structure/graphics/atoms.py +60 -43
- biotite/structure/graphics/rna.py +81 -68
- biotite/structure/hbond.py +112 -93
- biotite/structure/info/__init__.py +0 -2
- biotite/structure/info/atoms.py +10 -11
- biotite/structure/info/bonds.py +41 -43
- biotite/structure/info/ccd.py +4 -5
- biotite/structure/info/groups.py +1 -3
- biotite/structure/info/masses.py +5 -10
- biotite/structure/info/misc.py +1 -1
- biotite/structure/info/radii.py +20 -20
- biotite/structure/info/standardize.py +15 -26
- biotite/structure/integrity.py +18 -71
- biotite/structure/io/__init__.py +3 -4
- biotite/structure/io/dcd/__init__.py +1 -1
- biotite/structure/io/dcd/file.py +22 -20
- biotite/structure/io/general.py +47 -61
- biotite/structure/io/gro/__init__.py +1 -1
- biotite/structure/io/gro/file.py +73 -72
- biotite/structure/io/mol/__init__.py +1 -1
- biotite/structure/io/mol/convert.py +8 -11
- biotite/structure/io/mol/ctab.py +37 -36
- biotite/structure/io/mol/header.py +14 -10
- biotite/structure/io/mol/mol.py +9 -53
- biotite/structure/io/mol/sdf.py +47 -50
- biotite/structure/io/netcdf/__init__.py +1 -1
- biotite/structure/io/netcdf/file.py +24 -23
- biotite/structure/io/pdb/__init__.py +1 -1
- biotite/structure/io/pdb/convert.py +32 -20
- biotite/structure/io/pdb/file.py +151 -172
- biotite/structure/io/pdb/hybrid36.cpython-310-darwin.so +0 -0
- biotite/structure/io/pdbqt/__init__.py +1 -1
- biotite/structure/io/pdbqt/convert.py +17 -11
- biotite/structure/io/pdbqt/file.py +128 -80
- biotite/structure/io/pdbx/__init__.py +1 -2
- biotite/structure/io/pdbx/bcif.py +36 -44
- biotite/structure/io/pdbx/cif.py +64 -62
- biotite/structure/io/pdbx/component.py +10 -16
- biotite/structure/io/pdbx/convert.py +235 -246
- biotite/structure/io/pdbx/encoding.cpython-310-darwin.so +0 -0
- biotite/structure/io/trajfile.py +76 -93
- biotite/structure/io/trr/__init__.py +1 -1
- biotite/structure/io/trr/file.py +12 -15
- biotite/structure/io/xtc/__init__.py +1 -1
- biotite/structure/io/xtc/file.py +11 -14
- biotite/structure/mechanics.py +9 -11
- biotite/structure/molecules.py +3 -4
- biotite/structure/pseudoknots.py +53 -67
- biotite/structure/rdf.py +23 -21
- biotite/structure/repair.py +137 -86
- biotite/structure/residues.py +26 -16
- biotite/structure/sasa.cpython-310-darwin.so +0 -0
- biotite/structure/{resutil.py → segments.py} +24 -23
- biotite/structure/sequence.py +10 -11
- biotite/structure/sse.py +100 -119
- biotite/structure/superimpose.py +39 -77
- biotite/structure/transform.py +97 -71
- biotite/structure/util.py +11 -13
- biotite/version.py +2 -2
- biotite/visualize.py +69 -55
- {biotite-0.41.2.dist-info → biotite-1.0.0.dist-info}/METADATA +5 -5
- biotite-1.0.0.dist-info/RECORD +322 -0
- biotite/structure/io/ctab.py +0 -72
- biotite/structure/io/mmtf/__init__.py +0 -21
- biotite/structure/io/mmtf/assembly.py +0 -214
- biotite/structure/io/mmtf/convertarray.cpython-310-darwin.so +0 -0
- biotite/structure/io/mmtf/convertarray.pyx +0 -341
- biotite/structure/io/mmtf/convertfile.cpython-310-darwin.so +0 -0
- biotite/structure/io/mmtf/convertfile.pyx +0 -501
- biotite/structure/io/mmtf/decode.cpython-310-darwin.so +0 -0
- biotite/structure/io/mmtf/decode.pyx +0 -152
- biotite/structure/io/mmtf/encode.cpython-310-darwin.so +0 -0
- biotite/structure/io/mmtf/encode.pyx +0 -183
- biotite/structure/io/mmtf/file.py +0 -233
- biotite/structure/io/npz/__init__.py +0 -20
- biotite/structure/io/npz/file.py +0 -152
- biotite/structure/io/pdbx/legacy.py +0 -267
- biotite/structure/io/tng/__init__.py +0 -13
- biotite/structure/io/tng/file.py +0 -46
- biotite/temp.py +0 -86
- biotite-0.41.2.dist-info/RECORD +0 -340
- {biotite-0.41.2.dist-info → biotite-1.0.0.dist-info}/WHEEL +0 -0
- {biotite-0.41.2.dist-info → biotite-1.0.0.dist-info}/licenses/LICENSE.rst +0 -0
|
@@ -7,12 +7,9 @@ __author__ = "Patrick Kunzmann"
|
|
|
7
7
|
__all__ = ["plot_sequence_logo"]
|
|
8
8
|
|
|
9
9
|
import numpy as np
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from .
|
|
13
|
-
import warnings
|
|
14
|
-
from ..align import Alignment
|
|
15
|
-
from .. import SequenceProfile
|
|
10
|
+
from biotite.sequence.alphabet import LetterAlphabet
|
|
11
|
+
from biotite.sequence.graphics.colorschemes import get_color_scheme
|
|
12
|
+
from biotite.visualize import set_font_size_in_coord
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
def plot_sequence_logo(axes, profile, scheme=None, **kwargs):
|
|
@@ -36,41 +33,35 @@ def plot_sequence_logo(axes, profile, scheme=None, **kwargs):
|
|
|
36
33
|
The logo is created based on this profile.
|
|
37
34
|
scheme : str or list of (tuple or str)
|
|
38
35
|
Either a valid color scheme name
|
|
39
|
-
(e.g. ``"
|
|
36
|
+
(e.g. ``"flower"``, ``"clustalx"``, ``blossom``, etc.)
|
|
40
37
|
or a list of *Matplotlib* compatible colors.
|
|
41
38
|
The list length must be at least as long as the
|
|
42
39
|
length of the alphabet used by the `profile`.
|
|
43
40
|
**kwargs
|
|
44
41
|
Additional `text parameters <https://matplotlib.org/api/text_api.html#matplotlib.text.Text>`_.
|
|
45
|
-
|
|
42
|
+
|
|
46
43
|
References
|
|
47
44
|
----------
|
|
48
|
-
|
|
45
|
+
|
|
49
46
|
.. footbibliography::
|
|
50
47
|
"""
|
|
51
|
-
from matplotlib.text import Text
|
|
52
|
-
|
|
53
|
-
if isinstance(profile, Alignment):
|
|
54
|
-
warnings.warn("Using an alignment for this method is deprecated; use a profile instead", DeprecationWarning)
|
|
55
|
-
profile = SequenceProfile.from_alignment(profile)
|
|
56
|
-
|
|
57
48
|
alphabet = profile.alphabet
|
|
58
49
|
if not isinstance(alphabet, LetterAlphabet):
|
|
59
50
|
raise TypeError("The sequences' alphabet must be a letter alphabet")
|
|
60
51
|
|
|
61
52
|
if scheme is None:
|
|
62
|
-
colors = get_color_scheme("
|
|
53
|
+
colors = get_color_scheme("flower", alphabet)
|
|
63
54
|
elif isinstance(scheme, str):
|
|
64
55
|
colors = get_color_scheme(scheme, alphabet)
|
|
65
56
|
else:
|
|
66
57
|
colors = scheme
|
|
67
|
-
|
|
58
|
+
|
|
68
59
|
# 'color' and 'size' property is not passed on to text
|
|
69
60
|
kwargs.pop("color", None)
|
|
70
|
-
kwargs.pop("size",
|
|
71
|
-
|
|
61
|
+
kwargs.pop("size", None)
|
|
62
|
+
|
|
72
63
|
frequencies, entropies, max_entropy = _get_entropy(profile)
|
|
73
|
-
stack_heights =
|
|
64
|
+
stack_heights = max_entropy - entropies
|
|
74
65
|
symbols_heights = stack_heights[:, np.newaxis] * frequencies
|
|
75
66
|
index_order = np.argsort(symbols_heights, axis=1)
|
|
76
67
|
for i in range(symbols_heights.shape[0]):
|
|
@@ -79,21 +70,25 @@ def plot_sequence_logo(axes, profile, scheme=None, **kwargs):
|
|
|
79
70
|
start_height = 0
|
|
80
71
|
for j in index_order[i]:
|
|
81
72
|
# Stack the symbols at position on top of the preceeding one
|
|
82
|
-
height = symbols_heights[i,j]
|
|
73
|
+
height = symbols_heights[i, j]
|
|
83
74
|
if height > 0:
|
|
84
75
|
symbol = alphabet.decode(j)
|
|
85
76
|
text = axes.text(
|
|
86
|
-
i+0.5,
|
|
87
|
-
|
|
77
|
+
i + 0.5,
|
|
78
|
+
start_height,
|
|
79
|
+
symbol,
|
|
80
|
+
ha="left",
|
|
81
|
+
va="bottom",
|
|
82
|
+
color=colors[j],
|
|
88
83
|
# Best results are obtained with this font size
|
|
89
84
|
size=1,
|
|
90
|
-
**kwargs
|
|
85
|
+
**kwargs,
|
|
91
86
|
)
|
|
92
87
|
text.set_clip_on(True)
|
|
93
88
|
set_font_size_in_coord(text, width=1, height=height)
|
|
94
89
|
start_height += height
|
|
95
90
|
|
|
96
|
-
axes.set_xlim(0.5, len(profile.symbols)+0.5)
|
|
91
|
+
axes.set_xlim(0.5, len(profile.symbols) + 0.5)
|
|
97
92
|
axes.set_ylim(0, max_entropy)
|
|
98
93
|
|
|
99
94
|
|
|
@@ -103,8 +98,7 @@ def _get_entropy(profile):
|
|
|
103
98
|
# 0 * log2(0) = 0 -> Convert NaN to 0
|
|
104
99
|
no_zeros = freq != 0
|
|
105
100
|
pre_entropies = np.zeros(freq.shape)
|
|
106
|
-
pre_entropies[no_zeros]
|
|
107
|
-
= freq[no_zeros] * np.log2(freq[no_zeros])
|
|
101
|
+
pre_entropies[no_zeros] = freq[no_zeros] * np.log2(freq[no_zeros])
|
|
108
102
|
entropies = -np.sum(pre_entropies, axis=1)
|
|
109
103
|
max_entropy = np.log2(len(profile.alphabet))
|
|
110
|
-
return freq, entropies, max_entropy
|
|
104
|
+
return freq, entropies, max_entropy
|