biotite 0.38.0__cp311-cp311-macosx_11_0_arm64.whl → 0.40.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 (124) hide show
  1. biotite/__init__.py +3 -3
  2. biotite/application/application.py +33 -28
  3. biotite/application/dssp/app.py +18 -18
  4. biotite/application/sra/__init__.py +5 -0
  5. biotite/application/sra/app.py +337 -55
  6. biotite/database/entrez/__init__.py +2 -1
  7. biotite/database/entrez/check.py +14 -3
  8. biotite/database/entrez/download.py +20 -13
  9. biotite/database/entrez/key.py +44 -0
  10. biotite/database/entrez/query.py +38 -34
  11. biotite/database/pubchem/query.py +44 -44
  12. biotite/database/rcsb/download.py +19 -14
  13. biotite/database/rcsb/query.py +46 -46
  14. biotite/sequence/align/__init__.py +5 -1
  15. biotite/sequence/align/banded.c +1408 -1025
  16. biotite/sequence/align/banded.cpython-311-darwin.so +0 -0
  17. biotite/sequence/align/buckets.py +69 -0
  18. biotite/sequence/align/cigar.py +389 -0
  19. biotite/sequence/align/kmeralphabet.c +3220 -2850
  20. biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
  21. biotite/sequence/align/kmersimilarity.c +713 -663
  22. biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
  23. biotite/sequence/align/kmertable.cpp +68398 -0
  24. biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
  25. biotite/sequence/align/localgapped.c +1507 -1074
  26. biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
  27. biotite/sequence/align/localungapped.c +1143 -833
  28. biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
  29. biotite/sequence/align/multiple.c +1569 -1092
  30. biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
  31. biotite/sequence/align/pairwise.c +1612 -1212
  32. biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
  33. biotite/sequence/align/permutation.c +33259 -0
  34. biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
  35. biotite/sequence/align/primes.txt +821 -0
  36. biotite/sequence/align/{kmertable.c → selector.c} +9129 -16497
  37. biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
  38. biotite/sequence/align/tracetable.c +685 -646
  39. biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
  40. biotite/sequence/codec.c +1159 -841
  41. biotite/sequence/codec.cpython-311-darwin.so +0 -0
  42. biotite/sequence/graphics/alignment.py +212 -2
  43. biotite/sequence/io/genbank/annotation.py +11 -11
  44. biotite/sequence/phylo/nj.c +684 -636
  45. biotite/sequence/phylo/nj.cpython-311-darwin.so +0 -0
  46. biotite/sequence/phylo/tree.c +970 -673
  47. biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
  48. biotite/sequence/phylo/upgma.c +672 -626
  49. biotite/sequence/phylo/upgma.cpython-311-darwin.so +0 -0
  50. biotite/structure/__init__.py +1 -1
  51. biotite/structure/atoms.py +1 -1
  52. biotite/structure/basepairs.py +7 -12
  53. biotite/structure/bonds.c +3861 -3749
  54. biotite/structure/bonds.cpython-311-darwin.so +0 -0
  55. biotite/structure/celllist.c +727 -707
  56. biotite/structure/celllist.cpython-311-darwin.so +0 -0
  57. biotite/structure/charges.c +1561 -1560
  58. biotite/structure/charges.cpython-311-darwin.so +0 -0
  59. biotite/structure/filter.py +30 -37
  60. biotite/structure/info/__init__.py +5 -8
  61. biotite/structure/info/atoms.py +25 -67
  62. biotite/structure/info/bonds.py +46 -100
  63. biotite/structure/info/ccd/README.rst +8 -0
  64. biotite/structure/info/ccd/amino_acids.txt +1646 -0
  65. biotite/structure/info/ccd/carbohydrates.txt +1133 -0
  66. biotite/structure/info/ccd/components.bcif +0 -0
  67. biotite/structure/info/ccd/nucleotides.txt +797 -0
  68. biotite/structure/info/ccd.py +95 -0
  69. biotite/structure/info/groups.py +90 -0
  70. biotite/structure/info/masses.py +21 -20
  71. biotite/structure/info/misc.py +11 -22
  72. biotite/structure/info/standardize.py +17 -12
  73. biotite/structure/io/__init__.py +2 -4
  74. biotite/structure/io/ctab.py +1 -1
  75. biotite/structure/io/general.py +37 -43
  76. biotite/structure/io/mmtf/__init__.py +3 -0
  77. biotite/structure/io/mmtf/convertarray.c +528 -365
  78. biotite/structure/io/mmtf/convertarray.cpython-311-darwin.so +0 -0
  79. biotite/structure/io/mmtf/convertfile.c +725 -676
  80. biotite/structure/io/mmtf/convertfile.cpython-311-darwin.so +0 -0
  81. biotite/structure/io/mmtf/decode.c +1070 -754
  82. biotite/structure/io/mmtf/decode.cpython-311-darwin.so +0 -0
  83. biotite/structure/io/mmtf/encode.c +727 -677
  84. biotite/structure/io/mmtf/encode.cpython-311-darwin.so +0 -0
  85. biotite/structure/io/mmtf/file.py +34 -26
  86. biotite/structure/io/npz/__init__.py +3 -0
  87. biotite/structure/io/npz/file.py +21 -18
  88. biotite/structure/io/pdb/__init__.py +3 -3
  89. biotite/structure/io/pdb/file.py +72 -70
  90. biotite/structure/io/pdb/hybrid36.c +540 -478
  91. biotite/structure/io/pdb/hybrid36.cpython-311-darwin.so +0 -0
  92. biotite/structure/io/pdbqt/file.py +82 -68
  93. biotite/structure/io/pdbx/__init__.py +13 -6
  94. biotite/structure/io/pdbx/bcif.py +649 -0
  95. biotite/structure/io/pdbx/cif.py +1028 -0
  96. biotite/structure/io/pdbx/component.py +243 -0
  97. biotite/structure/io/pdbx/convert.py +707 -359
  98. biotite/structure/io/pdbx/encoding.c +112813 -0
  99. biotite/structure/io/pdbx/encoding.cpython-311-darwin.so +0 -0
  100. biotite/structure/io/pdbx/error.py +14 -0
  101. biotite/structure/io/pdbx/legacy.py +267 -0
  102. biotite/structure/molecules.py +151 -151
  103. biotite/structure/residues.py +40 -40
  104. biotite/structure/sasa.c +713 -644
  105. biotite/structure/sasa.cpython-311-darwin.so +0 -0
  106. biotite/structure/superimpose.py +158 -115
  107. biotite/visualize.py +9 -11
  108. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/METADATA +2 -2
  109. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/RECORD +112 -102
  110. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/WHEEL +1 -1
  111. biotite/structure/info/amino_acids.json +0 -1556
  112. biotite/structure/info/amino_acids.py +0 -42
  113. biotite/structure/info/carbohydrates.json +0 -1122
  114. biotite/structure/info/carbohydrates.py +0 -39
  115. biotite/structure/info/intra_bonds.msgpack +0 -0
  116. biotite/structure/info/link_types.msgpack +0 -1
  117. biotite/structure/info/nucleotides.json +0 -772
  118. biotite/structure/info/nucleotides.py +0 -39
  119. biotite/structure/info/residue_masses.msgpack +0 -0
  120. biotite/structure/info/residue_names.msgpack +0 -3
  121. biotite/structure/info/residues.msgpack +0 -0
  122. biotite/structure/io/pdbx/file.py +0 -652
  123. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/LICENSE.rst +0 -0
  124. {biotite-0.38.0.dist-info → biotite-0.40.0.dist-info}/top_level.txt +0 -0
@@ -12,6 +12,7 @@ import struct
12
12
  import copy
13
13
  import numpy as np
14
14
  import msgpack
15
+ import warnings
15
16
  from ....file import File, is_binary, is_open_compatible
16
17
  from ...error import BadStructureError
17
18
  from .decode import decode_array
@@ -21,7 +22,7 @@ from .encode import encode_array
21
22
  class MMTFFile(File, MutableMapping):
22
23
  """
23
24
  This class represents a MMTF file.
24
-
25
+
25
26
  When reading a file, the *MessagePack* unpacker is used to create
26
27
  a dictionary of the file content.
27
28
  This dictionary is accessed by indexing the :class:`MMTFFile`
@@ -29,10 +30,13 @@ class MMTFFile(File, MutableMapping):
29
30
  If the dictionary value is an encoded array, the value automatically
30
31
  decoded.
31
32
  Decoded arrays are always returned as :class:`ndarray` instances.
32
-
33
+
34
+ DEPRECATED: Use :class:`biotite.structure.io.pdbx.BinaryCIFFile`
35
+ instead.
36
+
33
37
  Examples
34
38
  --------
35
-
39
+
36
40
  >>> import os.path
37
41
  >>> mmtf_file = MMTFFile.read(os.path.join(path_to_structures, "1l2y.mmtf"))
38
42
  >>> print(mmtf_file["title"])
@@ -42,24 +46,28 @@ class MMTFFile(File, MutableMapping):
42
46
  'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A' 'A'
43
47
  'A' 'A']
44
48
  """
45
-
49
+
46
50
  def __init__(self):
51
+ warnings.warn(
52
+ "'MMTFFile' is deprecated, use 'BinaryCIFFile' instead",
53
+ DeprecationWarning
54
+ )
47
55
  super().__init__()
48
56
  self._content = {}
49
57
  self._content["mmtfVersion"] = "1.0.0"
50
58
  self._content["mmtfProducer"] = "UNKNOWN"
51
-
59
+
52
60
  @classmethod
53
61
  def read(self, file):
54
62
  """
55
63
  Read a MMTF file.
56
-
64
+
57
65
  Parameters
58
66
  ----------
59
67
  file : file-like object or str
60
68
  The file to be read.
61
69
  Alternatively a file path can be supplied.
62
-
70
+
63
71
  Returns
64
72
  -------
65
73
  file_object : MMTFFile
@@ -80,11 +88,11 @@ class MMTFFile(File, MutableMapping):
80
88
  file.read(), use_list=True, raw=False
81
89
  )
82
90
  return mmtf_file
83
-
91
+
84
92
  def write(self, file):
85
93
  """
86
94
  Write contents into a MMTF file.
87
-
95
+
88
96
  Parameters
89
97
  ----------
90
98
  file : file-like object or str
@@ -101,20 +109,20 @@ class MMTFFile(File, MutableMapping):
101
109
  if not is_binary(file):
102
110
  raise TypeError("A file opened in 'binary' mode is required")
103
111
  file.write(packed_bytes)
104
-
112
+
105
113
  def __copy_fill__(self, clone):
106
114
  super().__copy_fill__(clone)
107
115
  clone._content = copy.deepcopy(self._content)
108
-
116
+
109
117
  def get_codec(self, key):
110
118
  """
111
119
  Obtain the codec ID of an MMTF encoded value.
112
-
120
+
113
121
  Parameters
114
122
  ----------
115
123
  key : str
116
124
  The key for the potentially encoded value.
117
-
125
+
118
126
  Returns
119
127
  -------
120
128
  codec : int or None
@@ -126,16 +134,16 @@ class MMTFFile(File, MutableMapping):
126
134
  return codec
127
135
  else:
128
136
  return None
129
-
137
+
130
138
  def get_length(self, key):
131
139
  """
132
140
  Obtain the length of an MMTF encoded value.
133
-
141
+
134
142
  Parameters
135
143
  ----------
136
144
  key : str
137
145
  The key for the potentially encoded value.
138
-
146
+
139
147
  Returns
140
148
  -------
141
149
  codec : int or None
@@ -148,16 +156,16 @@ class MMTFFile(File, MutableMapping):
148
156
  return length
149
157
  else:
150
158
  return None
151
-
159
+
152
160
  def get_param(self, key):
153
161
  """
154
162
  Obtain the parameter of an MMTF encoded value.
155
-
163
+
156
164
  Parameters
157
165
  ----------
158
166
  key : str
159
167
  The key for the potentially encoded value.
160
-
168
+
161
169
  Returns
162
170
  -------
163
171
  codec : int or None
@@ -170,7 +178,7 @@ class MMTFFile(File, MutableMapping):
170
178
  return param
171
179
  else:
172
180
  return None
173
-
181
+
174
182
  def set_array(self, key, array, codec, param=0):
175
183
  length = len(array)
176
184
  raw_bytes = encode_array(array, codec, param)
@@ -179,7 +187,7 @@ class MMTFFile(File, MutableMapping):
179
187
  + struct.pack(">i", param) \
180
188
  + raw_bytes
181
189
  self._content[key] = data
182
-
190
+
183
191
  def __getitem__(self, key):
184
192
  data = self._content[key]
185
193
  if isinstance(data, bytes) and data[0] == 0:
@@ -191,22 +199,22 @@ class MMTFFile(File, MutableMapping):
191
199
  return decode_array(codec, raw_bytes, param)
192
200
  else:
193
201
  return data
194
-
202
+
195
203
  def __setitem__(self, key, item):
196
204
  if isinstance(item, np.ndarray):
197
205
  raise TypeError("Arrays that need to be encoded must be addeed "
198
206
  "via 'set_array()'")
199
207
  self._content[key] = item
200
-
208
+
201
209
  def __delitem__(self, key):
202
210
  del self._content[key]
203
-
211
+
204
212
  def __iter__(self):
205
213
  return self._content.__iter__()
206
-
214
+
207
215
  def __len__(self):
208
216
  return len(self._content)
209
-
217
+
210
218
  def __contains__(self, item):
211
219
  return item in self._content
212
220
 
@@ -9,6 +9,9 @@ format is used to store `NumPy` arrays. Since atom arrays and stacks are
9
9
  completely built on `NumPy` arrays, this format is preferable for
10
10
  Biotite internal usage due to fast I/O operations and preservation
11
11
  of all atom annotation arrays.
12
+
13
+ DEPRECATED: Pickle data directly or use
14
+ :class:`biotite.structure.io.pdbx.BinaryCIFFile` instead.
12
15
  """
13
16
 
14
17
  __name__ = "biotite.structure.io.npz"
@@ -15,19 +15,22 @@ from ....file import File, is_binary
15
15
  class NpzFile(File):
16
16
  r"""
17
17
  This class represents a NPZ file, the preferable format for
18
- Biotite internal structure storage.
19
-
18
+ Biotite internal structure storage.
19
+
20
20
  Internally the this class writes/reads all attribute arrays of an
21
21
  :class:`AtomArray` or :class:`AtomArrayStack` using the *NumPy*
22
22
  :func:`save()`/:func:`load()`
23
23
  method. This format offers the fastest I/O operations and completely
24
24
  preserves the content all atom annotation arrays.
25
-
25
+
26
+ DEPRECATED: Pickle data directly or use
27
+ :class:`biotite.structure.io.pdbx.BinaryCIFFile` instead.
28
+
26
29
  Examples
27
30
  --------
28
31
  Load a \\*.npz file, modify the structure and save the new
29
32
  structure into a new file:
30
-
33
+
31
34
  >>> import os.path
32
35
  >>> file = NpzFile.read(os.path.join(path_to_structures, "1l2y.npz"))
33
36
  >>> array_stack = file.get_structure()
@@ -35,30 +38,30 @@ class NpzFile(File):
35
38
  >>> file = NpzFile()
36
39
  >>> file.set_structure(array_stack_mod)
37
40
  >>> file.write(os.path.join(path_to_directory, "1l2y_mod.npz"))
38
-
41
+
39
42
  """
40
-
43
+
41
44
  def __init__(self):
42
45
  super().__init__()
43
46
  self._data_dict = None
44
-
47
+
45
48
  def __copy_fill__(self, clone):
46
49
  super().__copy_fill__(clone)
47
50
  if self._data_dict is not None:
48
51
  for key, value in self._data_dict.items():
49
52
  clone._data_dict[key] = np.copy(value)
50
-
53
+
51
54
  @classmethod
52
55
  def read(cls, file):
53
56
  """
54
57
  Read a NPZ file.
55
-
58
+
56
59
  Parameters
57
60
  ----------
58
61
  file : file-like object or str
59
62
  The file to be read.
60
63
  Alternatively a file path can be supplied.
61
-
64
+
62
65
  Returns
63
66
  -------
64
67
  file_object : NPZFile
@@ -75,11 +78,11 @@ class NpzFile(File):
75
78
  raise TypeError("A file opened in 'binary' mode is required")
76
79
  npz_file._data_dict = dict(np.load(file, allow_pickle=False))
77
80
  return npz_file
78
-
81
+
79
82
  def write(self, file):
80
83
  """
81
84
  Write a NPZ file.
82
-
85
+
83
86
  Parameters
84
87
  ----------
85
88
  file : file-like object or str
@@ -93,15 +96,15 @@ class NpzFile(File):
93
96
  if not is_binary(file):
94
97
  raise TypeError("A file opened in 'binary' mode is required")
95
98
  np.savez(file, **self._data_dict)
96
-
99
+
97
100
  def get_structure(self):
98
101
  """
99
102
  Get an :class:`AtomArray` or :class:`AtomArrayStack` from the
100
103
  file.
101
-
104
+
102
105
  If this method returns an array or stack depends on which type
103
106
  of object was used when the file was written.
104
-
107
+
105
108
  Returns
106
109
  -------
107
110
  array : AtomArray or AtomArrayStack
@@ -117,7 +120,7 @@ class NpzFile(File):
117
120
  array = AtomArrayStack(coord.shape[0], coord.shape[1])
118
121
  else:
119
122
  array = AtomArray(coord.shape[0])
120
-
123
+
121
124
  for key, value in self._data_dict.items():
122
125
  if key == "coord":
123
126
  array.coord = value
@@ -128,12 +131,12 @@ class NpzFile(File):
128
131
  else:
129
132
  array.set_annotation(key, value)
130
133
  return array
131
-
134
+
132
135
  def set_structure(self, array):
133
136
  """
134
137
  Set the :class:`AtomArray` or :class:`AtomArrayStack` for the
135
138
  file.
136
-
139
+
137
140
  Parameters
138
141
  ----------
139
142
  array : AtomArray or AtomArrayStack
@@ -6,11 +6,11 @@
6
6
  This subpackage is used for reading and writing an :class:`AtomArray` or
7
7
  :class:`AtomArrayStack` using the popular PDB format.
8
8
  Since this format has some limitations, it will be completely replaced
9
- someday by the modern PDBx/mmCIF format.
9
+ someday by the modern PDBx format.
10
10
  Therefore this subpackage should only be used, if usage of the
11
- PDBx/mmCIF format is not suitable (e.g. when interfacing
11
+ PDBx (CIF or BinaryCIF) format is not suitable (e.g. when interfacing
12
12
  other software).
13
- In all other cases, usage of the ``pdbx`` subpackage is encouraged.
13
+ In all other cases, usage of the :mod:`pdbx` subpackage is encouraged.
14
14
  """
15
15
 
16
16
  __name__ = "biotite.structure.io.pdb"