biotite 1.0.1__cp311-cp311-win_amd64.whl → 1.2.0__cp311-cp311-win_amd64.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/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.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/banded.pyx +26 -26
- biotite/sequence/align/cigar.py +2 -2
- biotite/sequence/align/kmeralphabet.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmeralphabet.pyx +19 -2
- biotite/sequence/align/kmersimilarity.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.pyx +58 -48
- biotite/sequence/align/localgapped.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/localgapped.pyx +47 -47
- biotite/sequence/align/localungapped.cp311-win_amd64.pyd +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.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.pyx +35 -35
- biotite/sequence/align/permutation.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/selector.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/selector.pyx +2 -2
- biotite/sequence/align/statistics.py +1 -1
- biotite/sequence/align/tracetable.cp311-win_amd64.pyd +0 -0
- biotite/sequence/alphabet.py +5 -2
- biotite/sequence/annotation.py +19 -13
- biotite/sequence/codec.cp311-win_amd64.pyd +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.cp311-win_amd64.pyd +0 -0
- biotite/sequence/phylo/tree.cp311-win_amd64.pyd +0 -0
- biotite/sequence/phylo/upgma.cp311-win_amd64.pyd +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.cp311-win_amd64.pyd +0 -0
- biotite/structure/bonds.pyx +79 -25
- biotite/structure/box.py +19 -21
- biotite/structure/celllist.cp311-win_amd64.pyd +0 -0
- biotite/structure/celllist.pyx +83 -67
- biotite/structure/chains.py +5 -37
- biotite/structure/charges.cp311-win_amd64.pyd +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.cp311-win_amd64.pyd +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.cp311-win_amd64.pyd +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.cp311-win_amd64.pyd +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
|
@@ -37,11 +37,11 @@ ctypedef fused CodeType2:
|
|
|
37
37
|
def align_ungapped(seq1, seq2, matrix, score_only=False):
|
|
38
38
|
"""
|
|
39
39
|
align_ungapped(seq1, seq2, matrix, score_only=False)
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
Align two sequences without insertion of gaps.
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
Both sequences need to have the same length.
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
Parameters
|
|
46
46
|
----------
|
|
47
47
|
seq1, seq2 : Sequence
|
|
@@ -50,7 +50,7 @@ def align_ungapped(seq1, seq2, matrix, score_only=False):
|
|
|
50
50
|
The substitution matrix used for scoring.
|
|
51
51
|
score_only : bool, optional
|
|
52
52
|
If true return only the score instead of an alignment.
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
Returns
|
|
55
55
|
-------
|
|
56
56
|
score : Alignment or int
|
|
@@ -105,27 +105,27 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
105
105
|
|
|
106
106
|
Perform an optimal alignment of two sequences based on a
|
|
107
107
|
dynamic programming algorithm.
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
This algorithm yields an optimal alignment, i.e. the sequences
|
|
110
110
|
are aligned in the way that results in the highest similarity
|
|
111
111
|
score. This operation can be very time and space consuming,
|
|
112
112
|
because both scale linearly with each sequence length.
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
The aligned sequences do not need to be instances from the same
|
|
115
115
|
:class:`Sequence` subclass, since they do not need to have the same
|
|
116
116
|
alphabet. The only requirement is that the
|
|
117
117
|
:class:`SubstitutionMatrix`' alphabets extend the alphabets of the
|
|
118
118
|
two sequences.
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
This function can either perform a global alignment, based on the
|
|
121
121
|
Needleman-Wunsch algorithm :footcite:`Needleman1970` or a local
|
|
122
122
|
alignment, based on the Smith–Waterman algorithm
|
|
123
123
|
:footcite:`Smith1981`.
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
Furthermore this function supports affine gap penalties using the
|
|
126
126
|
Gotoh algorithm :footcite:`Gotoh1982`, however, this requires
|
|
127
127
|
approximately 4 times the RAM space and execution time.
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
Parameters
|
|
130
130
|
----------
|
|
131
131
|
seq1, seq2 : Sequence
|
|
@@ -141,7 +141,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
141
141
|
The values need to be negative. (Default: *-10*)
|
|
142
142
|
terminal_penalty : bool, optional
|
|
143
143
|
If true, gap penalties are applied to terminal gaps.
|
|
144
|
-
If `local` is true, this parameter has no effect.
|
|
144
|
+
If `local` is true, this parameter has no effect.
|
|
145
145
|
(Default: True)
|
|
146
146
|
local : bool, optional
|
|
147
147
|
If false, a global alignment is performed, otherwise a local
|
|
@@ -151,26 +151,26 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
151
151
|
When the number of branches exceeds this value in the traceback
|
|
152
152
|
step, no further branches are created.
|
|
153
153
|
(Default: 1000)
|
|
154
|
-
|
|
154
|
+
|
|
155
155
|
Returns
|
|
156
156
|
-------
|
|
157
157
|
alignments : list, type=Alignment
|
|
158
158
|
A list of alignments.
|
|
159
159
|
Each alignment in the list has the same maximum similarity
|
|
160
160
|
score.
|
|
161
|
-
|
|
162
|
-
See
|
|
161
|
+
|
|
162
|
+
See Also
|
|
163
163
|
--------
|
|
164
164
|
align_banded
|
|
165
|
-
|
|
165
|
+
|
|
166
166
|
References
|
|
167
167
|
----------
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
.. footbibliography::
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
Examples
|
|
172
172
|
--------
|
|
173
|
-
|
|
173
|
+
|
|
174
174
|
>>> seq1 = NucleotideSequence("ATACGCTTGCT")
|
|
175
175
|
>>> seq2 = NucleotideSequence("AGGCGCAGCT")
|
|
176
176
|
>>> matrix = SubstitutionMatrix.std_nucleotide_matrix()
|
|
@@ -178,10 +178,10 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
178
178
|
>>> for a in ali:
|
|
179
179
|
... print(a, "\\n")
|
|
180
180
|
ATACGCTTGCT
|
|
181
|
-
AGGCGCA-GCT
|
|
181
|
+
AGGCGCA-GCT
|
|
182
182
|
<BLANKLINE>
|
|
183
183
|
ATACGCTTGCT
|
|
184
|
-
AGGCGC-AGCT
|
|
184
|
+
AGGCGC-AGCT
|
|
185
185
|
<BLANKLINE>
|
|
186
186
|
"""
|
|
187
187
|
# Check matrix alphabets
|
|
@@ -204,7 +204,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
204
204
|
raise ValueError(
|
|
205
205
|
"Maximum number of returned alignments must be at least 1"
|
|
206
206
|
)
|
|
207
|
-
|
|
207
|
+
|
|
208
208
|
|
|
209
209
|
# This implementation uses transposed tables in comparison
|
|
210
210
|
# to the common visualization
|
|
@@ -213,7 +213,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
213
213
|
trace_table = np.zeros(( len(seq1)+1, len(seq2)+1 ), dtype=np.uint8)
|
|
214
214
|
code1 = seq1.code
|
|
215
215
|
code2 = seq2.code
|
|
216
|
-
|
|
216
|
+
|
|
217
217
|
# Table filling
|
|
218
218
|
###############
|
|
219
219
|
if affine_penalty:
|
|
@@ -275,8 +275,8 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
275
275
|
trace_table[0,1:] = TraceDirectionLinear.GAP_LEFT
|
|
276
276
|
_fill_align_table(code1, code2, matrix.score_matrix(), trace_table,
|
|
277
277
|
score_table, gap_penalty, terminal_penalty, local)
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
|
|
279
|
+
|
|
280
280
|
# Traceback
|
|
281
281
|
###########
|
|
282
282
|
# Stores all possible traces (= possible alignments)
|
|
@@ -292,7 +292,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
292
292
|
if local:
|
|
293
293
|
# The start point is the maximal score in the table
|
|
294
294
|
# Multiple starting points possible,
|
|
295
|
-
# when duplicates of maximal score exist
|
|
295
|
+
# when duplicates of maximal score exist
|
|
296
296
|
if affine_penalty:
|
|
297
297
|
# The maximum score in the gap score tables do not need to
|
|
298
298
|
# be considered, as these starting positions would indicate
|
|
@@ -352,7 +352,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
352
352
|
# Diagonals are only needed for banded alignments
|
|
353
353
|
lower_diag=0, upper_diag=0
|
|
354
354
|
)
|
|
355
|
-
|
|
355
|
+
|
|
356
356
|
# Replace gap entries in trace with -1
|
|
357
357
|
for i, trace in enumerate(trace_list):
|
|
358
358
|
trace = np.flip(trace, axis=0)
|
|
@@ -361,7 +361,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
361
361
|
gap_filter[np.unique(trace[:,1], return_index=True)[1], 1] = True
|
|
362
362
|
trace[~gap_filter] = -1
|
|
363
363
|
trace_list[i] = trace
|
|
364
|
-
|
|
364
|
+
|
|
365
365
|
# Limit the number of generated alignments to `max_number`:
|
|
366
366
|
# In most cases this is achieved by discarding branches in
|
|
367
367
|
# 'follow_trace()', however, if multiple local alignment starts
|
|
@@ -406,13 +406,13 @@ def _fill_align_table(CodeType1[:] code1 not None,
|
|
|
406
406
|
local
|
|
407
407
|
Indicates, whether a local alignment should be performed.
|
|
408
408
|
"""
|
|
409
|
-
|
|
409
|
+
|
|
410
410
|
cdef int i, j
|
|
411
411
|
cdef int max_i, max_j
|
|
412
412
|
cdef int32 from_diag, from_left, from_top
|
|
413
413
|
cdef uint8 trace
|
|
414
414
|
cdef int32 score
|
|
415
|
-
|
|
415
|
+
|
|
416
416
|
# For local alignments terminal gaps on the right side are ignored
|
|
417
417
|
# anyway, as the alignment should stop before
|
|
418
418
|
if local:
|
|
@@ -439,16 +439,16 @@ def _fill_align_table(CodeType1[:] code1 not None,
|
|
|
439
439
|
from_top = score_table[i-1, j]
|
|
440
440
|
else:
|
|
441
441
|
from_top = score_table[i-1, j] + gap_penalty
|
|
442
|
-
|
|
442
|
+
|
|
443
443
|
trace = get_trace_linear(from_diag, from_left, from_top, &score)
|
|
444
|
-
|
|
444
|
+
|
|
445
445
|
# Local alignment specialty:
|
|
446
446
|
# If score is less than or equal to 0,
|
|
447
447
|
# then the score of the cell remains 0
|
|
448
448
|
# and the trace ends here
|
|
449
449
|
if local == True and score <= 0:
|
|
450
450
|
continue
|
|
451
|
-
|
|
451
|
+
|
|
452
452
|
score_table[i,j] = score
|
|
453
453
|
trace_table[i,j] = trace
|
|
454
454
|
|
|
@@ -496,7 +496,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
496
496
|
local
|
|
497
497
|
Indicates, whether a local alignment should be performed.
|
|
498
498
|
"""
|
|
499
|
-
|
|
499
|
+
|
|
500
500
|
cdef int i, j
|
|
501
501
|
cdef int max_i, max_j
|
|
502
502
|
cdef int32 mm_score, g1m_score, g2m_score
|
|
@@ -505,7 +505,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
505
505
|
cdef int32 m_score, g1_score, g2_score
|
|
506
506
|
cdef int32 similarity_score
|
|
507
507
|
cdef uint8 trace
|
|
508
|
-
|
|
508
|
+
|
|
509
509
|
# For local alignments terminal gaps on the right and the bottom are
|
|
510
510
|
# ignored anyway, as the alignment should stop before
|
|
511
511
|
if local:
|
|
@@ -513,7 +513,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
513
513
|
# Used in case terminal gaps are not penalized
|
|
514
514
|
i_max = trace_table.shape[0] -1
|
|
515
515
|
j_max = trace_table.shape[1] -1
|
|
516
|
-
|
|
516
|
+
|
|
517
517
|
# Starts at 1 since the first row and column are already filled
|
|
518
518
|
for i in range(1, trace_table.shape[0]):
|
|
519
519
|
for j in range(1, trace_table.shape[1]):
|
|
@@ -538,7 +538,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
538
538
|
else:
|
|
539
539
|
mg2_score = m_table[i-1,j] + gap_open
|
|
540
540
|
g2g2_score = g2_table[i-1,j] + gap_ext
|
|
541
|
-
|
|
541
|
+
|
|
542
542
|
trace = get_trace_affine(
|
|
543
543
|
mm_score, g1m_score, g2m_score,
|
|
544
544
|
mg1_score, g1g1_score,
|
|
Binary file
|
|
Binary file
|
|
@@ -275,7 +275,7 @@ class SyncmerSelector:
|
|
|
275
275
|
permutation : Permutation
|
|
276
276
|
The permutation.
|
|
277
277
|
|
|
278
|
-
See
|
|
278
|
+
See Also
|
|
279
279
|
--------
|
|
280
280
|
CachedSyncmerSelector
|
|
281
281
|
A cached variant with faster syncmer selection at the cost of
|
|
@@ -546,7 +546,7 @@ class CachedSyncmerSelector(SyncmerSelector):
|
|
|
546
546
|
permutation : Permutation
|
|
547
547
|
The permutation.
|
|
548
548
|
|
|
549
|
-
See
|
|
549
|
+
See Also
|
|
550
550
|
--------
|
|
551
551
|
SyncmerSelector
|
|
552
552
|
A standard variant for syncmer selection.
|
|
@@ -168,7 +168,7 @@ class EValueEstimator:
|
|
|
168
168
|
raise ValueError("A symmetric substitution matrix is required")
|
|
169
169
|
if not matrix.get_alphabet1().extends(alphabet):
|
|
170
170
|
raise ValueError(
|
|
171
|
-
"The substitution matrix is not compatible
|
|
171
|
+
"The substitution matrix is not compatible with the given alphabet"
|
|
172
172
|
)
|
|
173
173
|
score_matrix = matrix.score_matrix()[: len(alphabet), : len(alphabet)]
|
|
174
174
|
if (
|
|
Binary file
|
biotite/sequence/alphabet.py
CHANGED
|
@@ -201,7 +201,7 @@ class Alphabet(object):
|
|
|
201
201
|
symbols : array-like
|
|
202
202
|
The symbols to encode.
|
|
203
203
|
dtype : dtype, optional
|
|
204
|
-
The dtype of the output ndarray.
|
|
204
|
+
The dtype of the output ndarray.
|
|
205
205
|
|
|
206
206
|
Returns
|
|
207
207
|
-------
|
|
@@ -361,7 +361,7 @@ class LetterAlphabet(Alphabet):
|
|
|
361
361
|
:class:`ndarray`, :class:`str` or :class:`bytes` object
|
|
362
362
|
containing the symbols is provided, instead of e.g. a list.
|
|
363
363
|
dtype : dtype, optional
|
|
364
|
-
For compatibility with superclass. The value is ignored
|
|
364
|
+
For compatibility with superclass. The value is ignored.
|
|
365
365
|
|
|
366
366
|
Returns
|
|
367
367
|
-------
|
|
@@ -410,6 +410,9 @@ class LetterAlphabet(Alphabet):
|
|
|
410
410
|
symbols = symbols.astype("U1")
|
|
411
411
|
return symbols
|
|
412
412
|
|
|
413
|
+
def is_letter_alphabet(self):
|
|
414
|
+
return True
|
|
415
|
+
|
|
413
416
|
def __contains__(self, symbol):
|
|
414
417
|
if not isinstance(symbol, (str, bytes)):
|
|
415
418
|
return False
|
biotite/sequence/annotation.py
CHANGED
|
@@ -24,7 +24,7 @@ class Location:
|
|
|
24
24
|
|
|
25
25
|
Objects of this class are immutable.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Parameters
|
|
28
28
|
----------
|
|
29
29
|
first : int
|
|
30
30
|
Starting base or residue position of the feature.
|
|
@@ -35,6 +35,11 @@ class Location:
|
|
|
35
35
|
Always :attr:`Strand.FORWARD` for peptide features.
|
|
36
36
|
defect : Defect
|
|
37
37
|
A possible defect of the location.
|
|
38
|
+
|
|
39
|
+
Attributes
|
|
40
|
+
----------
|
|
41
|
+
first, last, strand, defect
|
|
42
|
+
Same as the parameters.
|
|
38
43
|
"""
|
|
39
44
|
|
|
40
45
|
class Defect(Flag):
|
|
@@ -92,8 +97,8 @@ class Location:
|
|
|
92
97
|
def __repr__(self):
|
|
93
98
|
"""Represent Location as a string for debugging."""
|
|
94
99
|
return (
|
|
95
|
-
f
|
|
96
|
-
f
|
|
100
|
+
f"Location({self._first}, {self._last}, strand={'Location.' + str(self._strand)}, "
|
|
101
|
+
f"defect={'Location.' + str(self._defect)})"
|
|
97
102
|
)
|
|
98
103
|
|
|
99
104
|
@property
|
|
@@ -356,7 +361,7 @@ class Annotation(Copyable):
|
|
|
356
361
|
def __repr__(self):
|
|
357
362
|
"""Represent Annotation as a string for debugging."""
|
|
358
363
|
return (
|
|
359
|
-
f
|
|
364
|
+
f"Annotation([{', '.join([feat.__repr__() for feat in self._features])}])"
|
|
360
365
|
)
|
|
361
366
|
|
|
362
367
|
def __copy_create__(self):
|
|
@@ -384,8 +389,7 @@ class Annotation(Copyable):
|
|
|
384
389
|
"""
|
|
385
390
|
if not isinstance(feature, Feature):
|
|
386
391
|
raise TypeError(
|
|
387
|
-
f"Only 'Feature' objects are supported, "
|
|
388
|
-
f"not {type(feature).__name__}"
|
|
392
|
+
f"Only 'Feature' objects are supported, not {type(feature).__name__}"
|
|
389
393
|
)
|
|
390
394
|
self._features.add(feature)
|
|
391
395
|
|
|
@@ -498,7 +502,7 @@ class Annotation(Copyable):
|
|
|
498
502
|
def __delitem__(self, item):
|
|
499
503
|
if not isinstance(item, Feature):
|
|
500
504
|
raise TypeError(
|
|
501
|
-
f"Only 'Feature' objects are supported,
|
|
505
|
+
f"Only 'Feature' objects are supported, not {type(item).__name__}"
|
|
502
506
|
)
|
|
503
507
|
self.del_feature(item)
|
|
504
508
|
|
|
@@ -550,12 +554,12 @@ class AnnotatedSequence(Copyable):
|
|
|
550
554
|
|
|
551
555
|
Parameters
|
|
552
556
|
----------
|
|
557
|
+
annotation : Annotation
|
|
558
|
+
The annotation corresponding to `sequence`.
|
|
553
559
|
sequence : Sequence
|
|
554
560
|
The sequence.
|
|
555
561
|
Usually a :class:`NucleotideSequence` or
|
|
556
562
|
:class:`ProteinSequence`.
|
|
557
|
-
annotation : Annotation
|
|
558
|
-
The annotation corresponding to `sequence`.
|
|
559
563
|
sequence_start : int, optional
|
|
560
564
|
By default, the first symbol of the sequence is corresponding
|
|
561
565
|
to location 1 of the features in the annotation. The location
|
|
@@ -564,16 +568,17 @@ class AnnotatedSequence(Copyable):
|
|
|
564
568
|
|
|
565
569
|
Attributes
|
|
566
570
|
----------
|
|
567
|
-
sequence : Sequence
|
|
568
|
-
The represented sequence.
|
|
569
571
|
annotation : Annotation
|
|
570
572
|
The annotation corresponding to `sequence`.
|
|
573
|
+
sequence : Sequence
|
|
574
|
+
The represented sequence.
|
|
571
575
|
sequence_start : int
|
|
572
576
|
The location of the first symbol in the sequence.
|
|
573
577
|
|
|
574
|
-
See
|
|
578
|
+
See Also
|
|
575
579
|
--------
|
|
576
|
-
Annotation
|
|
580
|
+
Annotation : An annotation separated from a sequence.
|
|
581
|
+
Sequence : A sequence separated from an annotation.
|
|
577
582
|
|
|
578
583
|
Examples
|
|
579
584
|
--------
|
|
@@ -666,6 +671,7 @@ class AnnotatedSequence(Copyable):
|
|
|
666
671
|
|
|
667
672
|
Returns
|
|
668
673
|
-------
|
|
674
|
+
rev_sequence : Sequence
|
|
669
675
|
The reverse complement of the annotated sequence.
|
|
670
676
|
"""
|
|
671
677
|
rev_seqstart = sequence_start
|
|
Binary file
|
biotite/sequence/codon.py
CHANGED
|
@@ -216,7 +216,7 @@ class CodonTable(object):
|
|
|
216
216
|
code : bool
|
|
217
217
|
If true, the dictionary contains keys and values as code.
|
|
218
218
|
Otherwise, the dictionary contains strings for codons and
|
|
219
|
-
amino acid.
|
|
219
|
+
amino acid.
|
|
220
220
|
|
|
221
221
|
Returns
|
|
222
222
|
-------
|
|
@@ -248,7 +248,6 @@ class CodonTable(object):
|
|
|
248
248
|
----------
|
|
249
249
|
code : bool
|
|
250
250
|
If true, the code will be returned instead of strings.
|
|
251
|
-
(Default: False)
|
|
252
251
|
|
|
253
252
|
Returns
|
|
254
253
|
-------
|
|
@@ -54,7 +54,7 @@ class SymbolPlotter(metaclass=abc.ABCMeta):
|
|
|
54
54
|
Parameters
|
|
55
55
|
----------
|
|
56
56
|
bbox : Bbox
|
|
57
|
-
The axes area to plot the symbol in
|
|
57
|
+
The axes area to plot the symbol in.
|
|
58
58
|
alignment : Alignment
|
|
59
59
|
The respective alignment.
|
|
60
60
|
column_i : int
|
|
@@ -148,7 +148,7 @@ class LetterPlotter(SymbolPlotter, metaclass=abc.ABCMeta):
|
|
|
148
148
|
-------
|
|
149
149
|
color : object
|
|
150
150
|
A *Matplotlib* compatible color used for the background
|
|
151
|
-
or the symbol itself at the specifed position
|
|
151
|
+
or the symbol itself at the specifed position.
|
|
152
152
|
"""
|
|
153
153
|
pass
|
|
154
154
|
|
|
@@ -321,7 +321,7 @@ class LetterTypePlotter(LetterPlotter):
|
|
|
321
321
|
axes : Axes
|
|
322
322
|
A *Matplotlib* axes, that is used as plotting area.
|
|
323
323
|
alphabet : Alphabet
|
|
324
|
-
The alphabet of the alignment(s) to be plotted
|
|
324
|
+
The alphabet of the alignment(s) to be plotted.
|
|
325
325
|
color_scheme : str or list of (tuple or str), optional
|
|
326
326
|
Either a valid color scheme name
|
|
327
327
|
(e.g. ``"flower"``, ``"clustalx"``, ``blossom``, etc.)
|
|
@@ -391,7 +391,6 @@ class ArrayPlotter(LetterPlotter):
|
|
|
391
391
|
font_param : dict, optional
|
|
392
392
|
Additional parameters that is given to the
|
|
393
393
|
:class:`matplotlib.Text` instance of each symbol.
|
|
394
|
-
|
|
395
394
|
"""
|
|
396
395
|
|
|
397
396
|
def __init__(
|
|
@@ -524,7 +523,7 @@ def plot_alignment(
|
|
|
524
523
|
but this behavior can be changed using the `number_functions`
|
|
525
524
|
parameter.
|
|
526
525
|
number_size : float, optional
|
|
527
|
-
The font size of the position numbers
|
|
526
|
+
The font size of the position numbers.
|
|
528
527
|
number_functions : list of [(None or Callable(int -> int)], optional
|
|
529
528
|
By default the position of the first symbol in a sequence is 1,
|
|
530
529
|
i.e. the sequence position is the sequence index incremented by
|
|
@@ -541,7 +540,7 @@ def plot_alignment(
|
|
|
541
540
|
Must be the same size and order as the sequences in the
|
|
542
541
|
alignment.
|
|
543
542
|
label_size : float, optional
|
|
544
|
-
Font size of the labels
|
|
543
|
+
Font size of the labels.
|
|
545
544
|
show_line_position : bool, optional
|
|
546
545
|
If true the position within a line is plotted below the
|
|
547
546
|
alignment.
|
|
@@ -549,14 +548,9 @@ def plot_alignment(
|
|
|
549
548
|
The spacing between the alignment lines. 1.0 means that the size
|
|
550
549
|
is equal to the size of a symbol box.
|
|
551
550
|
symbol_spacing : int, optional
|
|
552
|
-
|
|
551
|
+
A space is placed between each number of elements desired
|
|
553
552
|
by variable.
|
|
554
553
|
|
|
555
|
-
See also
|
|
556
|
-
--------
|
|
557
|
-
plot_alignment_similarity_based
|
|
558
|
-
plot_alignment_type_based
|
|
559
|
-
|
|
560
554
|
Notes
|
|
561
555
|
-----
|
|
562
556
|
The labels are placed on the Y-axis of the `axes` and the numbers
|
|
@@ -722,8 +716,6 @@ def plot_alignment_similarity_based(
|
|
|
722
716
|
alignment : Alignment
|
|
723
717
|
The pairwise or multiple sequence alignment to be plotted.
|
|
724
718
|
The alphabet of each sequence in the alignment must be the same.
|
|
725
|
-
symbol_plotter : SymbolPlotter
|
|
726
|
-
Defines how the symbols in the alignment are drawn.
|
|
727
719
|
symbols_per_line : int, optional
|
|
728
720
|
The amount of alignment columns that are diplayed per line.
|
|
729
721
|
show_numbers : bool, optional
|
|
@@ -738,7 +730,7 @@ def plot_alignment_similarity_based(
|
|
|
738
730
|
but this behavior can be changed using the `number_functions`
|
|
739
731
|
parameter.
|
|
740
732
|
number_size : float, optional
|
|
741
|
-
The font size of the position numbers
|
|
733
|
+
The font size of the position numbers.
|
|
742
734
|
number_functions : list of [(None or Callable(int -> int)], optional
|
|
743
735
|
By default the position of the first symbol in a sequence is 1,
|
|
744
736
|
i.e. the sequence position is the sequence index incremented by
|
|
@@ -755,7 +747,7 @@ def plot_alignment_similarity_based(
|
|
|
755
747
|
Must be the same size and order as the sequences in the
|
|
756
748
|
alignment.
|
|
757
749
|
label_size : float, optional
|
|
758
|
-
Font size of the labels
|
|
750
|
+
Font size of the labels.
|
|
759
751
|
show_line_position : bool, optional
|
|
760
752
|
If true the position within a line is plotted below the
|
|
761
753
|
alignment.
|
|
@@ -782,19 +774,19 @@ def plot_alignment_similarity_based(
|
|
|
782
774
|
If true, the symbols themselves are colored.
|
|
783
775
|
If false, the symbols are black, and the boxes behind the
|
|
784
776
|
symbols are colored.
|
|
777
|
+
symbol_spacing : int, optional
|
|
778
|
+
A space is placed between each number of elements desired
|
|
779
|
+
by variable.
|
|
785
780
|
symbol_size : float, optional
|
|
786
781
|
Font size of the sequence symbols.
|
|
787
782
|
symbol_param : dict
|
|
788
783
|
Additional parameters that is given to the
|
|
789
784
|
:class:`matplotlib.Text` instance of each symbol.
|
|
790
|
-
symbol_spacing : int, optional
|
|
791
|
-
А space is placed between each number of elements desired
|
|
792
|
-
by variable.
|
|
793
785
|
|
|
794
|
-
See
|
|
786
|
+
See Also
|
|
795
787
|
--------
|
|
796
|
-
plot_alignment
|
|
797
|
-
LetterSimilarityPlotter
|
|
788
|
+
plot_alignment : Analogous functionality with a customizable :class:`SymbolPlotter`.
|
|
789
|
+
LetterSimilarityPlotter : The :class:`SymbolPlotter` used in this function.
|
|
798
790
|
|
|
799
791
|
Notes
|
|
800
792
|
-----
|
|
@@ -883,8 +875,6 @@ def plot_alignment_type_based(
|
|
|
883
875
|
alignment : Alignment
|
|
884
876
|
The pairwise or multiple sequence alignment to be plotted.
|
|
885
877
|
The alphabet of each sequence in the alignment must be the same.
|
|
886
|
-
symbol_plotter : SymbolPlotter
|
|
887
|
-
Defines how the symbols in the alignment are drawn.
|
|
888
878
|
symbols_per_line : int, optional
|
|
889
879
|
The amount of alignment columns that are diplayed per line.
|
|
890
880
|
show_numbers : bool, optional
|
|
@@ -899,7 +889,7 @@ def plot_alignment_type_based(
|
|
|
899
889
|
but this behavior can be changed using the `number_functions`
|
|
900
890
|
parameter.
|
|
901
891
|
number_size : float, optional
|
|
902
|
-
The font size of the position numbers
|
|
892
|
+
The font size of the position numbers.
|
|
903
893
|
number_functions : list of [(None or Callable(int -> int)], optional
|
|
904
894
|
By default the position of the first symbol in a sequence is 1,
|
|
905
895
|
i.e. the sequence position is the sequence index incremented by
|
|
@@ -916,7 +906,7 @@ def plot_alignment_type_based(
|
|
|
916
906
|
Must be the same size and order as the sequences in the
|
|
917
907
|
alignment.
|
|
918
908
|
label_size : float, optional
|
|
919
|
-
Font size of the labels
|
|
909
|
+
Font size of the labels.
|
|
920
910
|
show_line_position : bool, optional
|
|
921
911
|
If true the position within a line is plotted below the
|
|
922
912
|
alignment.
|
|
@@ -939,13 +929,13 @@ def plot_alignment_type_based(
|
|
|
939
929
|
Additional parameters that is given to the
|
|
940
930
|
:class:`matplotlib.Text` instance of each symbol.
|
|
941
931
|
symbol_spacing : int, optional
|
|
942
|
-
|
|
932
|
+
A space is placed between each number of elements desired
|
|
943
933
|
by variable.
|
|
944
934
|
|
|
945
|
-
See
|
|
935
|
+
See Also
|
|
946
936
|
--------
|
|
947
|
-
plot_alignment
|
|
948
|
-
LetterTypePlotter
|
|
937
|
+
plot_alignment : Analogous functionality with a customizable :class:`SymbolPlotter`.
|
|
938
|
+
LetterTypePlotter : The :class:`SymbolPlotter` used in this function.
|
|
949
939
|
"""
|
|
950
940
|
alphabet = alignment.sequences[0].get_alphabet()
|
|
951
941
|
symbol_plotter = LetterTypePlotter(
|
|
@@ -1007,9 +997,6 @@ def plot_alignment_array(
|
|
|
1007
997
|
The array to map fluorescence values to score residues.
|
|
1008
998
|
By default the normalized score is 1 for maximum recognition
|
|
1009
999
|
and 0 for non-recognition (no color).
|
|
1010
|
-
symbol_plotter : SymbolPlotter
|
|
1011
|
-
Instance of ArrayPlotter. Defines how the symbols are drawn
|
|
1012
|
-
in the alignment.
|
|
1013
1000
|
symbols_per_line : int, optional
|
|
1014
1001
|
The amount of alignment columns that are displayed per line.
|
|
1015
1002
|
show_numbers : bool, optional
|
|
@@ -1024,7 +1011,7 @@ def plot_alignment_array(
|
|
|
1024
1011
|
but this behavior can be changed using the `number_functions`
|
|
1025
1012
|
parameter.
|
|
1026
1013
|
number_size : float, optional
|
|
1027
|
-
The font size of the position numbers
|
|
1014
|
+
The font size of the position numbers.
|
|
1028
1015
|
number_functions : list of [(None or Callable(int -> int)], optional
|
|
1029
1016
|
By default the position of the first symbol in a sequence is 1,
|
|
1030
1017
|
i.e. the sequence position is the sequence index incremented by
|
|
@@ -1041,7 +1028,7 @@ def plot_alignment_array(
|
|
|
1041
1028
|
Must be the same size and order as the sequences in the
|
|
1042
1029
|
alignment.
|
|
1043
1030
|
label_size : float, optional
|
|
1044
|
-
Font size of the labels
|
|
1031
|
+
Font size of the labels.
|
|
1045
1032
|
show_line_position : bool, optional
|
|
1046
1033
|
If true the position within a line is plotted below the
|
|
1047
1034
|
alignment.
|
|
@@ -1054,20 +1041,19 @@ def plot_alignment_array(
|
|
|
1054
1041
|
The boxes are
|
|
1055
1042
|
colored based on the normalized intensity value on the
|
|
1056
1043
|
given *Matplotlib* Colormap.
|
|
1044
|
+
symbol_spacing : int, optional
|
|
1045
|
+
A space is placed between each number of elements desired
|
|
1046
|
+
by variable.
|
|
1057
1047
|
symbol_size : float, optional
|
|
1058
1048
|
Font size of the sequence symbols.
|
|
1059
1049
|
symbol_param : dict
|
|
1060
1050
|
Additional parameters that is given to the
|
|
1061
1051
|
:class:`matplotlib.Text` instance of each symbol.
|
|
1062
|
-
symbol_spacing : int, optional
|
|
1063
|
-
A space is placed between each number of elements desired
|
|
1064
|
-
by variable.
|
|
1065
1052
|
|
|
1066
1053
|
Notes
|
|
1067
1054
|
-----
|
|
1068
1055
|
A '*' represents a sequence match on the alignment
|
|
1069
1056
|
A '-' represents a sequence gap on the alignment
|
|
1070
|
-
|
|
1071
1057
|
"""
|
|
1072
1058
|
symbol_plotter = ArrayPlotter(
|
|
1073
1059
|
axes,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": "Generated with 'gecos --matrix 3Di --name flower --lmin 60 --lmax 80 -f 3di_flower.json'",
|
|
3
|
+
"name": "flower",
|
|
4
|
+
"alphabet": [
|
|
5
|
+
"a",
|
|
6
|
+
"c",
|
|
7
|
+
"d",
|
|
8
|
+
"e",
|
|
9
|
+
"f",
|
|
10
|
+
"g",
|
|
11
|
+
"h",
|
|
12
|
+
"i",
|
|
13
|
+
"k",
|
|
14
|
+
"l",
|
|
15
|
+
"m",
|
|
16
|
+
"n",
|
|
17
|
+
"p",
|
|
18
|
+
"q",
|
|
19
|
+
"r",
|
|
20
|
+
"s",
|
|
21
|
+
"t",
|
|
22
|
+
"v",
|
|
23
|
+
"w",
|
|
24
|
+
"y"
|
|
25
|
+
],
|
|
26
|
+
"colors": {
|
|
27
|
+
"a": "#a189a1",
|
|
28
|
+
"c": "#ff5806",
|
|
29
|
+
"d": "#ab9a93",
|
|
30
|
+
"e": "#e754d5",
|
|
31
|
+
"f": "#8191b5",
|
|
32
|
+
"g": "#cbc7ae",
|
|
33
|
+
"h": "#dac1bc",
|
|
34
|
+
"i": "#5eaf6e",
|
|
35
|
+
"k": "#04c1fd",
|
|
36
|
+
"l": "#ff544b",
|
|
37
|
+
"m": "#07e560",
|
|
38
|
+
"n": "#f28d05",
|
|
39
|
+
"p": "#b68767",
|
|
40
|
+
"q": "#bc8277",
|
|
41
|
+
"r": "#eebe86",
|
|
42
|
+
"s": "#ffa103",
|
|
43
|
+
"t": "#a4c49a",
|
|
44
|
+
"v": "#ed6903",
|
|
45
|
+
"w": "#3a97d8",
|
|
46
|
+
"y": "#f7adfd"
|
|
47
|
+
}
|
|
48
|
+
}
|