biotite 1.5.0__cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_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.
Potentially problematic release.
This version of biotite might be problematic. Click here for more details.
- biotite/__init__.py +18 -0
- biotite/application/__init__.py +69 -0
- biotite/application/application.py +276 -0
- biotite/application/autodock/__init__.py +12 -0
- biotite/application/autodock/app.py +500 -0
- biotite/application/blast/__init__.py +14 -0
- biotite/application/blast/alignment.py +92 -0
- biotite/application/blast/webapp.py +428 -0
- biotite/application/clustalo/__init__.py +12 -0
- biotite/application/clustalo/app.py +223 -0
- biotite/application/dssp/__init__.py +12 -0
- biotite/application/dssp/app.py +216 -0
- biotite/application/localapp.py +342 -0
- biotite/application/mafft/__init__.py +12 -0
- biotite/application/mafft/app.py +116 -0
- biotite/application/msaapp.py +363 -0
- biotite/application/muscle/__init__.py +13 -0
- biotite/application/muscle/app3.py +227 -0
- biotite/application/muscle/app5.py +163 -0
- biotite/application/sra/__init__.py +18 -0
- biotite/application/sra/app.py +447 -0
- biotite/application/tantan/__init__.py +12 -0
- biotite/application/tantan/app.py +199 -0
- biotite/application/util.py +77 -0
- biotite/application/viennarna/__init__.py +18 -0
- biotite/application/viennarna/rnaalifold.py +310 -0
- biotite/application/viennarna/rnafold.py +254 -0
- biotite/application/viennarna/rnaplot.py +208 -0
- biotite/application/viennarna/util.py +77 -0
- biotite/application/webapp.py +76 -0
- biotite/copyable.py +71 -0
- biotite/database/__init__.py +23 -0
- biotite/database/afdb/__init__.py +12 -0
- biotite/database/afdb/download.py +197 -0
- biotite/database/entrez/__init__.py +15 -0
- biotite/database/entrez/check.py +60 -0
- biotite/database/entrez/dbnames.py +101 -0
- biotite/database/entrez/download.py +228 -0
- biotite/database/entrez/key.py +44 -0
- biotite/database/entrez/query.py +263 -0
- biotite/database/error.py +16 -0
- biotite/database/pubchem/__init__.py +21 -0
- biotite/database/pubchem/download.py +258 -0
- biotite/database/pubchem/error.py +30 -0
- biotite/database/pubchem/query.py +819 -0
- biotite/database/pubchem/throttle.py +98 -0
- biotite/database/rcsb/__init__.py +13 -0
- biotite/database/rcsb/download.py +161 -0
- biotite/database/rcsb/query.py +963 -0
- biotite/database/uniprot/__init__.py +13 -0
- biotite/database/uniprot/check.py +40 -0
- biotite/database/uniprot/download.py +126 -0
- biotite/database/uniprot/query.py +292 -0
- biotite/file.py +244 -0
- biotite/interface/__init__.py +19 -0
- biotite/interface/openmm/__init__.py +20 -0
- biotite/interface/openmm/state.py +93 -0
- biotite/interface/openmm/system.py +227 -0
- biotite/interface/pymol/__init__.py +201 -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 +1228 -0
- biotite/interface/pymol/shapes.py +178 -0
- biotite/interface/pymol/startup.py +169 -0
- biotite/interface/rdkit/__init__.py +19 -0
- biotite/interface/rdkit/mol.py +490 -0
- biotite/interface/version.py +94 -0
- biotite/interface/warning.py +19 -0
- biotite/sequence/__init__.py +84 -0
- biotite/sequence/align/__init__.py +199 -0
- biotite/sequence/align/alignment.py +702 -0
- biotite/sequence/align/banded.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/banded.pyx +652 -0
- biotite/sequence/align/buckets.py +71 -0
- biotite/sequence/align/cigar.py +425 -0
- biotite/sequence/align/kmeralphabet.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/kmeralphabet.pyx +595 -0
- biotite/sequence/align/kmersimilarity.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/kmersimilarity.pyx +233 -0
- biotite/sequence/align/kmertable.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/kmertable.pyx +3411 -0
- biotite/sequence/align/localgapped.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/localgapped.pyx +892 -0
- biotite/sequence/align/localungapped.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/localungapped.pyx +279 -0
- biotite/sequence/align/matrix.py +631 -0
- biotite/sequence/align/matrix_data/3Di.mat +24 -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/PB.license +21 -0
- biotite/sequence/align/matrix_data/PB.mat +18 -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-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/multiple.pyx +619 -0
- biotite/sequence/align/pairwise.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/pairwise.pyx +585 -0
- biotite/sequence/align/permutation.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/permutation.pyx +313 -0
- biotite/sequence/align/primes.txt +821 -0
- biotite/sequence/align/selector.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/selector.pyx +954 -0
- biotite/sequence/align/statistics.py +264 -0
- biotite/sequence/align/tracetable.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/align/tracetable.pxd +64 -0
- biotite/sequence/align/tracetable.pyx +370 -0
- biotite/sequence/alphabet.py +555 -0
- biotite/sequence/annotation.py +836 -0
- biotite/sequence/codec.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/codec.pyx +155 -0
- biotite/sequence/codon.py +476 -0
- biotite/sequence/codon_tables.txt +202 -0
- biotite/sequence/graphics/__init__.py +33 -0
- biotite/sequence/graphics/alignment.py +1101 -0
- biotite/sequence/graphics/color_schemes/3di_flower.json +48 -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 +40 -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 +170 -0
- biotite/sequence/graphics/dendrogram.py +231 -0
- biotite/sequence/graphics/features.py +544 -0
- biotite/sequence/graphics/logo.py +102 -0
- biotite/sequence/graphics/plasmid.py +712 -0
- biotite/sequence/io/__init__.py +12 -0
- biotite/sequence/io/fasta/__init__.py +22 -0
- biotite/sequence/io/fasta/convert.py +283 -0
- biotite/sequence/io/fasta/file.py +265 -0
- biotite/sequence/io/fastq/__init__.py +19 -0
- biotite/sequence/io/fastq/convert.py +117 -0
- biotite/sequence/io/fastq/file.py +507 -0
- biotite/sequence/io/genbank/__init__.py +17 -0
- biotite/sequence/io/genbank/annotation.py +269 -0
- biotite/sequence/io/genbank/file.py +573 -0
- biotite/sequence/io/genbank/metadata.py +336 -0
- biotite/sequence/io/genbank/sequence.py +173 -0
- biotite/sequence/io/general.py +201 -0
- biotite/sequence/io/gff/__init__.py +26 -0
- biotite/sequence/io/gff/convert.py +128 -0
- biotite/sequence/io/gff/file.py +449 -0
- biotite/sequence/phylo/__init__.py +36 -0
- biotite/sequence/phylo/nj.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/phylo/nj.pyx +221 -0
- biotite/sequence/phylo/tree.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/phylo/tree.pyx +1169 -0
- biotite/sequence/phylo/upgma.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/sequence/phylo/upgma.pyx +164 -0
- biotite/sequence/profile.py +561 -0
- biotite/sequence/search.py +117 -0
- biotite/sequence/seqtypes.py +720 -0
- biotite/sequence/sequence.py +373 -0
- biotite/setup_ccd.py +197 -0
- biotite/structure/__init__.py +135 -0
- 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 +1562 -0
- biotite/structure/basepairs.py +1403 -0
- biotite/structure/bonds.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/structure/bonds.pyx +2036 -0
- biotite/structure/box.py +724 -0
- biotite/structure/celllist.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/structure/celllist.pyx +864 -0
- biotite/structure/chains.py +310 -0
- biotite/structure/charges.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/structure/charges.pyx +520 -0
- biotite/structure/compare.py +683 -0
- biotite/structure/density.py +109 -0
- biotite/structure/dotbracket.py +213 -0
- biotite/structure/error.py +39 -0
- biotite/structure/filter.py +591 -0
- biotite/structure/geometry.py +817 -0
- biotite/structure/graphics/__init__.py +13 -0
- biotite/structure/graphics/atoms.py +243 -0
- biotite/structure/graphics/rna.py +298 -0
- biotite/structure/hbond.py +425 -0
- biotite/structure/info/__init__.py +24 -0
- biotite/structure/info/atom_masses.json +121 -0
- biotite/structure/info/atoms.py +98 -0
- biotite/structure/info/bonds.py +149 -0
- biotite/structure/info/ccd.py +200 -0
- biotite/structure/info/components.bcif +0 -0
- biotite/structure/info/groups.py +128 -0
- biotite/structure/info/masses.py +121 -0
- biotite/structure/info/misc.py +137 -0
- biotite/structure/info/radii.py +267 -0
- biotite/structure/info/standardize.py +185 -0
- biotite/structure/integrity.py +213 -0
- biotite/structure/io/__init__.py +29 -0
- biotite/structure/io/dcd/__init__.py +13 -0
- biotite/structure/io/dcd/file.py +67 -0
- biotite/structure/io/general.py +243 -0
- biotite/structure/io/gro/__init__.py +14 -0
- biotite/structure/io/gro/file.py +343 -0
- biotite/structure/io/mol/__init__.py +20 -0
- biotite/structure/io/mol/convert.py +112 -0
- biotite/structure/io/mol/ctab.py +420 -0
- biotite/structure/io/mol/header.py +120 -0
- biotite/structure/io/mol/mol.py +149 -0
- biotite/structure/io/mol/sdf.py +940 -0
- biotite/structure/io/netcdf/__init__.py +13 -0
- biotite/structure/io/netcdf/file.py +64 -0
- biotite/structure/io/pdb/__init__.py +20 -0
- biotite/structure/io/pdb/convert.py +389 -0
- biotite/structure/io/pdb/file.py +1380 -0
- biotite/structure/io/pdb/hybrid36.cpython-311-x86_64-linux-gnu.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 +113 -0
- biotite/structure/io/pdbqt/file.py +688 -0
- biotite/structure/io/pdbx/__init__.py +23 -0
- biotite/structure/io/pdbx/bcif.py +674 -0
- biotite/structure/io/pdbx/cif.py +1091 -0
- biotite/structure/io/pdbx/component.py +251 -0
- biotite/structure/io/pdbx/compress.py +362 -0
- biotite/structure/io/pdbx/convert.py +2113 -0
- biotite/structure/io/pdbx/encoding.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/structure/io/pdbx/encoding.pyx +1078 -0
- biotite/structure/io/trajfile.py +696 -0
- biotite/structure/io/trr/__init__.py +13 -0
- biotite/structure/io/trr/file.py +43 -0
- biotite/structure/io/util.py +38 -0
- biotite/structure/io/xtc/__init__.py +13 -0
- biotite/structure/io/xtc/file.py +43 -0
- biotite/structure/mechanics.py +72 -0
- biotite/structure/molecules.py +337 -0
- biotite/structure/pseudoknots.py +622 -0
- biotite/structure/rdf.py +245 -0
- biotite/structure/repair.py +302 -0
- biotite/structure/residues.py +716 -0
- biotite/structure/rings.py +451 -0
- biotite/structure/sasa.cpython-311-x86_64-linux-gnu.so +0 -0
- biotite/structure/sasa.pyx +322 -0
- biotite/structure/segments.py +328 -0
- biotite/structure/sequence.py +110 -0
- biotite/structure/spacegroups.json +1567 -0
- biotite/structure/spacegroups.license +26 -0
- biotite/structure/sse.py +306 -0
- biotite/structure/superimpose.py +511 -0
- biotite/structure/tm.py +581 -0
- biotite/structure/transform.py +736 -0
- biotite/structure/util.py +160 -0
- biotite/version.py +34 -0
- biotite/visualize.py +375 -0
- biotite-1.5.0.dist-info/METADATA +162 -0
- biotite-1.5.0.dist-info/RECORD +354 -0
- biotite-1.5.0.dist-info/WHEEL +6 -0
- biotite-1.5.0.dist-info/licenses/LICENSE.rst +30 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
__name__ = "biotite.interface.pymol"
|
|
2
|
+
__author__ = "Patrick Kunzmann"
|
|
3
|
+
__all__ = ["draw_arrows", "draw_box"]
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
from biotite.interface.pymol.cgo import (
|
|
7
|
+
_arrayfy,
|
|
8
|
+
draw_cgo,
|
|
9
|
+
get_cone_cgo,
|
|
10
|
+
get_cylinder_cgo,
|
|
11
|
+
get_multiline_cgo,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def draw_arrows(
|
|
16
|
+
start,
|
|
17
|
+
end,
|
|
18
|
+
radius=0.1,
|
|
19
|
+
head_radius=0.20,
|
|
20
|
+
head_length=0.5,
|
|
21
|
+
color=(0.5, 0.5, 0.5),
|
|
22
|
+
head_color=None,
|
|
23
|
+
name=None,
|
|
24
|
+
pymol_instance=None,
|
|
25
|
+
delete=True,
|
|
26
|
+
):
|
|
27
|
+
"""
|
|
28
|
+
Draw three-dimensional arrows using *Compiled Graphics Objects* (CGOs).
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
start, end : array-like, shape=(n,3)
|
|
33
|
+
The start and end position of each arrow.
|
|
34
|
+
radius, head_radius : float or array-like, shape=(n,), optional
|
|
35
|
+
The radius of the tail and head for each arrow.
|
|
36
|
+
Uniform for all arrows, if a single value is given.
|
|
37
|
+
head_length : float or array-like, shape=(n,), optional
|
|
38
|
+
The length of each arrow head.
|
|
39
|
+
Uniform for all arrows, if a single value is given.
|
|
40
|
+
color, head_color : array-like, shape=(3,) or shape=(n,3), optional
|
|
41
|
+
The color of the tail and head for each arrow, given as RGB
|
|
42
|
+
values in the range *(0, 1)*.
|
|
43
|
+
Uniform for all arrows, if a single value is given.
|
|
44
|
+
If no `head_color` is given, the arrows are single-colored.
|
|
45
|
+
name : str, optional
|
|
46
|
+
The name of the newly created CGO object.
|
|
47
|
+
If omitted, a unique name is generated.
|
|
48
|
+
pymol_instance : module or SingletonPyMOL or PyMOL, optional
|
|
49
|
+
If *PyMOL* is used in library mode, the :class:`PyMOL`
|
|
50
|
+
or :class:`SingletonPyMOL` object is given here.
|
|
51
|
+
If otherwise *PyMOL* is used in GUI mode, the :mod:`pymol`
|
|
52
|
+
module is given.
|
|
53
|
+
By default the currently active *PyMOL* instance is used.
|
|
54
|
+
If no *PyMOL* instance is currently running,
|
|
55
|
+
*PyMOL* is started in library mode.
|
|
56
|
+
delete : bool, optional
|
|
57
|
+
If set to true, the underlying *PyMOL* object will be removed from the *PyMOL*
|
|
58
|
+
session, when the returned :class:`PyMOLObject` is garbage collected.
|
|
59
|
+
|
|
60
|
+
Returns
|
|
61
|
+
-------
|
|
62
|
+
pymol_object : PyMOLObject
|
|
63
|
+
The created :class:`PyMOLObject` representing the drawn CGOs.
|
|
64
|
+
"""
|
|
65
|
+
if head_color is None:
|
|
66
|
+
head_color = color
|
|
67
|
+
|
|
68
|
+
start = np.asarray(start)
|
|
69
|
+
end = np.asarray(end)
|
|
70
|
+
if start.ndim != 2 or end.ndim != 2:
|
|
71
|
+
raise IndexError("Expected 2D array for start and end positions")
|
|
72
|
+
if len(start) != len(end):
|
|
73
|
+
raise IndexError(
|
|
74
|
+
f"Got {len(start)} start positions, but expected {len(end)} end positions"
|
|
75
|
+
)
|
|
76
|
+
expected_length = len(start)
|
|
77
|
+
radius = _arrayfy(radius, expected_length, 1)
|
|
78
|
+
head_radius = _arrayfy(head_radius, expected_length, 1)
|
|
79
|
+
head_length = _arrayfy(head_length, expected_length, 1)
|
|
80
|
+
color = _arrayfy(color, expected_length, 2)
|
|
81
|
+
head_color = _arrayfy(head_color, expected_length, 2)
|
|
82
|
+
|
|
83
|
+
normal = (end - start) / np.linalg.norm(end - start, axis=-1)[:, np.newaxis]
|
|
84
|
+
middle = end - normal * head_length[:, np.newaxis]
|
|
85
|
+
|
|
86
|
+
cgo_list = []
|
|
87
|
+
for i in range(len(start)):
|
|
88
|
+
cgo_list.extend(
|
|
89
|
+
[
|
|
90
|
+
get_cylinder_cgo(start[i], middle[i], radius[i], color[i], color[i]),
|
|
91
|
+
get_cone_cgo(
|
|
92
|
+
middle[i],
|
|
93
|
+
end[i],
|
|
94
|
+
head_radius[i],
|
|
95
|
+
0.0,
|
|
96
|
+
head_color[i],
|
|
97
|
+
head_color[i],
|
|
98
|
+
True,
|
|
99
|
+
False,
|
|
100
|
+
),
|
|
101
|
+
]
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
return draw_cgo(cgo_list, name, pymol_instance, delete)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def draw_box(
|
|
108
|
+
box,
|
|
109
|
+
color=(0, 1, 0),
|
|
110
|
+
width=1.0,
|
|
111
|
+
origin=None,
|
|
112
|
+
name=None,
|
|
113
|
+
pymol_instance=None,
|
|
114
|
+
delete=True,
|
|
115
|
+
):
|
|
116
|
+
"""
|
|
117
|
+
Draw a box using *Compiled Graphics Objects* (CGOs).
|
|
118
|
+
|
|
119
|
+
This can be used to draw the unit cell or periodic box of an
|
|
120
|
+
:class:`AtomArray`.
|
|
121
|
+
|
|
122
|
+
Parameters
|
|
123
|
+
----------
|
|
124
|
+
box : array-like, shape=(3,3)
|
|
125
|
+
The three box vectors.
|
|
126
|
+
color : array-like, shape=(3,), optional
|
|
127
|
+
The color of the box, given as RGB
|
|
128
|
+
values in the range *(0, 1)*.
|
|
129
|
+
width : float, optional
|
|
130
|
+
The width of the drawn lines.
|
|
131
|
+
origin : array-like, shape=(3,), optional
|
|
132
|
+
If given the box origin is drawn at the given position instead of the
|
|
133
|
+
coordinate origin.
|
|
134
|
+
name : str, optional
|
|
135
|
+
The name of the newly created CGO object.
|
|
136
|
+
If omitted, a unique name is generated.
|
|
137
|
+
pymol_instance : module or SingletonPyMOL or PyMOL, optional
|
|
138
|
+
If *PyMOL* is used in library mode, the :class:`PyMOL`
|
|
139
|
+
or :class:`SingletonPyMOL` object is given here.
|
|
140
|
+
If otherwise *PyMOL* is used in GUI mode, the :mod:`pymol`
|
|
141
|
+
module is given.
|
|
142
|
+
By default the currently active *PyMOL* instance is used.
|
|
143
|
+
If no *PyMOL* instance is currently running,
|
|
144
|
+
*PyMOL* is started in library mode.
|
|
145
|
+
delete : bool, optional
|
|
146
|
+
If set to true, the underlying *PyMOL* object will be removed from the *PyMOL*
|
|
147
|
+
session, when the returned :class:`PyMOLObject` is garbage collected.
|
|
148
|
+
|
|
149
|
+
Returns
|
|
150
|
+
-------
|
|
151
|
+
pymol_object : PyMOLObject
|
|
152
|
+
The created :class:`PyMOLObject` representing the drawn CGOs.
|
|
153
|
+
"""
|
|
154
|
+
box = np.asarray(box)
|
|
155
|
+
if origin is None:
|
|
156
|
+
origin = np.zeros(3)
|
|
157
|
+
else:
|
|
158
|
+
origin = np.asarray(origin)
|
|
159
|
+
|
|
160
|
+
starts = []
|
|
161
|
+
ends = []
|
|
162
|
+
for direction_dim in (0, 1, 2):
|
|
163
|
+
plane_dim1, plane_dim2 = [dim for dim in (0, 1, 2) if dim != direction_dim]
|
|
164
|
+
starts.append(origin)
|
|
165
|
+
ends.append(origin + box[direction_dim])
|
|
166
|
+
|
|
167
|
+
starts.append(origin + box[plane_dim1])
|
|
168
|
+
ends.append(origin + box[plane_dim1] + box[direction_dim])
|
|
169
|
+
|
|
170
|
+
starts.append(origin + box[plane_dim2])
|
|
171
|
+
ends.append(origin + box[plane_dim2] + box[direction_dim])
|
|
172
|
+
|
|
173
|
+
starts.append(origin + box[plane_dim1] + box[plane_dim2])
|
|
174
|
+
ends.append(origin + box[plane_dim1] + box[plane_dim2] + box[direction_dim])
|
|
175
|
+
|
|
176
|
+
return draw_cgo(
|
|
177
|
+
[get_multiline_cgo(starts, ends, color, width)], name, pymol_instance, delete
|
|
178
|
+
)
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
__name__ = "biotite.interface.pymol"
|
|
2
|
+
__author__ = "Patrick Kunzmann"
|
|
3
|
+
__all__ = [
|
|
4
|
+
"get_and_set_pymol_instance",
|
|
5
|
+
"launch_pymol",
|
|
6
|
+
"launch_interactive_pymol",
|
|
7
|
+
"reset",
|
|
8
|
+
"setup_parameters",
|
|
9
|
+
"DuplicatePyMOLError",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_pymol = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def get_and_set_pymol_instance(pymol_instance=None):
|
|
17
|
+
"""
|
|
18
|
+
Get the global *PyMOL* instance.
|
|
19
|
+
|
|
20
|
+
This function is intended for internal purposes and should only be
|
|
21
|
+
used for advanced usages.
|
|
22
|
+
|
|
23
|
+
Parameters
|
|
24
|
+
----------
|
|
25
|
+
pymol_instance : module or PyMOL, optional
|
|
26
|
+
If a ``PyMOL`` instance is given here, the global instance is set
|
|
27
|
+
to this instance.
|
|
28
|
+
If *PyMOL* is already running and both instances are not the
|
|
29
|
+
same, an exception is raised.
|
|
30
|
+
By default *PyMOL* is started in library mode, if no *PyMOL*
|
|
31
|
+
instance is currently running.
|
|
32
|
+
|
|
33
|
+
Returns
|
|
34
|
+
-------
|
|
35
|
+
pymol_instance : module or PyMOL
|
|
36
|
+
The global ``pymol`` instance.
|
|
37
|
+
"""
|
|
38
|
+
global _pymol
|
|
39
|
+
if pymol_instance is None:
|
|
40
|
+
if not is_launched():
|
|
41
|
+
_pymol = launch_pymol()
|
|
42
|
+
return _pymol
|
|
43
|
+
elif _pymol is None:
|
|
44
|
+
if not hasattr(pymol_instance, "cmd"):
|
|
45
|
+
raise TypeError("Given object is not a PyMOL instance")
|
|
46
|
+
_pymol = pymol_instance
|
|
47
|
+
elif _pymol is not pymol_instance:
|
|
48
|
+
# Both the global pymol instance and the given instance are not
|
|
49
|
+
# the same -> duplicate PyMOL instances
|
|
50
|
+
raise DuplicatePyMOLError("A PyMOL instance is already running")
|
|
51
|
+
return _pymol
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def is_launched():
|
|
55
|
+
"""
|
|
56
|
+
Check whether a *PyMOL* session is already running.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
running : bool
|
|
61
|
+
True, if a *PyMOL* instance is already running, false otherwise.
|
|
62
|
+
"""
|
|
63
|
+
return _pymol is not None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def launch_pymol():
|
|
67
|
+
"""
|
|
68
|
+
Launch *PyMOL* in object-oriented library mode.
|
|
69
|
+
|
|
70
|
+
This is the recommended way to launch *PyMOL* if no GUI is
|
|
71
|
+
required.
|
|
72
|
+
This function simply creates a :class:`PymMOL` object,
|
|
73
|
+
calls its :func:`start()` method and sets up necessary parameters using
|
|
74
|
+
:func:`setup_parameters()`.
|
|
75
|
+
|
|
76
|
+
Returns
|
|
77
|
+
-------
|
|
78
|
+
pymol : PyMOL
|
|
79
|
+
The started *PyMOL* instance.
|
|
80
|
+
*PyMOL* commands can be invoked by using its :attr:`cmd` attribute.
|
|
81
|
+
"""
|
|
82
|
+
from pymol2 import PyMOL
|
|
83
|
+
|
|
84
|
+
global _pymol
|
|
85
|
+
|
|
86
|
+
if is_launched():
|
|
87
|
+
raise DuplicatePyMOLError("A PyMOL instance is already running")
|
|
88
|
+
else:
|
|
89
|
+
_pymol = PyMOL()
|
|
90
|
+
_pymol.start()
|
|
91
|
+
setup_parameters(_pymol)
|
|
92
|
+
return _pymol
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def launch_interactive_pymol(*args):
|
|
96
|
+
"""
|
|
97
|
+
Launch a *PyMOL* GUI with the given command line arguments.
|
|
98
|
+
|
|
99
|
+
It starts *PyMOL* by calling :func:`pymol.finish_launching()`,
|
|
100
|
+
reinitializes *PyMOL* to clear the workspace and sets up necessary
|
|
101
|
+
parameters using :func:`setup_parameters()`.
|
|
102
|
+
|
|
103
|
+
Parameters
|
|
104
|
+
----------
|
|
105
|
+
*args : str
|
|
106
|
+
The command line options given to *PyMOL*.
|
|
107
|
+
|
|
108
|
+
Returns
|
|
109
|
+
-------
|
|
110
|
+
pymol : module
|
|
111
|
+
The :mod:`pymol` module.
|
|
112
|
+
*PyMOL* commands can be invoked by using its :attr:`cmd`
|
|
113
|
+
attribute.
|
|
114
|
+
"""
|
|
115
|
+
import pymol
|
|
116
|
+
|
|
117
|
+
global _pymol
|
|
118
|
+
|
|
119
|
+
if is_launched():
|
|
120
|
+
if _pymol is not pymol:
|
|
121
|
+
raise DuplicatePyMOLError("PyMOL is already running in library mode")
|
|
122
|
+
else:
|
|
123
|
+
raise DuplicatePyMOLError("A PyMOL instance is already running")
|
|
124
|
+
else:
|
|
125
|
+
pymol.finish_launching(["pymol"] + list(args))
|
|
126
|
+
_pymol = pymol
|
|
127
|
+
pymol.cmd.reinitialize()
|
|
128
|
+
setup_parameters(_pymol)
|
|
129
|
+
return pymol
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def reset():
|
|
133
|
+
"""
|
|
134
|
+
Delete all objects in the PyMOL workspace and reset parameters to
|
|
135
|
+
defaults.
|
|
136
|
+
|
|
137
|
+
If *PyMOL* is not yet running, launch *PyMOL* in object-oriented
|
|
138
|
+
library mode.
|
|
139
|
+
"""
|
|
140
|
+
global _pymol
|
|
141
|
+
|
|
142
|
+
if not is_launched():
|
|
143
|
+
_pymol = launch_pymol()
|
|
144
|
+
_pymol.cmd.reinitialize()
|
|
145
|
+
setup_parameters(_pymol)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def setup_parameters(pymol_instance):
|
|
149
|
+
"""
|
|
150
|
+
Sets *PyMOL* parameters that are necessary for *Biotite* to interact
|
|
151
|
+
properly with *PyMOL*.
|
|
152
|
+
|
|
153
|
+
Parameters
|
|
154
|
+
----------
|
|
155
|
+
pymol_instance : module or SingletonPyMOL or PyMOL, optional
|
|
156
|
+
If *PyMOL* is used in library mode, the :class:`PyMOL`
|
|
157
|
+
or :class:`SingletonPyMOL` object is given here.
|
|
158
|
+
If otherwise *PyMOL* is used in GUI mode, the :mod:`pymol`
|
|
159
|
+
module is given.
|
|
160
|
+
"""
|
|
161
|
+
# The selections only work properly,
|
|
162
|
+
# if the order stays the same after adding a model to PyMOL
|
|
163
|
+
pymol_instance.cmd.set("retain_order", 1)
|
|
164
|
+
# Mute the PyMOL messages when rendering movies
|
|
165
|
+
pymol_instance.cmd.feedback("disable", "movie", "everything")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class DuplicatePyMOLError(Exception):
|
|
169
|
+
pass
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
This subpackage provides an interface to the `RDKit <https://www.rdkit.org/>`_
|
|
7
|
+
cheminformatics package.
|
|
8
|
+
It allows conversion between :class:`.AtomArray` and :class:`rdkit.Chem.rdchem.Mol`
|
|
9
|
+
objects.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
__name__ = "biotite.interface.rdkit"
|
|
13
|
+
__author__ = "Patrick Kunzmann"
|
|
14
|
+
|
|
15
|
+
from biotite.interface.version import require_package
|
|
16
|
+
|
|
17
|
+
require_package("rdkit")
|
|
18
|
+
|
|
19
|
+
from .mol import *
|