biotite 1.1.0__cp311-cp311-win_amd64.whl → 1.3.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/localapp.py +2 -2
- biotite/application/msaapp.py +10 -10
- biotite/application/muscle/app3.py +3 -3
- biotite/application/muscle/app5.py +3 -3
- biotite/application/sra/app.py +0 -5
- biotite/application/util.py +21 -1
- biotite/application/viennarna/rnaalifold.py +8 -8
- biotite/application/viennarna/rnaplot.py +10 -8
- 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 +2 -3
- biotite/database/uniprot/check.py +2 -2
- biotite/database/uniprot/download.py +2 -5
- biotite/database/uniprot/query.py +3 -4
- biotite/file.py +14 -2
- 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 +1226 -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/align/__init__.py +0 -4
- biotite/sequence/align/alignment.py +33 -11
- biotite/sequence/align/banded.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/banded.pyx +22 -22
- biotite/sequence/align/cigar.py +2 -2
- biotite/sequence/align/kmeralphabet.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/kmeralphabet.pyx +2 -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 +6 -6
- 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 +12 -3
- biotite/sequence/align/multiple.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/multiple.pyx +1 -2
- biotite/sequence/align/pairwise.cp311-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.pyx +37 -39
- 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 +2 -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/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 +19 -25
- biotite/sequence/search.py +0 -1
- biotite/sequence/seqtypes.py +12 -5
- biotite/sequence/sequence.py +1 -2
- biotite/structure/__init__.py +2 -0
- biotite/structure/alphabet/i3d.py +1 -2
- biotite/structure/alphabet/pb.py +1 -2
- biotite/structure/alphabet/unkerasify.py +8 -2
- biotite/structure/atoms.py +35 -27
- biotite/structure/basepairs.py +39 -40
- biotite/structure/bonds.cp311-win_amd64.pyd +0 -0
- biotite/structure/bonds.pyx +8 -5
- biotite/structure/box.py +159 -23
- biotite/structure/celllist.cp311-win_amd64.pyd +0 -0
- biotite/structure/celllist.pyx +83 -68
- biotite/structure/chains.py +17 -55
- 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 +31 -32
- biotite/structure/filter.py +8 -8
- biotite/structure/geometry.py +15 -15
- biotite/structure/graphics/rna.py +19 -16
- biotite/structure/hbond.py +18 -21
- biotite/structure/info/atoms.py +11 -2
- biotite/structure/info/ccd.py +0 -2
- biotite/structure/info/components.bcif +0 -0
- biotite/structure/info/groups.py +0 -3
- biotite/structure/info/misc.py +0 -1
- biotite/structure/info/radii.py +92 -22
- biotite/structure/info/standardize.py +1 -2
- 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 +39 -13
- biotite/structure/io/pdb/convert.py +86 -5
- biotite/structure/io/pdb/file.py +90 -24
- biotite/structure/io/pdb/hybrid36.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/pdbqt/file.py +4 -4
- biotite/structure/io/pdbx/bcif.py +22 -7
- biotite/structure/io/pdbx/cif.py +20 -7
- biotite/structure/io/pdbx/component.py +6 -0
- biotite/structure/io/pdbx/compress.py +71 -34
- biotite/structure/io/pdbx/convert.py +429 -77
- biotite/structure/io/pdbx/encoding.cp311-win_amd64.pyd +0 -0
- biotite/structure/io/pdbx/encoding.pyx +39 -23
- biotite/structure/io/trajfile.py +9 -6
- biotite/structure/io/util.py +38 -0
- biotite/structure/mechanics.py +0 -1
- biotite/structure/molecules.py +0 -15
- biotite/structure/pseudoknots.py +13 -19
- biotite/structure/repair.py +2 -4
- biotite/structure/residues.py +20 -48
- biotite/structure/rings.py +335 -0
- biotite/structure/sasa.cp311-win_amd64.pyd +0 -0
- biotite/structure/sasa.pyx +30 -30
- biotite/structure/segments.py +123 -9
- biotite/structure/sequence.py +0 -1
- biotite/structure/spacegroups.json +1567 -0
- biotite/structure/spacegroups.license +26 -0
- biotite/structure/sse.py +0 -2
- biotite/structure/superimpose.py +75 -253
- biotite/structure/tm.py +581 -0
- biotite/structure/transform.py +232 -26
- biotite/structure/util.py +3 -3
- biotite/version.py +9 -4
- biotite/visualize.py +111 -1
- {biotite-1.1.0.dist-info → biotite-1.3.0.dist-info}/METADATA +8 -36
- {biotite-1.1.0.dist-info → biotite-1.3.0.dist-info}/RECORD +160 -138
- {biotite-1.1.0.dist-info → biotite-1.3.0.dist-info}/WHEEL +1 -1
- {biotite-1.1.0.dist-info → biotite-1.3.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
|
|
@@ -138,39 +138,37 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
138
138
|
If a tuple is provided, an affine gap penalty is used.
|
|
139
139
|
The first integer in the tuple is the gap opening penalty,
|
|
140
140
|
the second integer is the gap extension penalty.
|
|
141
|
-
The values need to be negative.
|
|
141
|
+
The values need to be negative.
|
|
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.
|
|
145
|
-
(Default: True)
|
|
144
|
+
If `local` is true, this parameter has no effect.
|
|
146
145
|
local : bool, optional
|
|
147
146
|
If false, a global alignment is performed, otherwise a local
|
|
148
|
-
alignment is performed.
|
|
147
|
+
alignment is performed.
|
|
149
148
|
max_number : int, optional
|
|
150
149
|
The maximum number of alignments returned.
|
|
151
150
|
When the number of branches exceeds this value in the traceback
|
|
152
151
|
step, no further branches are created.
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
|
|
155
153
|
Returns
|
|
156
154
|
-------
|
|
157
155
|
alignments : list, type=Alignment
|
|
158
156
|
A list of alignments.
|
|
159
157
|
Each alignment in the list has the same maximum similarity
|
|
160
158
|
score.
|
|
161
|
-
|
|
162
|
-
See
|
|
159
|
+
|
|
160
|
+
See Also
|
|
163
161
|
--------
|
|
164
162
|
align_banded
|
|
165
|
-
|
|
163
|
+
|
|
166
164
|
References
|
|
167
165
|
----------
|
|
168
|
-
|
|
166
|
+
|
|
169
167
|
.. footbibliography::
|
|
170
|
-
|
|
168
|
+
|
|
171
169
|
Examples
|
|
172
170
|
--------
|
|
173
|
-
|
|
171
|
+
|
|
174
172
|
>>> seq1 = NucleotideSequence("ATACGCTTGCT")
|
|
175
173
|
>>> seq2 = NucleotideSequence("AGGCGCAGCT")
|
|
176
174
|
>>> matrix = SubstitutionMatrix.std_nucleotide_matrix()
|
|
@@ -178,10 +176,10 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
178
176
|
>>> for a in ali:
|
|
179
177
|
... print(a, "\\n")
|
|
180
178
|
ATACGCTTGCT
|
|
181
|
-
AGGCGCA-GCT
|
|
179
|
+
AGGCGCA-GCT
|
|
182
180
|
<BLANKLINE>
|
|
183
181
|
ATACGCTTGCT
|
|
184
|
-
AGGCGC-AGCT
|
|
182
|
+
AGGCGC-AGCT
|
|
185
183
|
<BLANKLINE>
|
|
186
184
|
"""
|
|
187
185
|
# Check matrix alphabets
|
|
@@ -204,7 +202,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
204
202
|
raise ValueError(
|
|
205
203
|
"Maximum number of returned alignments must be at least 1"
|
|
206
204
|
)
|
|
207
|
-
|
|
205
|
+
|
|
208
206
|
|
|
209
207
|
# This implementation uses transposed tables in comparison
|
|
210
208
|
# to the common visualization
|
|
@@ -213,7 +211,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
213
211
|
trace_table = np.zeros(( len(seq1)+1, len(seq2)+1 ), dtype=np.uint8)
|
|
214
212
|
code1 = seq1.code
|
|
215
213
|
code2 = seq2.code
|
|
216
|
-
|
|
214
|
+
|
|
217
215
|
# Table filling
|
|
218
216
|
###############
|
|
219
217
|
if affine_penalty:
|
|
@@ -275,8 +273,8 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
275
273
|
trace_table[0,1:] = TraceDirectionLinear.GAP_LEFT
|
|
276
274
|
_fill_align_table(code1, code2, matrix.score_matrix(), trace_table,
|
|
277
275
|
score_table, gap_penalty, terminal_penalty, local)
|
|
278
|
-
|
|
279
|
-
|
|
276
|
+
|
|
277
|
+
|
|
280
278
|
# Traceback
|
|
281
279
|
###########
|
|
282
280
|
# Stores all possible traces (= possible alignments)
|
|
@@ -292,7 +290,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
292
290
|
if local:
|
|
293
291
|
# The start point is the maximal score in the table
|
|
294
292
|
# Multiple starting points possible,
|
|
295
|
-
# when duplicates of maximal score exist
|
|
293
|
+
# when duplicates of maximal score exist
|
|
296
294
|
if affine_penalty:
|
|
297
295
|
# The maximum score in the gap score tables do not need to
|
|
298
296
|
# be considered, as these starting positions would indicate
|
|
@@ -352,7 +350,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
352
350
|
# Diagonals are only needed for banded alignments
|
|
353
351
|
lower_diag=0, upper_diag=0
|
|
354
352
|
)
|
|
355
|
-
|
|
353
|
+
|
|
356
354
|
# Replace gap entries in trace with -1
|
|
357
355
|
for i, trace in enumerate(trace_list):
|
|
358
356
|
trace = np.flip(trace, axis=0)
|
|
@@ -361,7 +359,7 @@ def align_optimal(seq1, seq2, matrix, gap_penalty=-10,
|
|
|
361
359
|
gap_filter[np.unique(trace[:,1], return_index=True)[1], 1] = True
|
|
362
360
|
trace[~gap_filter] = -1
|
|
363
361
|
trace_list[i] = trace
|
|
364
|
-
|
|
362
|
+
|
|
365
363
|
# Limit the number of generated alignments to `max_number`:
|
|
366
364
|
# In most cases this is achieved by discarding branches in
|
|
367
365
|
# 'follow_trace()', however, if multiple local alignment starts
|
|
@@ -406,13 +404,13 @@ def _fill_align_table(CodeType1[:] code1 not None,
|
|
|
406
404
|
local
|
|
407
405
|
Indicates, whether a local alignment should be performed.
|
|
408
406
|
"""
|
|
409
|
-
|
|
407
|
+
|
|
410
408
|
cdef int i, j
|
|
411
409
|
cdef int max_i, max_j
|
|
412
410
|
cdef int32 from_diag, from_left, from_top
|
|
413
411
|
cdef uint8 trace
|
|
414
412
|
cdef int32 score
|
|
415
|
-
|
|
413
|
+
|
|
416
414
|
# For local alignments terminal gaps on the right side are ignored
|
|
417
415
|
# anyway, as the alignment should stop before
|
|
418
416
|
if local:
|
|
@@ -439,16 +437,16 @@ def _fill_align_table(CodeType1[:] code1 not None,
|
|
|
439
437
|
from_top = score_table[i-1, j]
|
|
440
438
|
else:
|
|
441
439
|
from_top = score_table[i-1, j] + gap_penalty
|
|
442
|
-
|
|
440
|
+
|
|
443
441
|
trace = get_trace_linear(from_diag, from_left, from_top, &score)
|
|
444
|
-
|
|
442
|
+
|
|
445
443
|
# Local alignment specialty:
|
|
446
444
|
# If score is less than or equal to 0,
|
|
447
445
|
# then the score of the cell remains 0
|
|
448
446
|
# and the trace ends here
|
|
449
447
|
if local == True and score <= 0:
|
|
450
448
|
continue
|
|
451
|
-
|
|
449
|
+
|
|
452
450
|
score_table[i,j] = score
|
|
453
451
|
trace_table[i,j] = trace
|
|
454
452
|
|
|
@@ -496,7 +494,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
496
494
|
local
|
|
497
495
|
Indicates, whether a local alignment should be performed.
|
|
498
496
|
"""
|
|
499
|
-
|
|
497
|
+
|
|
500
498
|
cdef int i, j
|
|
501
499
|
cdef int max_i, max_j
|
|
502
500
|
cdef int32 mm_score, g1m_score, g2m_score
|
|
@@ -505,7 +503,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
505
503
|
cdef int32 m_score, g1_score, g2_score
|
|
506
504
|
cdef int32 similarity_score
|
|
507
505
|
cdef uint8 trace
|
|
508
|
-
|
|
506
|
+
|
|
509
507
|
# For local alignments terminal gaps on the right and the bottom are
|
|
510
508
|
# ignored anyway, as the alignment should stop before
|
|
511
509
|
if local:
|
|
@@ -513,7 +511,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
513
511
|
# Used in case terminal gaps are not penalized
|
|
514
512
|
i_max = trace_table.shape[0] -1
|
|
515
513
|
j_max = trace_table.shape[1] -1
|
|
516
|
-
|
|
514
|
+
|
|
517
515
|
# Starts at 1 since the first row and column are already filled
|
|
518
516
|
for i in range(1, trace_table.shape[0]):
|
|
519
517
|
for j in range(1, trace_table.shape[1]):
|
|
@@ -538,7 +536,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
|
|
|
538
536
|
else:
|
|
539
537
|
mg2_score = m_table[i-1,j] + gap_open
|
|
540
538
|
g2g2_score = g2_table[i-1,j] + gap_ext
|
|
541
|
-
|
|
539
|
+
|
|
542
540
|
trace = get_trace_affine(
|
|
543
541
|
mm_score, g1m_score, g2m_score,
|
|
544
542
|
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
|
-------
|
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,
|
|
@@ -25,8 +25,10 @@ def plot_dendrogram(
|
|
|
25
25
|
|
|
26
26
|
Parameters
|
|
27
27
|
----------
|
|
28
|
+
axes : Axes
|
|
29
|
+
A *Matplotlib* axes, that is used as plotting area.
|
|
28
30
|
tree : Tree
|
|
29
|
-
The tree to be visualized
|
|
31
|
+
The tree to be visualized.
|
|
30
32
|
orientation : {'left', 'right', 'bottom', 'top'}, optional
|
|
31
33
|
The position of the root node in the plot
|
|
32
34
|
use_distances : bool, optional
|
|
@@ -38,7 +40,7 @@ def plot_dendrogram(
|
|
|
38
40
|
The label of a leaf node is the entry at the position of its
|
|
39
41
|
`index` attribute.
|
|
40
42
|
label_size : float, optional
|
|
41
|
-
The font size of the labels
|
|
43
|
+
The font size of the labels.
|
|
42
44
|
color : tuple or str, optional
|
|
43
45
|
A *Matplotlib* compatible color, that is used to draw the lines
|
|
44
46
|
of the dendrogram.
|
|
@@ -71,7 +71,7 @@ def plot_feature_map(
|
|
|
71
71
|
If true, the sequence position the base/residue of a line is
|
|
72
72
|
shown on the right side of the plot.
|
|
73
73
|
number_size : float, optional
|
|
74
|
-
The font size of the position numbers
|
|
74
|
+
The font size of the position numbers.
|
|
75
75
|
line_width : float, optional
|
|
76
76
|
The size of the continuous line as fraction of the height of
|
|
77
77
|
the drawn features.
|
|
@@ -416,7 +416,7 @@ class PromoterPlotter(FeaturePlotter):
|
|
|
416
416
|
line_width : float, optional
|
|
417
417
|
The width of the curved arrow tail.
|
|
418
418
|
head_width : float, optional
|
|
419
|
-
The width of the arrow head
|
|
419
|
+
The width of the arrow head.
|
|
420
420
|
head_length : float, optional
|
|
421
421
|
The length of the arrow.
|
|
422
422
|
head_height : float, optional
|