biotite 1.1.0__cp311-cp311-macosx_11_0_arm64.whl → 1.2.0__cp311-cp311-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of biotite might be problematic. Click here for more details.

Files changed (155) hide show
  1. biotite/application/application.py +3 -3
  2. biotite/application/autodock/app.py +1 -1
  3. biotite/application/blast/webapp.py +1 -1
  4. biotite/application/clustalo/app.py +1 -1
  5. biotite/application/localapp.py +2 -2
  6. biotite/application/msaapp.py +10 -10
  7. biotite/application/muscle/app3.py +3 -3
  8. biotite/application/muscle/app5.py +3 -3
  9. biotite/application/sra/app.py +0 -5
  10. biotite/application/util.py +21 -1
  11. biotite/application/viennarna/rnaalifold.py +8 -8
  12. biotite/application/viennarna/rnaplot.py +3 -1
  13. biotite/application/viennarna/util.py +1 -1
  14. biotite/application/webapp.py +1 -1
  15. biotite/database/afdb/__init__.py +12 -0
  16. biotite/database/afdb/download.py +191 -0
  17. biotite/database/entrez/dbnames.py +10 -0
  18. biotite/database/entrez/download.py +9 -10
  19. biotite/database/entrez/key.py +1 -1
  20. biotite/database/entrez/query.py +5 -4
  21. biotite/database/pubchem/download.py +6 -6
  22. biotite/database/pubchem/error.py +10 -0
  23. biotite/database/pubchem/query.py +12 -23
  24. biotite/database/rcsb/download.py +3 -2
  25. biotite/database/rcsb/query.py +2 -3
  26. biotite/database/uniprot/check.py +2 -2
  27. biotite/database/uniprot/download.py +2 -5
  28. biotite/database/uniprot/query.py +3 -4
  29. biotite/file.py +14 -2
  30. biotite/interface/__init__.py +19 -0
  31. biotite/interface/openmm/__init__.py +16 -0
  32. biotite/interface/openmm/state.py +93 -0
  33. biotite/interface/openmm/system.py +227 -0
  34. biotite/interface/pymol/__init__.py +198 -0
  35. biotite/interface/pymol/cgo.py +346 -0
  36. biotite/interface/pymol/convert.py +185 -0
  37. biotite/interface/pymol/display.py +267 -0
  38. biotite/interface/pymol/object.py +1226 -0
  39. biotite/interface/pymol/shapes.py +178 -0
  40. biotite/interface/pymol/startup.py +169 -0
  41. biotite/interface/rdkit/__init__.py +15 -0
  42. biotite/interface/rdkit/mol.py +490 -0
  43. biotite/interface/version.py +71 -0
  44. biotite/interface/warning.py +19 -0
  45. biotite/sequence/align/__init__.py +0 -4
  46. biotite/sequence/align/alignment.py +33 -11
  47. biotite/sequence/align/banded.cpython-311-darwin.so +0 -0
  48. biotite/sequence/align/banded.pyx +21 -21
  49. biotite/sequence/align/cigar.py +2 -2
  50. biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
  51. biotite/sequence/align/kmeralphabet.pyx +2 -2
  52. biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
  53. biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
  54. biotite/sequence/align/kmertable.pyx +6 -6
  55. biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
  56. biotite/sequence/align/localgapped.pyx +47 -47
  57. biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
  58. biotite/sequence/align/localungapped.pyx +10 -10
  59. biotite/sequence/align/matrix.py +12 -3
  60. biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
  61. biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
  62. biotite/sequence/align/pairwise.pyx +35 -35
  63. biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
  64. biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
  65. biotite/sequence/align/selector.pyx +2 -2
  66. biotite/sequence/align/statistics.py +1 -1
  67. biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
  68. biotite/sequence/alphabet.py +2 -2
  69. biotite/sequence/annotation.py +19 -13
  70. biotite/sequence/codec.cpython-311-darwin.so +0 -0
  71. biotite/sequence/codon.py +1 -2
  72. biotite/sequence/graphics/alignment.py +25 -39
  73. biotite/sequence/graphics/dendrogram.py +4 -2
  74. biotite/sequence/graphics/features.py +2 -2
  75. biotite/sequence/graphics/logo.py +10 -12
  76. biotite/sequence/io/fasta/convert.py +1 -2
  77. biotite/sequence/io/fasta/file.py +1 -1
  78. biotite/sequence/io/fastq/file.py +3 -3
  79. biotite/sequence/io/genbank/file.py +3 -3
  80. biotite/sequence/io/genbank/sequence.py +2 -0
  81. biotite/sequence/io/gff/convert.py +1 -1
  82. biotite/sequence/io/gff/file.py +1 -2
  83. biotite/sequence/phylo/nj.cpython-311-darwin.so +0 -0
  84. biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
  85. biotite/sequence/phylo/upgma.cpython-311-darwin.so +0 -0
  86. biotite/sequence/profile.py +19 -25
  87. biotite/sequence/search.py +0 -1
  88. biotite/sequence/seqtypes.py +12 -5
  89. biotite/sequence/sequence.py +1 -2
  90. biotite/structure/__init__.py +2 -0
  91. biotite/structure/alphabet/i3d.py +1 -2
  92. biotite/structure/alphabet/pb.py +1 -2
  93. biotite/structure/alphabet/unkerasify.py +8 -2
  94. biotite/structure/atoms.py +35 -27
  95. biotite/structure/basepairs.py +26 -26
  96. biotite/structure/bonds.cpython-311-darwin.so +0 -0
  97. biotite/structure/bonds.pyx +8 -5
  98. biotite/structure/box.py +19 -21
  99. biotite/structure/celllist.cpython-311-darwin.so +0 -0
  100. biotite/structure/celllist.pyx +83 -67
  101. biotite/structure/chains.py +5 -37
  102. biotite/structure/charges.cpython-311-darwin.so +0 -0
  103. biotite/structure/compare.py +420 -13
  104. biotite/structure/density.py +1 -1
  105. biotite/structure/dotbracket.py +27 -28
  106. biotite/structure/filter.py +8 -8
  107. biotite/structure/geometry.py +15 -15
  108. biotite/structure/hbond.py +17 -19
  109. biotite/structure/info/atoms.py +11 -2
  110. biotite/structure/info/ccd.py +0 -2
  111. biotite/structure/info/components.bcif +0 -0
  112. biotite/structure/info/groups.py +0 -3
  113. biotite/structure/info/misc.py +0 -1
  114. biotite/structure/info/radii.py +92 -22
  115. biotite/structure/info/standardize.py +1 -2
  116. biotite/structure/integrity.py +4 -6
  117. biotite/structure/io/general.py +2 -2
  118. biotite/structure/io/gro/file.py +8 -9
  119. biotite/structure/io/mol/convert.py +1 -1
  120. biotite/structure/io/mol/ctab.py +33 -28
  121. biotite/structure/io/mol/mol.py +1 -1
  122. biotite/structure/io/mol/sdf.py +39 -13
  123. biotite/structure/io/pdb/convert.py +2 -3
  124. biotite/structure/io/pdb/file.py +11 -22
  125. biotite/structure/io/pdb/hybrid36.cpython-311-darwin.so +0 -0
  126. biotite/structure/io/pdbqt/file.py +4 -4
  127. biotite/structure/io/pdbx/bcif.py +22 -7
  128. biotite/structure/io/pdbx/cif.py +20 -7
  129. biotite/structure/io/pdbx/component.py +6 -0
  130. biotite/structure/io/pdbx/compress.py +2 -2
  131. biotite/structure/io/pdbx/convert.py +222 -33
  132. biotite/structure/io/pdbx/encoding.cpython-311-darwin.so +0 -0
  133. biotite/structure/io/trajfile.py +9 -6
  134. biotite/structure/io/util.py +38 -0
  135. biotite/structure/mechanics.py +0 -1
  136. biotite/structure/molecules.py +0 -15
  137. biotite/structure/pseudoknots.py +7 -13
  138. biotite/structure/repair.py +2 -4
  139. biotite/structure/residues.py +13 -24
  140. biotite/structure/rings.py +335 -0
  141. biotite/structure/sasa.cpython-311-darwin.so +0 -0
  142. biotite/structure/sasa.pyx +2 -1
  143. biotite/structure/segments.py +68 -9
  144. biotite/structure/sequence.py +0 -1
  145. biotite/structure/sse.py +0 -2
  146. biotite/structure/superimpose.py +74 -62
  147. biotite/structure/tm.py +581 -0
  148. biotite/structure/transform.py +12 -25
  149. biotite/structure/util.py +3 -3
  150. biotite/version.py +9 -4
  151. biotite/visualize.py +111 -1
  152. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/METADATA +5 -3
  153. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/RECORD +155 -135
  154. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/WHEEL +0 -0
  155. {biotite-1.1.0.dist-info → biotite-1.2.0.dist-info}/licenses/LICENSE.rst +0 -0
@@ -19,6 +19,7 @@ __all__ = [
19
19
  "score",
20
20
  "find_terminal_gaps",
21
21
  "remove_terminal_gaps",
22
+ "remove_gaps",
22
23
  ]
23
24
 
24
25
 
@@ -303,7 +304,7 @@ def get_symbols(alignment):
303
304
 
304
305
  See Also
305
306
  --------
306
- get_codes
307
+ get_codes : Get the sequence codes of the sequences in the alignment.
307
308
 
308
309
  Examples
309
310
  --------
@@ -361,9 +362,9 @@ def get_sequence_identity(alignment, mode="not_terminal"):
361
362
  identity : float
362
363
  The sequence identity, ranging between 0 and 1.
363
364
 
364
- See also
365
+ See Also
365
366
  --------
366
- get_pairwise_sequence_identity
367
+ get_pairwise_sequence_identity : Get sequence identity for each pair of alignment rows.
367
368
  """
368
369
  codes = get_codes(alignment)
369
370
 
@@ -424,9 +425,9 @@ def get_pairwise_sequence_identity(alignment, mode="not_terminal"):
424
425
  identity : ndarray, dtype=float, shape=(n,n)
425
426
  The pairwise sequence identity, ranging between 0 and 1.
426
427
 
427
- See also
428
+ See Also
428
429
  --------
429
- get_sequence_identity
430
+ get_sequence_identity : Get sequence identity over all alignment rows.
430
431
  """
431
432
  codes = get_codes(alignment)
432
433
  n_seq = len(codes)
@@ -489,10 +490,9 @@ def score(alignment, matrix, gap_penalty=-10, terminal_penalty=True):
489
490
  penalty is used. The first integer in the tuple is the gap
490
491
  opening penalty, the second integer is the gap extension
491
492
  penalty.
492
- The values need to be negative. (Default: *-10*)
493
+ The values need to be negative.
493
494
  terminal_penalty : bool, optional
494
495
  If true, gap penalties are applied to terminal gaps.
495
- (Default: True)
496
496
 
497
497
  Returns
498
498
  -------
@@ -569,9 +569,9 @@ def find_terminal_gaps(alignment):
569
569
  When these indices are used as slice index for an alignment or
570
570
  trace, the index would remove terminal gaps.
571
571
 
572
- See also
572
+ See Also
573
573
  --------
574
- remove_terminal_gaps
574
+ remove_terminal_gaps : Remove terminal gap columns directly.
575
575
 
576
576
  Examples
577
577
  --------
@@ -627,9 +627,9 @@ def remove_terminal_gaps(alignment):
627
627
  A shallow copy of the input `alignment` with an truncated trace,
628
628
  that does not contain alignment columns with terminal gaps.
629
629
 
630
- See also
630
+ See Also
631
631
  --------
632
- find_terminal_gaps
632
+ find_terminal_gaps : Only find terminal gap columns.
633
633
 
634
634
  Examples
635
635
  --------
@@ -666,6 +666,28 @@ def remove_terminal_gaps(alignment):
666
666
  return alignment[start:stop]
667
667
 
668
668
 
669
+ def remove_gaps(alignment):
670
+ """
671
+ Remove all gap columns from an alignment.
672
+
673
+ Parameters
674
+ ----------
675
+ alignment : Alignment
676
+ The alignment to be modified.
677
+
678
+ Returns
679
+ -------
680
+ truncated_alignment : Alignment
681
+ The alignment without gap columns.
682
+
683
+ See Also
684
+ --------
685
+ remove_terminal_gaps : Remove only terminal gap columns.
686
+ """
687
+ non_gap_mask = (alignment.trace != -1).all(axis=1)
688
+ return alignment[non_gap_mask]
689
+
690
+
669
691
  def _is_single_letter(alphabet):
670
692
  """
671
693
  More relaxed version of :func:`biotite.sequence.alphabet.is_letter_alphabet()`:
@@ -54,7 +54,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
54
54
  aligned to each other, if :math:`D_L \leq j - i \leq D_U`.
55
55
  With increasing width of the diagonal band, the probability to find
56
56
  the optimal alignment, but also the computation time increases.
57
-
57
+
58
58
  Parameters
59
59
  ----------
60
60
  seq1, seq2 : Sequence
@@ -84,15 +84,15 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
84
84
  The maximum number of alignments returned.
85
85
  When the number of branches exceeds this value in the traceback
86
86
  step, no further branches are created.
87
-
87
+
88
88
  Returns
89
89
  -------
90
90
  alignments : list of Alignment
91
91
  The generated alignments.
92
92
  Each alignment in the list has the same similarity score,
93
93
  which is the maximum score possible within the defined band.
94
-
95
- See also
94
+
95
+ See Also
96
96
  --------
97
97
  align_optimal
98
98
  Guarantees to find the optimal alignment at the cost of greater
@@ -110,7 +110,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
110
110
  yield a more optimal alignment.
111
111
  Considerations on how to find a suitable band width are discussed in
112
112
  :footcite:`Gibrat2018`.
113
-
113
+
114
114
  The restriction to a limited band is the central difference between
115
115
  the banded alignment heuristic and the optimal alignment
116
116
  algorithms :footcite:`Needleman1970, Smith1981`.
@@ -151,12 +151,12 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
151
151
  Filled cells, i.e. cells within the band, are indicated by ``x``.
152
152
  The shorter sequence is always represented by the first dimension
153
153
  of the table in this implementation.
154
-
154
+
155
155
  References
156
156
  ----------
157
-
157
+
158
158
  .. footbibliography::
159
-
159
+
160
160
  Examples
161
161
  --------
162
162
 
@@ -203,7 +203,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
203
203
  raise ValueError(
204
204
  "Maximum number of returned alignments must be at least 1"
205
205
  )
206
-
206
+
207
207
  # The shorter sequence is the one on the left of the matrix
208
208
  # -> shorter sequence is 'seq1'
209
209
  if len(seq2) < len(seq1):
@@ -243,11 +243,11 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
243
243
  trace_table = np.zeros((len(seq1)+1, band_width+2), dtype=np.uint8)
244
244
  code1 = seq1.code
245
245
  code2 = seq2.code
246
-
246
+
247
247
 
248
248
  # Table filling
249
249
  ###############
250
-
250
+
251
251
  # A score value that signals that the respective direction in the
252
252
  # dynamic programming matrix should not be used, since it would be
253
253
  # outside the band
@@ -294,7 +294,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
294
294
  code1, code2, matrix.score_matrix(), trace_table, score_table,
295
295
  lower_diag, upper_diag, gap_penalty, local
296
296
  )
297
-
297
+
298
298
 
299
299
  # Traceback
300
300
  ###########
@@ -383,7 +383,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
383
383
  state_list = np.full(
384
384
  len(i_list), TraceState.NO_STATE, dtype=int
385
385
  )
386
-
386
+
387
387
  # Follow the traces specified in state and indices lists
388
388
  cdef int curr_trace_count
389
389
  for k in range(len(i_list)):
@@ -401,7 +401,7 @@ def align_banded(seq1, seq2, matrix, band, gap_penalty=-10, local=False,
401
401
  curr_trace_count=&curr_trace_count, max_trace_count=max_number,
402
402
  lower_diag=lower_diag, upper_diag=upper_diag
403
403
  )
404
-
404
+
405
405
  # Replace gap entries in trace with -1
406
406
  for i, trace in enumerate(trace_list):
407
407
  trace = np.flip(trace, axis=0)
@@ -459,7 +459,7 @@ def _fill_align_table(CodeType1[:] code1 not None,
459
459
  local
460
460
  Indicates, whether a local alignment should be performed.
461
461
  """
462
-
462
+
463
463
  cdef int i, j
464
464
  cdef int seq_i, seq_j
465
465
  cdef int32 from_diag, from_left, from_top
@@ -488,7 +488,7 @@ def _fill_align_table(CodeType1[:] code1 not None,
488
488
  from_top = score_table[i-1, j+1] + gap_penalty
489
489
 
490
490
  trace = get_trace_linear(from_diag, from_left, from_top, &score)
491
-
491
+
492
492
  # Local alignment specialty:
493
493
  # If score is less than or equal to 0,
494
494
  # then 0 is saved on the field and the trace ends here
@@ -541,7 +541,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
541
541
  local
542
542
  Indicates, whether a local alignment should be performed.
543
543
  """
544
-
544
+
545
545
  cdef int i, j
546
546
  cdef int seq_i, seq_j
547
547
  cdef int32 mm_score, g1m_score, g2m_score
@@ -550,7 +550,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
550
550
  cdef uint8 trace
551
551
  cdef int32 m_score, g1_score, g2_score
552
552
  cdef int32 similarity_score
553
-
553
+
554
554
  # Starts at 1 since the first row and column are already fil
555
555
  for seq_i in range(0, code1.shape[0]):
556
556
  i = seq_i + 1
@@ -572,7 +572,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
572
572
  g1g1_score = g1_table[i, j-1] + gap_ext
573
573
  mg2_score = m_table[i-1, j+1] + gap_open
574
574
  g2g2_score = g2_table[i-1, j+1] + gap_ext
575
-
575
+
576
576
  trace = get_trace_affine(
577
577
  mm_score, g1m_score, g2m_score,
578
578
  mg1_score, g1g1_score,
@@ -600,7 +600,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
600
600
  m_table[i,j] = m_score
601
601
  if g1_score <= 0:
602
602
  trace &= ~(
603
- TraceDirectionAffine.MATCH_TO_GAP_LEFT |
603
+ TraceDirectionAffine.MATCH_TO_GAP_LEFT |
604
604
  TraceDirectionAffine.GAP_LEFT_TO_GAP_LEFT
605
605
  )
606
606
  # g1_table[i,j] remains negative infinity
@@ -623,7 +623,7 @@ def _fill_align_table_affine(CodeType1[:] code1 not None,
623
623
 
624
624
  def get_global_trace_starts(seq1_len, seq2_len, lower_diag, upper_diag):
625
625
  band_width = upper_diag - lower_diag + 1
626
-
626
+
627
627
  j = np.arange(1, band_width + 1)
628
628
  seq_j = j + (seq1_len-1) + lower_diag - 1
629
629
  # Start from the end from the first (shorter) sequence,
@@ -86,7 +86,7 @@ def read_alignment_from_cigar(cigar, position, reference_sequence, segment_seque
86
86
 
87
87
  See Also
88
88
  --------
89
- write_alignment_to_cigar
89
+ write_alignment_to_cigar : The reverse operation.
90
90
 
91
91
  Notes
92
92
  -----
@@ -253,7 +253,7 @@ def write_alignment_to_cigar(
253
253
 
254
254
  See Also
255
255
  --------
256
- read_alignment_from_cigar
256
+ read_alignment_from_cigar : The reverse operation.
257
257
 
258
258
  Notes
259
259
  -----
@@ -267,7 +267,7 @@ class KmerAlphabet(Alphabet):
267
267
  kmer_codes : int or ndarray, dtype=np.int64, shape=(n,)
268
268
  The fused *k-mer* code(s).
269
269
 
270
- See also
270
+ See Also
271
271
  --------
272
272
  split
273
273
  The reverse operation.
@@ -319,7 +319,7 @@ class KmerAlphabet(Alphabet):
319
319
  codes : ndarray, dtype=np.uint64, shape=(k,) or shape=(n,k)
320
320
  The split symbol codes from the base alphabet.
321
321
 
322
- See also
322
+ See Also
323
323
  --------
324
324
  fuse
325
325
  The reverse operation.
@@ -102,7 +102,7 @@ cdef class KmerTable:
102
102
  k : int
103
103
  The length of the *k-mers*.
104
104
 
105
- See also
105
+ See Also
106
106
  --------
107
107
  BucketKmerTable
108
108
 
@@ -308,7 +308,7 @@ cdef class KmerTable:
308
308
  The number of *informative* positions must equal *k*.
309
309
  Refer to :class:`KmerAlphabet` for more details.
310
310
 
311
- See also
311
+ See Also
312
312
  --------
313
313
  from_kmers : The same functionality based on already created *k-mers*
314
314
 
@@ -413,7 +413,7 @@ cdef class KmerTable:
413
413
  is false, is not added to the table.
414
414
  By default, all positions are added.
415
415
 
416
- See also
416
+ See Also
417
417
  --------
418
418
  from_sequences : The same functionality based on undecomposed sequences
419
419
 
@@ -1548,7 +1548,7 @@ cdef class BucketKmerTable:
1548
1548
  n_buckets : int
1549
1549
  The number of buckets, the *k-mers* are divided into.
1550
1550
 
1551
- See also
1551
+ See Also
1552
1552
  --------
1553
1553
  KmerTable
1554
1554
 
@@ -1774,7 +1774,7 @@ cdef class BucketKmerTable:
1774
1774
  purpose.
1775
1775
  By default, a load factor of approximately 0.8 is used.
1776
1776
 
1777
- See also
1777
+ See Also
1778
1778
  --------
1779
1779
  from_kmers : The same functionality based on already created *k-mers*
1780
1780
 
@@ -1892,7 +1892,7 @@ cdef class BucketKmerTable:
1892
1892
  purpose.
1893
1893
  By default, a load factor of approximately 0.8 is used.
1894
1894
 
1895
- See also
1895
+ See Also
1896
1896
  --------
1897
1897
  from_sequences : The same functionality based on undecomposed sequences
1898
1898