biotite 0.41.1__cp312-cp312-macosx_10_16_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 +19 -0
- biotite/application/__init__.py +43 -0
- biotite/application/application.py +265 -0
- biotite/application/autodock/__init__.py +12 -0
- biotite/application/autodock/app.py +505 -0
- biotite/application/blast/__init__.py +14 -0
- biotite/application/blast/alignment.py +83 -0
- biotite/application/blast/webapp.py +421 -0
- biotite/application/clustalo/__init__.py +12 -0
- biotite/application/clustalo/app.py +238 -0
- biotite/application/dssp/__init__.py +12 -0
- biotite/application/dssp/app.py +152 -0
- biotite/application/localapp.py +306 -0
- biotite/application/mafft/__init__.py +12 -0
- biotite/application/mafft/app.py +122 -0
- biotite/application/msaapp.py +374 -0
- biotite/application/muscle/__init__.py +13 -0
- biotite/application/muscle/app3.py +254 -0
- biotite/application/muscle/app5.py +171 -0
- biotite/application/sra/__init__.py +18 -0
- biotite/application/sra/app.py +456 -0
- biotite/application/tantan/__init__.py +12 -0
- biotite/application/tantan/app.py +222 -0
- biotite/application/util.py +59 -0
- biotite/application/viennarna/__init__.py +18 -0
- biotite/application/viennarna/rnaalifold.py +304 -0
- biotite/application/viennarna/rnafold.py +269 -0
- biotite/application/viennarna/rnaplot.py +187 -0
- biotite/application/viennarna/util.py +72 -0
- biotite/application/webapp.py +77 -0
- biotite/copyable.py +71 -0
- biotite/database/__init__.py +23 -0
- biotite/database/entrez/__init__.py +15 -0
- biotite/database/entrez/check.py +61 -0
- biotite/database/entrez/dbnames.py +89 -0
- biotite/database/entrez/download.py +223 -0
- biotite/database/entrez/key.py +44 -0
- biotite/database/entrez/query.py +223 -0
- biotite/database/error.py +15 -0
- biotite/database/pubchem/__init__.py +21 -0
- biotite/database/pubchem/download.py +260 -0
- biotite/database/pubchem/error.py +20 -0
- biotite/database/pubchem/query.py +827 -0
- biotite/database/pubchem/throttle.py +99 -0
- biotite/database/rcsb/__init__.py +13 -0
- biotite/database/rcsb/download.py +167 -0
- biotite/database/rcsb/query.py +959 -0
- biotite/database/uniprot/__init__.py +13 -0
- biotite/database/uniprot/check.py +32 -0
- biotite/database/uniprot/download.py +134 -0
- biotite/database/uniprot/query.py +209 -0
- biotite/file.py +251 -0
- biotite/sequence/__init__.py +73 -0
- biotite/sequence/align/__init__.py +49 -0
- biotite/sequence/align/alignment.py +658 -0
- biotite/sequence/align/banded.cpython-312-darwin.so +0 -0
- biotite/sequence/align/banded.pyx +652 -0
- biotite/sequence/align/buckets.py +69 -0
- biotite/sequence/align/cigar.py +434 -0
- biotite/sequence/align/kmeralphabet.cpython-312-darwin.so +0 -0
- biotite/sequence/align/kmeralphabet.pyx +574 -0
- biotite/sequence/align/kmersimilarity.cpython-312-darwin.so +0 -0
- biotite/sequence/align/kmersimilarity.pyx +233 -0
- biotite/sequence/align/kmertable.cpython-312-darwin.so +0 -0
- biotite/sequence/align/kmertable.pyx +3400 -0
- biotite/sequence/align/localgapped.cpython-312-darwin.so +0 -0
- biotite/sequence/align/localgapped.pyx +892 -0
- biotite/sequence/align/localungapped.cpython-312-darwin.so +0 -0
- biotite/sequence/align/localungapped.pyx +279 -0
- biotite/sequence/align/matrix.py +405 -0
- biotite/sequence/align/matrix_data/BLOSUM100.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM30.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM35.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM40.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM45.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM50.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM50_13p.mat +25 -0
- biotite/sequence/align/matrix_data/BLOSUM50_14.3.mat +25 -0
- biotite/sequence/align/matrix_data/BLOSUM50_5.0.mat +25 -0
- biotite/sequence/align/matrix_data/BLOSUM55.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM60.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM62.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM62_13p.mat +25 -0
- biotite/sequence/align/matrix_data/BLOSUM62_14.3.mat +25 -0
- biotite/sequence/align/matrix_data/BLOSUM62_5.0.mat +25 -0
- biotite/sequence/align/matrix_data/BLOSUM65.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM70.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM75.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM80.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM85.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUM90.mat +31 -0
- biotite/sequence/align/matrix_data/BLOSUMN.mat +31 -0
- biotite/sequence/align/matrix_data/CorBLOSUM49_5.0.mat +25 -0
- biotite/sequence/align/matrix_data/CorBLOSUM57_13p.mat +25 -0
- biotite/sequence/align/matrix_data/CorBLOSUM57_14.3.mat +25 -0
- biotite/sequence/align/matrix_data/CorBLOSUM61_5.0.mat +25 -0
- biotite/sequence/align/matrix_data/CorBLOSUM66_13p.mat +25 -0
- biotite/sequence/align/matrix_data/CorBLOSUM67_14.3.mat +25 -0
- biotite/sequence/align/matrix_data/DAYHOFF.mat +32 -0
- biotite/sequence/align/matrix_data/GONNET.mat +26 -0
- biotite/sequence/align/matrix_data/IDENTITY.mat +25 -0
- biotite/sequence/align/matrix_data/MATCH.mat +25 -0
- biotite/sequence/align/matrix_data/NUC.mat +25 -0
- biotite/sequence/align/matrix_data/PAM10.mat +34 -0
- biotite/sequence/align/matrix_data/PAM100.mat +34 -0
- biotite/sequence/align/matrix_data/PAM110.mat +34 -0
- biotite/sequence/align/matrix_data/PAM120.mat +34 -0
- biotite/sequence/align/matrix_data/PAM130.mat +34 -0
- biotite/sequence/align/matrix_data/PAM140.mat +34 -0
- biotite/sequence/align/matrix_data/PAM150.mat +34 -0
- biotite/sequence/align/matrix_data/PAM160.mat +34 -0
- biotite/sequence/align/matrix_data/PAM170.mat +34 -0
- biotite/sequence/align/matrix_data/PAM180.mat +34 -0
- biotite/sequence/align/matrix_data/PAM190.mat +34 -0
- biotite/sequence/align/matrix_data/PAM20.mat +34 -0
- biotite/sequence/align/matrix_data/PAM200.mat +34 -0
- biotite/sequence/align/matrix_data/PAM210.mat +34 -0
- biotite/sequence/align/matrix_data/PAM220.mat +34 -0
- biotite/sequence/align/matrix_data/PAM230.mat +34 -0
- biotite/sequence/align/matrix_data/PAM240.mat +34 -0
- biotite/sequence/align/matrix_data/PAM250.mat +34 -0
- biotite/sequence/align/matrix_data/PAM260.mat +34 -0
- biotite/sequence/align/matrix_data/PAM270.mat +34 -0
- biotite/sequence/align/matrix_data/PAM280.mat +34 -0
- biotite/sequence/align/matrix_data/PAM290.mat +34 -0
- biotite/sequence/align/matrix_data/PAM30.mat +34 -0
- biotite/sequence/align/matrix_data/PAM300.mat +34 -0
- biotite/sequence/align/matrix_data/PAM310.mat +34 -0
- biotite/sequence/align/matrix_data/PAM320.mat +34 -0
- biotite/sequence/align/matrix_data/PAM330.mat +34 -0
- biotite/sequence/align/matrix_data/PAM340.mat +34 -0
- biotite/sequence/align/matrix_data/PAM350.mat +34 -0
- biotite/sequence/align/matrix_data/PAM360.mat +34 -0
- biotite/sequence/align/matrix_data/PAM370.mat +34 -0
- biotite/sequence/align/matrix_data/PAM380.mat +34 -0
- biotite/sequence/align/matrix_data/PAM390.mat +34 -0
- biotite/sequence/align/matrix_data/PAM40.mat +34 -0
- biotite/sequence/align/matrix_data/PAM400.mat +34 -0
- biotite/sequence/align/matrix_data/PAM410.mat +34 -0
- biotite/sequence/align/matrix_data/PAM420.mat +34 -0
- biotite/sequence/align/matrix_data/PAM430.mat +34 -0
- biotite/sequence/align/matrix_data/PAM440.mat +34 -0
- biotite/sequence/align/matrix_data/PAM450.mat +34 -0
- biotite/sequence/align/matrix_data/PAM460.mat +34 -0
- biotite/sequence/align/matrix_data/PAM470.mat +34 -0
- biotite/sequence/align/matrix_data/PAM480.mat +34 -0
- biotite/sequence/align/matrix_data/PAM490.mat +34 -0
- biotite/sequence/align/matrix_data/PAM50.mat +34 -0
- biotite/sequence/align/matrix_data/PAM500.mat +34 -0
- biotite/sequence/align/matrix_data/PAM60.mat +34 -0
- biotite/sequence/align/matrix_data/PAM70.mat +34 -0
- biotite/sequence/align/matrix_data/PAM80.mat +34 -0
- biotite/sequence/align/matrix_data/PAM90.mat +34 -0
- biotite/sequence/align/matrix_data/RBLOSUM52_5.0.mat +25 -0
- biotite/sequence/align/matrix_data/RBLOSUM59_13p.mat +25 -0
- biotite/sequence/align/matrix_data/RBLOSUM59_14.3.mat +25 -0
- biotite/sequence/align/matrix_data/RBLOSUM64_5.0.mat +25 -0
- biotite/sequence/align/matrix_data/RBLOSUM69_13p.mat +25 -0
- biotite/sequence/align/matrix_data/RBLOSUM69_14.3.mat +25 -0
- biotite/sequence/align/multiple.cpython-312-darwin.so +0 -0
- biotite/sequence/align/multiple.pyx +620 -0
- biotite/sequence/align/pairwise.cpython-312-darwin.so +0 -0
- biotite/sequence/align/pairwise.pyx +587 -0
- biotite/sequence/align/permutation.cpython-312-darwin.so +0 -0
- biotite/sequence/align/permutation.pyx +305 -0
- biotite/sequence/align/primes.txt +821 -0
- biotite/sequence/align/selector.cpython-312-darwin.so +0 -0
- biotite/sequence/align/selector.pyx +956 -0
- biotite/sequence/align/statistics.py +265 -0
- biotite/sequence/align/tracetable.cpython-312-darwin.so +0 -0
- biotite/sequence/align/tracetable.pxd +64 -0
- biotite/sequence/align/tracetable.pyx +370 -0
- biotite/sequence/alphabet.py +566 -0
- biotite/sequence/annotation.py +829 -0
- biotite/sequence/codec.cpython-312-darwin.so +0 -0
- biotite/sequence/codec.pyx +155 -0
- biotite/sequence/codon.py +466 -0
- biotite/sequence/codon_tables.txt +202 -0
- biotite/sequence/graphics/__init__.py +33 -0
- biotite/sequence/graphics/alignment.py +1034 -0
- biotite/sequence/graphics/color_schemes/autumn.json +51 -0
- biotite/sequence/graphics/color_schemes/blossom.json +51 -0
- biotite/sequence/graphics/color_schemes/clustalx_dna.json +11 -0
- biotite/sequence/graphics/color_schemes/clustalx_protein.json +28 -0
- biotite/sequence/graphics/color_schemes/flower.json +51 -0
- biotite/sequence/graphics/color_schemes/jalview_buried.json +31 -0
- biotite/sequence/graphics/color_schemes/jalview_hydrophobicity.json +31 -0
- biotite/sequence/graphics/color_schemes/jalview_prop_helix.json +31 -0
- biotite/sequence/graphics/color_schemes/jalview_prop_strand.json +31 -0
- biotite/sequence/graphics/color_schemes/jalview_prop_turn.json +31 -0
- biotite/sequence/graphics/color_schemes/jalview_taylor.json +28 -0
- biotite/sequence/graphics/color_schemes/jalview_zappo.json +28 -0
- biotite/sequence/graphics/color_schemes/ocean.json +51 -0
- biotite/sequence/graphics/color_schemes/pb_flower.json +39 -0
- biotite/sequence/graphics/color_schemes/rainbow_dna.json +11 -0
- biotite/sequence/graphics/color_schemes/rainbow_protein.json +30 -0
- biotite/sequence/graphics/color_schemes/spring.json +51 -0
- biotite/sequence/graphics/color_schemes/sunset.json +51 -0
- biotite/sequence/graphics/color_schemes/wither.json +51 -0
- biotite/sequence/graphics/colorschemes.py +139 -0
- biotite/sequence/graphics/dendrogram.py +184 -0
- biotite/sequence/graphics/features.py +510 -0
- biotite/sequence/graphics/logo.py +110 -0
- biotite/sequence/graphics/plasmid.py +661 -0
- biotite/sequence/io/__init__.py +12 -0
- biotite/sequence/io/fasta/__init__.py +22 -0
- biotite/sequence/io/fasta/convert.py +273 -0
- biotite/sequence/io/fasta/file.py +278 -0
- biotite/sequence/io/fastq/__init__.py +19 -0
- biotite/sequence/io/fastq/convert.py +120 -0
- biotite/sequence/io/fastq/file.py +551 -0
- biotite/sequence/io/genbank/__init__.py +17 -0
- biotite/sequence/io/genbank/annotation.py +277 -0
- biotite/sequence/io/genbank/file.py +575 -0
- biotite/sequence/io/genbank/metadata.py +324 -0
- biotite/sequence/io/genbank/sequence.py +172 -0
- biotite/sequence/io/general.py +192 -0
- biotite/sequence/io/gff/__init__.py +26 -0
- biotite/sequence/io/gff/convert.py +133 -0
- biotite/sequence/io/gff/file.py +434 -0
- biotite/sequence/phylo/__init__.py +36 -0
- biotite/sequence/phylo/nj.cpython-312-darwin.so +0 -0
- biotite/sequence/phylo/nj.pyx +221 -0
- biotite/sequence/phylo/tree.cpython-312-darwin.so +0 -0
- biotite/sequence/phylo/tree.pyx +1169 -0
- biotite/sequence/phylo/upgma.cpython-312-darwin.so +0 -0
- biotite/sequence/phylo/upgma.pyx +164 -0
- biotite/sequence/profile.py +456 -0
- biotite/sequence/search.py +116 -0
- biotite/sequence/seqtypes.py +556 -0
- biotite/sequence/sequence.py +374 -0
- biotite/structure/__init__.py +132 -0
- biotite/structure/atoms.py +1455 -0
- biotite/structure/basepairs.py +1415 -0
- biotite/structure/bonds.cpython-312-darwin.so +0 -0
- biotite/structure/bonds.pyx +1933 -0
- biotite/structure/box.py +592 -0
- biotite/structure/celllist.cpython-312-darwin.so +0 -0
- biotite/structure/celllist.pyx +849 -0
- biotite/structure/chains.py +298 -0
- biotite/structure/charges.cpython-312-darwin.so +0 -0
- biotite/structure/charges.pyx +520 -0
- biotite/structure/compare.py +274 -0
- biotite/structure/density.py +114 -0
- biotite/structure/dotbracket.py +216 -0
- biotite/structure/error.py +31 -0
- biotite/structure/filter.py +585 -0
- biotite/structure/geometry.py +697 -0
- biotite/structure/graphics/__init__.py +13 -0
- biotite/structure/graphics/atoms.py +226 -0
- biotite/structure/graphics/rna.py +282 -0
- biotite/structure/hbond.py +409 -0
- biotite/structure/info/__init__.py +25 -0
- biotite/structure/info/atom_masses.json +121 -0
- biotite/structure/info/atoms.py +82 -0
- biotite/structure/info/bonds.py +145 -0
- biotite/structure/info/ccd/README.rst +8 -0
- biotite/structure/info/ccd/amino_acids.txt +1663 -0
- biotite/structure/info/ccd/carbohydrates.txt +1135 -0
- biotite/structure/info/ccd/components.bcif +0 -0
- biotite/structure/info/ccd/nucleotides.txt +798 -0
- biotite/structure/info/ccd.py +95 -0
- biotite/structure/info/groups.py +90 -0
- biotite/structure/info/masses.py +123 -0
- biotite/structure/info/misc.py +144 -0
- biotite/structure/info/radii.py +197 -0
- biotite/structure/info/standardize.py +196 -0
- biotite/structure/integrity.py +268 -0
- biotite/structure/io/__init__.py +30 -0
- biotite/structure/io/ctab.py +72 -0
- biotite/structure/io/dcd/__init__.py +13 -0
- biotite/structure/io/dcd/file.py +65 -0
- biotite/structure/io/general.py +257 -0
- biotite/structure/io/gro/__init__.py +14 -0
- biotite/structure/io/gro/file.py +343 -0
- biotite/structure/io/mmtf/__init__.py +21 -0
- biotite/structure/io/mmtf/assembly.py +214 -0
- biotite/structure/io/mmtf/convertarray.cpython-312-darwin.so +0 -0
- biotite/structure/io/mmtf/convertarray.pyx +341 -0
- biotite/structure/io/mmtf/convertfile.cpython-312-darwin.so +0 -0
- biotite/structure/io/mmtf/convertfile.pyx +501 -0
- biotite/structure/io/mmtf/decode.cpython-312-darwin.so +0 -0
- biotite/structure/io/mmtf/decode.pyx +152 -0
- biotite/structure/io/mmtf/encode.cpython-312-darwin.so +0 -0
- biotite/structure/io/mmtf/encode.pyx +183 -0
- biotite/structure/io/mmtf/file.py +233 -0
- biotite/structure/io/mol/__init__.py +20 -0
- biotite/structure/io/mol/convert.py +115 -0
- biotite/structure/io/mol/ctab.py +414 -0
- biotite/structure/io/mol/header.py +116 -0
- biotite/structure/io/mol/mol.py +193 -0
- biotite/structure/io/mol/sdf.py +916 -0
- biotite/structure/io/netcdf/__init__.py +13 -0
- biotite/structure/io/netcdf/file.py +63 -0
- biotite/structure/io/npz/__init__.py +20 -0
- biotite/structure/io/npz/file.py +152 -0
- biotite/structure/io/pdb/__init__.py +20 -0
- biotite/structure/io/pdb/convert.py +293 -0
- biotite/structure/io/pdb/file.py +1240 -0
- biotite/structure/io/pdb/hybrid36.cpython-312-darwin.so +0 -0
- biotite/structure/io/pdb/hybrid36.pyx +242 -0
- biotite/structure/io/pdbqt/__init__.py +15 -0
- biotite/structure/io/pdbqt/convert.py +107 -0
- biotite/structure/io/pdbqt/file.py +640 -0
- biotite/structure/io/pdbx/__init__.py +23 -0
- biotite/structure/io/pdbx/bcif.py +648 -0
- biotite/structure/io/pdbx/cif.py +1032 -0
- biotite/structure/io/pdbx/component.py +246 -0
- biotite/structure/io/pdbx/convert.py +1597 -0
- biotite/structure/io/pdbx/encoding.cpython-312-darwin.so +0 -0
- biotite/structure/io/pdbx/encoding.pyx +950 -0
- biotite/structure/io/pdbx/legacy.py +267 -0
- biotite/structure/io/tng/__init__.py +13 -0
- biotite/structure/io/tng/file.py +46 -0
- biotite/structure/io/trajfile.py +710 -0
- biotite/structure/io/trr/__init__.py +13 -0
- biotite/structure/io/trr/file.py +46 -0
- biotite/structure/io/xtc/__init__.py +13 -0
- biotite/structure/io/xtc/file.py +46 -0
- biotite/structure/mechanics.py +75 -0
- biotite/structure/molecules.py +353 -0
- biotite/structure/pseudoknots.py +642 -0
- biotite/structure/rdf.py +243 -0
- biotite/structure/repair.py +253 -0
- biotite/structure/residues.py +562 -0
- biotite/structure/resutil.py +178 -0
- biotite/structure/sasa.cpython-312-darwin.so +0 -0
- biotite/structure/sasa.pyx +322 -0
- biotite/structure/sequence.py +112 -0
- biotite/structure/sse.py +327 -0
- biotite/structure/superimpose.py +727 -0
- biotite/structure/transform.py +504 -0
- biotite/structure/util.py +98 -0
- biotite/temp.py +86 -0
- biotite/version.py +16 -0
- biotite/visualize.py +251 -0
- biotite-0.41.1.dist-info/METADATA +187 -0
- biotite-0.41.1.dist-info/RECORD +340 -0
- biotite-0.41.1.dist-info/WHEEL +4 -0
- biotite-0.41.1.dist-info/licenses/LICENSE.rst +30 -0
biotite/visualize.py
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
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
|
+
__name__ = "biotite"
|
|
6
|
+
__author__ = "Patrick Kunzmann"
|
|
7
|
+
__all__ = ["colors", "set_font_size_in_coord", "AdaptiveFancyArrow"]
|
|
8
|
+
|
|
9
|
+
import abc
|
|
10
|
+
from collections import OrderedDict
|
|
11
|
+
import numpy as np
|
|
12
|
+
from numpy.linalg import norm
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Biotite themed colors
|
|
16
|
+
colors = OrderedDict([
|
|
17
|
+
("brightorange" , "#ffb569ff"),
|
|
18
|
+
("lightorange" , "#ff982dff"),
|
|
19
|
+
("orange" , "#ff8405ff"),
|
|
20
|
+
("dimorange" , "#dc7000ff"),
|
|
21
|
+
("darkorange" , "#b45c00ff"),
|
|
22
|
+
("brightgreen" , "#98e97fff"),
|
|
23
|
+
("lightgreen" , "#6fe04cff"),
|
|
24
|
+
("green" , "#52da2aff"),
|
|
25
|
+
("dimgreen" , "#45bc20ff"),
|
|
26
|
+
("darkgreen" , "#389a1aff"),
|
|
27
|
+
])
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def set_font_size_in_coord(text, width=None, height=None, mode="unlocked"):
|
|
31
|
+
"""
|
|
32
|
+
Specifiy the font size of an existing `Text` object in coordinates
|
|
33
|
+
of the object's reference coordiante system.
|
|
34
|
+
|
|
35
|
+
Instead of having the font size fixed in 'pt', the size of the text
|
|
36
|
+
scales to the specied width/height and adapts to changes in the
|
|
37
|
+
plot's width/height.
|
|
38
|
+
The scaling can be proportional or non-proportional, depending
|
|
39
|
+
the `mode`.
|
|
40
|
+
|
|
41
|
+
Parameters
|
|
42
|
+
----------
|
|
43
|
+
text : Text:
|
|
44
|
+
The matplotlib `Text` to be scaled.
|
|
45
|
+
width, height : float, optional
|
|
46
|
+
The new width/height of `text` in its
|
|
47
|
+
reference coordinate system.
|
|
48
|
+
At least one value must be supplied.
|
|
49
|
+
mode : {'proportional', 'unlocked', 'maximum', 'minimum'}, optional
|
|
50
|
+
The scaling mode:
|
|
51
|
+
|
|
52
|
+
- *proportional* - The width and height are scaled by the
|
|
53
|
+
same extent.
|
|
54
|
+
Either `width` or `height` must be set for this mode.
|
|
55
|
+
- *unlocked* - The width and the height are scaled by
|
|
56
|
+
different extents, changing the aspect ratio.
|
|
57
|
+
Both `width` and `height` must be set for this mode.
|
|
58
|
+
- *maximum* - The width and the height are scaled by
|
|
59
|
+
the same extent, so that they are at maximum as large
|
|
60
|
+
as the supplied `width`/`height`.
|
|
61
|
+
Both `width` and `height` must be set for this mode.
|
|
62
|
+
- *minimum* - The width and the height are scaled by
|
|
63
|
+
the same extent, so that they are at minimum as large
|
|
64
|
+
as the supplied `width`/`height`.
|
|
65
|
+
Both `width` and `height` must be set for this mode.
|
|
66
|
+
|
|
67
|
+
Notes
|
|
68
|
+
-----
|
|
69
|
+
This function uses the :func:`get_window_extent()` method of the
|
|
70
|
+
:class:`Text` object.
|
|
71
|
+
According to experience, this function does not give the the exact
|
|
72
|
+
visual boundaries of the text.
|
|
73
|
+
Consequently, the scaled text might be slightly smaller or larger
|
|
74
|
+
than the specified width/height.
|
|
75
|
+
This behavior is not equal for all initial font sizes (in 'pt'),
|
|
76
|
+
the boundaries for an initial size of 1 'pt' seem to be most exact.
|
|
77
|
+
"""
|
|
78
|
+
from matplotlib.transforms import Bbox, Affine2D
|
|
79
|
+
from matplotlib.patheffects import AbstractPathEffect
|
|
80
|
+
|
|
81
|
+
class TextScaler(AbstractPathEffect):
|
|
82
|
+
def __init__(self, text, width, height, mode):
|
|
83
|
+
self._text = text
|
|
84
|
+
self._mode = mode
|
|
85
|
+
self._width = width
|
|
86
|
+
self._height = height
|
|
87
|
+
|
|
88
|
+
def draw_path(self, renderer, gc, tpath, affine, rgbFace=None):
|
|
89
|
+
ax = self._text.axes
|
|
90
|
+
try:
|
|
91
|
+
renderer = ax.get_figure().canvas.get_renderer()
|
|
92
|
+
except:
|
|
93
|
+
# Use cached renderer for backends, where
|
|
94
|
+
# `get_renderer()` is not available
|
|
95
|
+
# Based on the strategy from `Text.get_window_extent()`
|
|
96
|
+
renderer = ax.get_figure()._cachedRenderer
|
|
97
|
+
if renderer is None:
|
|
98
|
+
raise
|
|
99
|
+
bbox = text.get_window_extent(renderer)
|
|
100
|
+
bbox = Bbox(ax.transData.inverted().transform(bbox))
|
|
101
|
+
|
|
102
|
+
if self._mode == "proportional":
|
|
103
|
+
if self._width is None:
|
|
104
|
+
# Proportional scaling based on height
|
|
105
|
+
scale_y = self._height / bbox.height
|
|
106
|
+
scale_x = scale_y
|
|
107
|
+
elif self._height is None:
|
|
108
|
+
# Proportional scaling based on width
|
|
109
|
+
scale_x = self._width / bbox.width
|
|
110
|
+
scale_y = scale_x
|
|
111
|
+
elif self._mode == "unlocked":
|
|
112
|
+
scale_x = self._width / bbox.width
|
|
113
|
+
scale_y = self._height / bbox.height
|
|
114
|
+
elif self._mode == "minimum":
|
|
115
|
+
scale_x = self._width / bbox.width
|
|
116
|
+
scale_y = self._height / bbox.height
|
|
117
|
+
scale = max(scale_x, scale_y)
|
|
118
|
+
scale_x, scale_y = scale, scale
|
|
119
|
+
elif self._mode == "maximum":
|
|
120
|
+
scale_x = self._width / bbox.width
|
|
121
|
+
scale_y = self._height / bbox.height
|
|
122
|
+
scale = min(scale_x, scale_y)
|
|
123
|
+
scale_x, scale_y = scale, scale
|
|
124
|
+
|
|
125
|
+
affine = Affine2D().scale(scale_x, scale_y) + affine
|
|
126
|
+
renderer.draw_path(gc, tpath, affine, rgbFace)
|
|
127
|
+
|
|
128
|
+
if mode in ["unlocked", "minimum", "maximum"]:
|
|
129
|
+
if width is None or height is None:
|
|
130
|
+
raise TypeError(
|
|
131
|
+
f"Width and height must be set in '{mode}' mode"
|
|
132
|
+
)
|
|
133
|
+
elif mode == "proportional":
|
|
134
|
+
if not (width is None and height is not None) or \
|
|
135
|
+
not (height is None and width is not None):
|
|
136
|
+
raise TypeError(
|
|
137
|
+
f"Either width or height must be set in '{mode}' mode"
|
|
138
|
+
)
|
|
139
|
+
else:
|
|
140
|
+
raise ValueError(
|
|
141
|
+
f"Unknown mode '{mode}'"
|
|
142
|
+
)
|
|
143
|
+
text.set_path_effects([TextScaler(text, width, height, mode)])
|
|
144
|
+
|
|
145
|
+
try:
|
|
146
|
+
# Only create this class when matplotlib is installed
|
|
147
|
+
from matplotlib.transforms import Bbox
|
|
148
|
+
from matplotlib.patches import FancyArrow
|
|
149
|
+
|
|
150
|
+
class AdaptiveFancyArrow(FancyArrow):
|
|
151
|
+
"""
|
|
152
|
+
A `FancyArrow` with fixed head shape.
|
|
153
|
+
|
|
154
|
+
The length of the head is proportional to the width of the head
|
|
155
|
+
in display coordinates.
|
|
156
|
+
If the head length is longer than the length of the entire
|
|
157
|
+
arrow, the head length is limited to the arrow length.
|
|
158
|
+
|
|
159
|
+
Parameters
|
|
160
|
+
----------
|
|
161
|
+
x,y : float
|
|
162
|
+
The arrow's start position.
|
|
163
|
+
dx, dy : float
|
|
164
|
+
The arrow's direction vector, inclduing the arrow head.
|
|
165
|
+
tail_width, head_width : float
|
|
166
|
+
The width of the arrow's tail and head in its reference
|
|
167
|
+
coordinate system
|
|
168
|
+
head_ratio : float, optional
|
|
169
|
+
The length of the arrow head as faction of the arrow width
|
|
170
|
+
(display coordinates).
|
|
171
|
+
draw_head: bool, optional
|
|
172
|
+
If false, the arrow has no head. The result is a rectangle.
|
|
173
|
+
shape : str, optional
|
|
174
|
+
The `shape` parameter in the constructor of `FancyArrow`.
|
|
175
|
+
**kwargs
|
|
176
|
+
Other parameters that are used in the constructor of
|
|
177
|
+
`FancyArrow`.
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
def __init__(self, x, y, dx, dy,
|
|
181
|
+
tail_width, head_width, head_ratio, draw_head=True,
|
|
182
|
+
shape="full", **kwargs):
|
|
183
|
+
self._x = x
|
|
184
|
+
self._y = y
|
|
185
|
+
self._dx = dx
|
|
186
|
+
self._dy = dy
|
|
187
|
+
self._tail_width = tail_width
|
|
188
|
+
self._head_width = head_width
|
|
189
|
+
self._head_ratio = head_ratio
|
|
190
|
+
self._draw_head = draw_head
|
|
191
|
+
self._shape = shape
|
|
192
|
+
self._kwargs = kwargs
|
|
193
|
+
if not draw_head:
|
|
194
|
+
head_width = tail_width
|
|
195
|
+
super().__init__(
|
|
196
|
+
x, y, dx, dy,
|
|
197
|
+
width=tail_width, head_width=head_width,
|
|
198
|
+
overhang=0, shape=shape,
|
|
199
|
+
length_includes_head=True, **kwargs
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
def draw(self, renderer):
|
|
203
|
+
arrow_box = Bbox([(0,0), (0,self._head_width)])
|
|
204
|
+
arrow_box_display = self.axes.transData.transform_bbox(arrow_box)
|
|
205
|
+
head_length_display = np.abs(
|
|
206
|
+
arrow_box_display.height * self._head_ratio
|
|
207
|
+
)
|
|
208
|
+
arrow_box_display.x1 = arrow_box_display.x0 + head_length_display
|
|
209
|
+
# Transfrom back to data coordinates for plotting
|
|
210
|
+
arrow_box = self.axes.transData.inverted().transform_bbox(
|
|
211
|
+
arrow_box_display
|
|
212
|
+
)
|
|
213
|
+
head_length = arrow_box.width
|
|
214
|
+
arrow_length = norm((self._dx, self._dy))
|
|
215
|
+
if head_length > arrow_length:
|
|
216
|
+
# If the head would be longer than the entire arrow,
|
|
217
|
+
# only draw the arrow head with reduced length
|
|
218
|
+
head_length = arrow_length
|
|
219
|
+
if not self._draw_head:
|
|
220
|
+
head_length = 0
|
|
221
|
+
|
|
222
|
+
# Renew the arrow's properties
|
|
223
|
+
super().__init__(
|
|
224
|
+
self._x, self._y, self._dx, self._dy,
|
|
225
|
+
width=self._tail_width, head_width=self._head_width,
|
|
226
|
+
overhang=0, shape=self._shape,
|
|
227
|
+
head_length=head_length, length_includes_head=True,
|
|
228
|
+
axes=self.axes, transform=self.get_transform(), **self._kwargs
|
|
229
|
+
)
|
|
230
|
+
self.set_clip_path(self.axes.patch)
|
|
231
|
+
super().draw(renderer)
|
|
232
|
+
|
|
233
|
+
# Override to replace docstring
|
|
234
|
+
# Removes warning:
|
|
235
|
+
# unknown document: /tutorials/intermediate/constrainedlayout_guide
|
|
236
|
+
def get_in_layout(self):
|
|
237
|
+
"""
|
|
238
|
+
"""
|
|
239
|
+
return super().get_in_layout()
|
|
240
|
+
def set_in_layout(self, in_layout):
|
|
241
|
+
"""
|
|
242
|
+
"""
|
|
243
|
+
return super().set_in_layout(in_layout)
|
|
244
|
+
|
|
245
|
+
except ImportError:
|
|
246
|
+
|
|
247
|
+
# Dummy class that propagates a meaningful error,
|
|
248
|
+
# i.e. that Matplotlib is not installed
|
|
249
|
+
class AdaptiveFancyArrow():
|
|
250
|
+
def __init__(*args, **kwargs):
|
|
251
|
+
raise ModuleNotFoundError(f"No module named 'matplotlib'")
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: biotite
|
|
3
|
+
Version: 0.41.1
|
|
4
|
+
Summary: A comprehensive library for computational molecular biology
|
|
5
|
+
Project-URL: homepage, https://www.biotite-python.org
|
|
6
|
+
Project-URL: repository, https://github.com/biotite-dev/biotite
|
|
7
|
+
Project-URL: documentation, https://www.biotite-python.org
|
|
8
|
+
Author: The Biotite contributors
|
|
9
|
+
License: BSD 3-Clause License
|
|
10
|
+
--------------------
|
|
11
|
+
|
|
12
|
+
Copyright 2017, The Biotite contributors
|
|
13
|
+
All rights reserved.
|
|
14
|
+
|
|
15
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
16
|
+
are permitted provided that the following conditions are met:
|
|
17
|
+
|
|
18
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
19
|
+
list of conditions and the following disclaimer.
|
|
20
|
+
|
|
21
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
22
|
+
this list of conditions and the following disclaimer in the documentation and/or
|
|
23
|
+
other materials provided with the distribution.
|
|
24
|
+
|
|
25
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
26
|
+
may be used to endorse or promote products derived from this software without
|
|
27
|
+
specific prior written permission.
|
|
28
|
+
|
|
29
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
30
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
31
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
32
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
33
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
34
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
35
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
36
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
37
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
38
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
39
|
+
License-File: LICENSE.rst
|
|
40
|
+
Classifier: Development Status :: 4 - Beta
|
|
41
|
+
Classifier: Intended Audience :: Developers
|
|
42
|
+
Classifier: Intended Audience :: Science/Research
|
|
43
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
44
|
+
Classifier: Natural Language :: English
|
|
45
|
+
Classifier: Operating System :: MacOS
|
|
46
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
47
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
48
|
+
Classifier: Programming Language :: Python :: 3
|
|
49
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
50
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
51
|
+
Requires-Python: >=3.10
|
|
52
|
+
Requires-Dist: msgpack>=0.5.6
|
|
53
|
+
Requires-Dist: networkx>=2.0
|
|
54
|
+
Requires-Dist: numpy<2.0,>=1.14.5
|
|
55
|
+
Requires-Dist: requests>=2.12
|
|
56
|
+
Provides-Extra: test
|
|
57
|
+
Requires-Dist: pytest; extra == 'test'
|
|
58
|
+
Description-Content-Type: text/x-rst
|
|
59
|
+
|
|
60
|
+
.. image:: https://img.shields.io/pypi/v/biotite.svg
|
|
61
|
+
:target: https://pypi.python.org/pypi/biotite
|
|
62
|
+
:alt: Biotite at PyPI
|
|
63
|
+
.. image:: https://img.shields.io/pypi/pyversions/biotite.svg
|
|
64
|
+
:alt: Python version
|
|
65
|
+
.. image:: https://github.com/biotite-dev/biotite/actions/workflows/test_and_deploy.yml/badge.svg
|
|
66
|
+
:target: https://github.com/biotite-dev/biotite/actions/workflows/test_and_deploy.yml
|
|
67
|
+
:alt: Test status
|
|
68
|
+
|
|
69
|
+
.. image:: https://www.biotite-python.org/_static/assets/general/biotite_logo_m.png
|
|
70
|
+
:alt: The Biotite Project
|
|
71
|
+
|
|
72
|
+
Biotite project
|
|
73
|
+
===============
|
|
74
|
+
|
|
75
|
+
*Biotite* is your Swiss army knife for bioinformatics.
|
|
76
|
+
Whether you want to identify homologous sequence regions in a protein family
|
|
77
|
+
or you would like to find disulfide bonds in a protein structure: *Biotite*
|
|
78
|
+
has the right tool for you.
|
|
79
|
+
This package bundles popular tasks in computational molecular biology
|
|
80
|
+
into a uniform *Python* library.
|
|
81
|
+
It can handle a major part of the typical workflow
|
|
82
|
+
for sequence and biomolecular structure data:
|
|
83
|
+
|
|
84
|
+
- Searching and fetching data from biological databases
|
|
85
|
+
- Reading and writing popular sequence/structure file formats
|
|
86
|
+
- Analyzing and editing sequence/structure data
|
|
87
|
+
- Visualizing sequence/structure data
|
|
88
|
+
- Interfacing external applications for further analysis
|
|
89
|
+
|
|
90
|
+
*Biotite* internally stores most of the data as *NumPy* `ndarray` objects,
|
|
91
|
+
enabling
|
|
92
|
+
|
|
93
|
+
- fast C-accelerated analysis,
|
|
94
|
+
- intuitive usability through *NumPy*-like indexing syntax,
|
|
95
|
+
- extensibility through direct access of the internal *NumPy* arrays.
|
|
96
|
+
|
|
97
|
+
As a result the user can skip writing code for basic functionality (like
|
|
98
|
+
file parsers) and can focus on what their code makes unique - from
|
|
99
|
+
small analysis scripts to entire bioinformatics software packages.
|
|
100
|
+
|
|
101
|
+
If you use *Biotite* in a scientific publication, please cite:
|
|
102
|
+
|
|
103
|
+
| Kunzmann, P. & Hamacher, K. BMC Bioinformatics (2018) 19:346.
|
|
104
|
+
| `<https://doi.org/10.1186/s12859-018-2367-z>`_
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
Installation
|
|
108
|
+
------------
|
|
109
|
+
|
|
110
|
+
*Biotite* requires the following packages:
|
|
111
|
+
|
|
112
|
+
- **numpy**
|
|
113
|
+
- **requests**
|
|
114
|
+
- **msgpack**
|
|
115
|
+
- **networkx**
|
|
116
|
+
|
|
117
|
+
Some functions require some extra packages:
|
|
118
|
+
|
|
119
|
+
- **mdtraj** - Required for trajetory file I/O operations.
|
|
120
|
+
- **matplotlib** - Required for plotting purposes.
|
|
121
|
+
|
|
122
|
+
*Biotite* can be installed via *Conda*...
|
|
123
|
+
|
|
124
|
+
.. code-block:: console
|
|
125
|
+
|
|
126
|
+
$ conda install -c conda-forge biotite
|
|
127
|
+
|
|
128
|
+
... or *pip*
|
|
129
|
+
|
|
130
|
+
.. code-block:: console
|
|
131
|
+
|
|
132
|
+
$ pip install biotite
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
Usage
|
|
136
|
+
-----
|
|
137
|
+
|
|
138
|
+
Here is a small example that downloads two protein sequences from the
|
|
139
|
+
*NCBI Entrez* database and aligns them:
|
|
140
|
+
|
|
141
|
+
.. code-block:: python
|
|
142
|
+
|
|
143
|
+
import biotite.sequence.align as align
|
|
144
|
+
import biotite.sequence.io.fasta as fasta
|
|
145
|
+
import biotite.database.entrez as entrez
|
|
146
|
+
|
|
147
|
+
# Download FASTA file for the sequences of avidin and streptavidin
|
|
148
|
+
file_name = entrez.fetch_single_file(
|
|
149
|
+
uids=["CAC34569", "ACL82594"], file_name="sequences.fasta",
|
|
150
|
+
db_name="protein", ret_type="fasta"
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
# Parse the downloaded FASTA file
|
|
154
|
+
# and create 'ProteinSequence' objects from it
|
|
155
|
+
fasta_file = fasta.FastaFile.read(file_name)
|
|
156
|
+
avidin_seq, streptavidin_seq = fasta.get_sequences(fasta_file).values()
|
|
157
|
+
|
|
158
|
+
# Align sequences using the BLOSUM62 matrix with affine gap penalty
|
|
159
|
+
matrix = align.SubstitutionMatrix.std_protein_matrix()
|
|
160
|
+
alignments = align.align_optimal(
|
|
161
|
+
avidin_seq, streptavidin_seq, matrix,
|
|
162
|
+
gap_penalty=(-10, -1), terminal_penalty=False
|
|
163
|
+
)
|
|
164
|
+
print(alignments[0])
|
|
165
|
+
|
|
166
|
+
.. code-block::
|
|
167
|
+
|
|
168
|
+
MVHATSPLLLLLLLSLALVAPGLSAR------KCSLTGKWDNDLGSNMTIGAVNSKGEFTGTYTTAV-TA
|
|
169
|
+
-------------------DPSKESKAQAAVAEAGITGTWYNQLGSTFIVTA-NPDGSLTGTYESAVGNA
|
|
170
|
+
|
|
171
|
+
TSNEIKESPLHGTQNTINKRTQPTFGFTVNWKFS----ESTTVFTGQCFIDRNGKEV-LKTMWLLRSSVN
|
|
172
|
+
ESRYVLTGRYDSTPATDGSGT--ALGWTVAWKNNYRNAHSATTWSGQYV---GGAEARINTQWLLTSGTT
|
|
173
|
+
|
|
174
|
+
DIGDDWKATRVGINIFTRLRTQKE---------------------
|
|
175
|
+
-AANAWKSTLVGHDTFTKVKPSAASIDAAKKAGVNNGNPLDAVQQ
|
|
176
|
+
|
|
177
|
+
More documentation, including a tutorial, an example gallery and the API
|
|
178
|
+
reference is available at `<https://www.biotite-python.org/>`_.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
Contribution
|
|
182
|
+
------------
|
|
183
|
+
|
|
184
|
+
Interested in improving *Biotite*?
|
|
185
|
+
Have a look at the
|
|
186
|
+
`contribution guidelines <https://www.biotite-python.org/contribute.html>`_.
|
|
187
|
+
Feel free to join or community chat on `Discord <https://discord.gg/cUjDguF>`_.
|