biotite 0.39.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 (104) hide show
  1. biotite/__init__.py +3 -3
  2. biotite/application/dssp/app.py +18 -18
  3. biotite/database/rcsb/download.py +19 -14
  4. biotite/sequence/align/banded.c +258 -237
  5. biotite/sequence/align/banded.cpython-311-darwin.so +0 -0
  6. biotite/sequence/align/kmeralphabet.c +243 -222
  7. biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
  8. biotite/sequence/align/kmersimilarity.c +215 -196
  9. biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
  10. biotite/sequence/align/kmertable.cpp +233 -205
  11. biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
  12. biotite/sequence/align/localgapped.c +258 -237
  13. biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
  14. biotite/sequence/align/localungapped.c +235 -214
  15. biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
  16. biotite/sequence/align/multiple.c +255 -234
  17. biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
  18. biotite/sequence/align/pairwise.c +274 -253
  19. biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
  20. biotite/sequence/align/permutation.c +215 -196
  21. biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
  22. biotite/sequence/align/selector.c +217 -197
  23. biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
  24. biotite/sequence/align/tracetable.c +215 -195
  25. biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
  26. biotite/sequence/codec.c +235 -214
  27. biotite/sequence/codec.cpython-311-darwin.so +0 -0
  28. biotite/sequence/phylo/nj.c +215 -196
  29. biotite/sequence/phylo/nj.cpython-311-darwin.so +0 -0
  30. biotite/sequence/phylo/tree.c +227 -202
  31. biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
  32. biotite/sequence/phylo/upgma.c +215 -196
  33. biotite/sequence/phylo/upgma.cpython-311-darwin.so +0 -0
  34. biotite/structure/basepairs.py +7 -12
  35. biotite/structure/bonds.c +1175 -1226
  36. biotite/structure/bonds.cpython-311-darwin.so +0 -0
  37. biotite/structure/celllist.c +217 -197
  38. biotite/structure/celllist.cpython-311-darwin.so +0 -0
  39. biotite/structure/charges.c +1052 -1101
  40. biotite/structure/charges.cpython-311-darwin.so +0 -0
  41. biotite/structure/filter.py +30 -37
  42. biotite/structure/info/__init__.py +5 -8
  43. biotite/structure/info/atoms.py +25 -67
  44. biotite/structure/info/bonds.py +46 -100
  45. biotite/structure/info/ccd/README.rst +8 -0
  46. biotite/structure/info/ccd/amino_acids.txt +1646 -0
  47. biotite/structure/info/ccd/carbohydrates.txt +1133 -0
  48. biotite/structure/info/ccd/components.bcif +0 -0
  49. biotite/structure/info/ccd/nucleotides.txt +797 -0
  50. biotite/structure/info/ccd.py +95 -0
  51. biotite/structure/info/groups.py +90 -0
  52. biotite/structure/info/masses.py +21 -20
  53. biotite/structure/info/misc.py +11 -22
  54. biotite/structure/info/standardize.py +17 -12
  55. biotite/structure/io/__init__.py +2 -4
  56. biotite/structure/io/ctab.py +1 -1
  57. biotite/structure/io/general.py +37 -43
  58. biotite/structure/io/mmtf/__init__.py +3 -0
  59. biotite/structure/io/mmtf/convertarray.c +219 -198
  60. biotite/structure/io/mmtf/convertarray.cpython-311-darwin.so +0 -0
  61. biotite/structure/io/mmtf/convertfile.c +217 -197
  62. biotite/structure/io/mmtf/convertfile.cpython-311-darwin.so +0 -0
  63. biotite/structure/io/mmtf/decode.c +225 -204
  64. biotite/structure/io/mmtf/decode.cpython-311-darwin.so +0 -0
  65. biotite/structure/io/mmtf/encode.c +215 -196
  66. biotite/structure/io/mmtf/encode.cpython-311-darwin.so +0 -0
  67. biotite/structure/io/mmtf/file.py +34 -26
  68. biotite/structure/io/npz/__init__.py +3 -0
  69. biotite/structure/io/npz/file.py +21 -18
  70. biotite/structure/io/pdb/__init__.py +3 -3
  71. biotite/structure/io/pdb/file.py +5 -3
  72. biotite/structure/io/pdb/hybrid36.c +63 -43
  73. biotite/structure/io/pdb/hybrid36.cpython-311-darwin.so +0 -0
  74. biotite/structure/io/pdbqt/file.py +32 -32
  75. biotite/structure/io/pdbx/__init__.py +13 -6
  76. biotite/structure/io/pdbx/bcif.py +649 -0
  77. biotite/structure/io/pdbx/cif.py +1028 -0
  78. biotite/structure/io/pdbx/component.py +243 -0
  79. biotite/structure/io/pdbx/convert.py +707 -359
  80. biotite/structure/io/pdbx/encoding.c +112813 -0
  81. biotite/structure/io/pdbx/encoding.cpython-311-darwin.so +0 -0
  82. biotite/structure/io/pdbx/error.py +14 -0
  83. biotite/structure/io/pdbx/legacy.py +267 -0
  84. biotite/structure/molecules.py +151 -151
  85. biotite/structure/sasa.c +215 -196
  86. biotite/structure/sasa.cpython-311-darwin.so +0 -0
  87. biotite/structure/superimpose.py +158 -115
  88. {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/METADATA +2 -2
  89. {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/RECORD +92 -90
  90. {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/WHEEL +1 -1
  91. biotite/structure/info/amino_acids.json +0 -1556
  92. biotite/structure/info/amino_acids.py +0 -42
  93. biotite/structure/info/carbohydrates.json +0 -1122
  94. biotite/structure/info/carbohydrates.py +0 -39
  95. biotite/structure/info/intra_bonds.msgpack +0 -0
  96. biotite/structure/info/link_types.msgpack +0 -1
  97. biotite/structure/info/nucleotides.json +0 -772
  98. biotite/structure/info/nucleotides.py +0 -39
  99. biotite/structure/info/residue_masses.msgpack +0 -0
  100. biotite/structure/info/residue_names.msgpack +0 -3
  101. biotite/structure/info/residues.msgpack +0 -0
  102. biotite/structure/io/pdbx/file.py +0 -652
  103. {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/LICENSE.rst +0 -0
  104. {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/top_level.txt +0 -0
biotite/__init__.py CHANGED
@@ -9,11 +9,11 @@ it does provide utilities and base classes used by a lot of *Biotite*'s
9
9
  modules.
10
10
  """
11
11
 
12
- __version__ = "0.39.0"
12
+ __version__ = "0.40.0"
13
13
  __name__ = "biotite"
14
14
  __author__ = "Patrick Kunzmann"
15
15
 
16
16
  from .file import *
17
17
  from .temp import *
18
- from .copyable import *
19
- from .visualize import *
18
+ from .copyable import *
19
+ from .visualize import *
@@ -9,7 +9,7 @@ __all__ = ["DsspApp"]
9
9
  from tempfile import NamedTemporaryFile
10
10
  from ..localapp import LocalApp, cleanup_tempfile
11
11
  from ..application import AppState, requires_state
12
- from ...structure.io.pdbx.file import PDBxFile
12
+ from ...structure.io.pdbx.cif import CIFFile
13
13
  from ...structure.io.pdbx.convert import set_structure
14
14
  import numpy as np
15
15
 
@@ -18,13 +18,13 @@ class DsspApp(LocalApp):
18
18
  r"""
19
19
  Annotate the secondary structure of a protein structure using the
20
20
  *DSSP* software.
21
-
21
+
22
22
  Internally this creates a :class:`Popen` instance, which handles
23
23
  the execution.
24
-
24
+
25
25
  DSSP differentiates between 8 different types of secondary
26
26
  structure elements:
27
-
27
+
28
28
  - C: loop, coil or irregular
29
29
  - H: :math:`{\alpha}`-helix
30
30
  - B: :math:`{\beta}`-bridge
@@ -32,15 +32,15 @@ class DsspApp(LocalApp):
32
32
  - G: 3 :sub:`10`-helix
33
33
  - I: :math:`{\pi}`-helix
34
34
  - T: hydrogen bonded turn
35
- - S: bend
36
-
35
+ - S: bend
36
+
37
37
  Parameters
38
38
  ----------
39
39
  atom_array : AtomArray
40
40
  The atom array to be annotated.
41
41
  bin_path : str, optional
42
42
  Path of the *DDSP* binary.
43
-
43
+
44
44
  Examples
45
45
  --------
46
46
 
@@ -51,7 +51,7 @@ class DsspApp(LocalApp):
51
51
  ['C' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'T' 'T' 'G' 'G' 'G' 'G' 'T' 'C' 'C' 'C'
52
52
  'C' 'C']
53
53
  """
54
-
54
+
55
55
  def __init__(self, atom_array, bin_path="mkdssp"):
56
56
  super().__init__(bin_path)
57
57
 
@@ -77,15 +77,15 @@ class DsspApp(LocalApp):
77
77
  self._out_file = NamedTemporaryFile("r", suffix=".dssp", delete=False)
78
78
 
79
79
  def run(self):
80
- in_file = PDBxFile()
81
- set_structure(in_file, self._array, data_block="DSSP_INPUT")
80
+ in_file = CIFFile()
81
+ set_structure(in_file, self._array)
82
82
  in_file.write(self._in_file)
83
83
  self._in_file.flush()
84
84
  self.set_arguments(
85
85
  ["-i", self._in_file.name, "-o", self._out_file.name]
86
86
  )
87
87
  super().run()
88
-
88
+
89
89
  def evaluate(self):
90
90
  super().evaluate()
91
91
  lines = self._out_file.read().split("\n")
@@ -106,17 +106,17 @@ class DsspApp(LocalApp):
106
106
  for i, line in enumerate(lines):
107
107
  self._sse[i] = line[16]
108
108
  self._sse[self._sse == " "] = "C"
109
-
109
+
110
110
  def clean_up(self):
111
111
  super().clean_up()
112
112
  cleanup_tempfile(self._in_file)
113
113
  cleanup_tempfile(self._out_file)
114
-
114
+
115
115
  @requires_state(AppState.JOINED)
116
116
  def get_sse(self):
117
117
  """
118
118
  Get the resulting secondary structure assignment.
119
-
119
+
120
120
  Returns
121
121
  -------
122
122
  sse : ndarray, dtype="U1"
@@ -124,22 +124,22 @@ class DsspApp(LocalApp):
124
124
  corresponding to the residues in the input atom array.
125
125
  """
126
126
  return self._sse
127
-
127
+
128
128
  @staticmethod
129
129
  def annotate_sse(atom_array, bin_path="mkdssp"):
130
130
  """
131
131
  Perform a secondary structure assignment to an atom array.
132
-
132
+
133
133
  This is a convenience function, that wraps the :class:`DsspApp`
134
134
  execution.
135
-
135
+
136
136
  Parameters
137
137
  ----------
138
138
  atom_array : AtomArray
139
139
  The atom array to be annotated.
140
140
  bin_path : str, optional
141
141
  Path of the DDSP binary.
142
-
142
+
143
143
  Returns
144
144
  -------
145
145
  sse : ndarray, dtype="U1"
@@ -16,24 +16,25 @@ from ..error import RequestError
16
16
 
17
17
  _standard_url = "https://files.rcsb.org/download/"
18
18
  _mmtf_url = "https://mmtf.rcsb.org/v1.0/full/"
19
+ _bcif_url = "https://models.rcsb.org/"
19
20
  _fasta_url = "https://www.rcsb.org/fasta/entry/"
20
21
 
21
- _binary_formats = ["mmtf"]
22
+ _binary_formats = ["mmtf", "bcif"]
22
23
 
23
24
 
24
25
  def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
25
26
  """
26
27
  Download structure files (or sequence files) from the RCSB PDB in
27
28
  various formats.
28
-
29
+
29
30
  This function requires an internet connection.
30
-
31
+
31
32
  Parameters
32
33
  ----------
33
34
  pdb_ids : str or iterable object of str
34
35
  A single PDB ID or a list of PDB IDs of the structure(s)
35
36
  to be downloaded.
36
- format : {'pdb', 'pdbx', 'cif', 'mmcif', 'mmtf', 'fasta'}
37
+ format : {'pdb', 'pdbx', 'cif', 'mmcif', 'bcif', 'mmtf', 'fasta'}
37
38
  The format of the files to be downloaded.
38
39
  ``'pdbx'``, ``'cif'`` and ``'mmcif'`` are synonyms for
39
40
  the same format.
@@ -48,7 +49,7 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
48
49
  the file is empty.
49
50
  verbose: bool, optional
50
51
  If set to true, the function will output the download progress.
51
-
52
+
52
53
  Returns
53
54
  -------
54
55
  files : str or StringIO or BytesIO or list of (str or StringIO or BytesIO)
@@ -58,7 +59,7 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
58
59
  object) was given, a list of strings is returned.
59
60
  If no `target_path` was given, the file contents are stored in
60
61
  either :class:`StringIO` or :class:`BytesIO` objects.
61
-
62
+
62
63
  Warnings
63
64
  --------
64
65
  Even if you give valid input to this function, in rare cases the
@@ -66,10 +67,10 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
66
67
  In these cases the request should be retried.
67
68
  When the issue occurs repeatedly, the error is probably in your
68
69
  input.
69
-
70
+
70
71
  Examples
71
72
  --------
72
-
73
+
73
74
  >>> import os.path
74
75
  >>> file = fetch("1l2y", "cif", path_to_directory)
75
76
  >>> print(os.path.basename(file))
@@ -88,21 +89,21 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
88
89
  # Create the target folder, if not existing
89
90
  if target_path is not None and not os.path.isdir(target_path):
90
91
  os.makedirs(target_path)
91
-
92
+
92
93
  files = []
93
94
  for i, id in enumerate(pdb_ids):
94
95
  # Verbose output
95
96
  if verbose:
96
97
  print(f"Fetching file {i+1:d} / {len(pdb_ids):d} ({id})...",
97
98
  end="\r")
98
-
99
+
99
100
  # Fetch file from database
100
101
  if target_path is not None:
101
102
  file = join(target_path, id + "." + format)
102
103
  else:
103
104
  # 'file = None' -> store content in a file-like object
104
105
  file = None
105
-
106
+
106
107
  if file is None \
107
108
  or not isfile(file) \
108
109
  or getsize(file) == 0 \
@@ -115,6 +116,10 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
115
116
  r = requests.get(_standard_url + id + ".cif")
116
117
  content = r.text
117
118
  _assert_valid_file(content, id)
119
+ elif format in ["bcif"]:
120
+ r = requests.get(_bcif_url + id + ".bcif")
121
+ content = r.content
122
+ _assert_valid_file(r.text, id)
118
123
  elif format == "mmtf":
119
124
  r = requests.get(_mmtf_url + id)
120
125
  content = r.content
@@ -125,7 +130,7 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
125
130
  _assert_valid_file(content, id)
126
131
  else:
127
132
  raise ValueError(f"Format '{format}' is not supported")
128
-
133
+
129
134
  if file is None:
130
135
  if format in _binary_formats:
131
136
  file = io.BytesIO(content)
@@ -135,7 +140,7 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
135
140
  mode = "wb+" if format in _binary_formats else "w+"
136
141
  with open(file, mode) as f:
137
142
  f.write(content)
138
-
143
+
139
144
  files.append(file)
140
145
  if verbose:
141
146
  print("\nDone")
@@ -153,7 +158,7 @@ def _assert_valid_file(response_text, pdb_id):
153
158
  """
154
159
  # Structure file and FASTA file retrieval
155
160
  # have different error messages
156
- if any(err_msg in response_text for err_msg in [
161
+ if len(response_text) == 0 or any(err_msg in response_text for err_msg in [
157
162
  "404 Not Found",
158
163
  "<title>RCSB Protein Data Bank Error Page</title>",
159
164
  "No fasta files were found.",