biotite 0.39.0__cp312-cp312-win_amd64.whl → 0.40.0__cp312-cp312-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/__init__.py +3 -3
- biotite/application/dssp/app.py +18 -18
- biotite/database/rcsb/download.py +19 -14
- biotite/sequence/align/banded.c +256 -235
- biotite/sequence/align/banded.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/kmeralphabet.c +241 -220
- biotite/sequence/align/kmeralphabet.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/kmersimilarity.c +213 -194
- biotite/sequence/align/kmersimilarity.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/kmertable.cpp +231 -203
- biotite/sequence/align/localgapped.c +256 -235
- biotite/sequence/align/localgapped.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/localungapped.c +233 -212
- biotite/sequence/align/localungapped.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/multiple.c +253 -232
- biotite/sequence/align/multiple.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.c +272 -251
- biotite/sequence/align/pairwise.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/permutation.c +213 -194
- biotite/sequence/align/permutation.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/selector.c +215 -195
- biotite/sequence/align/selector.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/tracetable.c +213 -193
- biotite/sequence/align/tracetable.cp312-win_amd64.pyd +0 -0
- biotite/sequence/codec.c +233 -212
- biotite/sequence/codec.cp312-win_amd64.pyd +0 -0
- biotite/sequence/phylo/nj.c +213 -194
- biotite/sequence/phylo/nj.cp312-win_amd64.pyd +0 -0
- biotite/sequence/phylo/tree.c +225 -200
- biotite/sequence/phylo/tree.cp312-win_amd64.pyd +0 -0
- biotite/sequence/phylo/upgma.c +213 -194
- biotite/sequence/phylo/upgma.cp312-win_amd64.pyd +0 -0
- biotite/structure/basepairs.py +7 -12
- biotite/structure/bonds.c +1173 -1224
- biotite/structure/bonds.cp312-win_amd64.pyd +0 -0
- biotite/structure/celllist.c +215 -195
- biotite/structure/celllist.cp312-win_amd64.pyd +0 -0
- biotite/structure/charges.c +1050 -1099
- biotite/structure/charges.cp312-win_amd64.pyd +0 -0
- biotite/structure/filter.py +30 -37
- biotite/structure/info/__init__.py +5 -8
- biotite/structure/info/atoms.py +25 -67
- biotite/structure/info/bonds.py +46 -100
- biotite/structure/info/ccd/README.rst +8 -0
- biotite/structure/info/ccd/amino_acids.txt +1646 -0
- biotite/structure/info/ccd/carbohydrates.txt +1133 -0
- biotite/structure/info/ccd/components.bcif +0 -0
- biotite/structure/info/ccd/nucleotides.txt +797 -0
- biotite/structure/info/ccd.py +95 -0
- biotite/structure/info/groups.py +90 -0
- biotite/structure/info/masses.py +21 -20
- biotite/structure/info/misc.py +11 -22
- biotite/structure/info/standardize.py +17 -12
- biotite/structure/io/__init__.py +2 -4
- biotite/structure/io/ctab.py +1 -1
- biotite/structure/io/general.py +37 -43
- biotite/structure/io/mmtf/__init__.py +3 -0
- biotite/structure/io/mmtf/convertarray.c +217 -196
- biotite/structure/io/mmtf/convertarray.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/convertfile.c +215 -195
- biotite/structure/io/mmtf/convertfile.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/decode.c +223 -202
- biotite/structure/io/mmtf/decode.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/encode.c +213 -194
- biotite/structure/io/mmtf/encode.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/file.py +34 -26
- biotite/structure/io/npz/__init__.py +3 -0
- biotite/structure/io/npz/file.py +21 -18
- biotite/structure/io/pdb/__init__.py +3 -3
- biotite/structure/io/pdb/file.py +5 -3
- biotite/structure/io/pdb/hybrid36.c +63 -43
- biotite/structure/io/pdb/hybrid36.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/pdbqt/file.py +32 -32
- biotite/structure/io/pdbx/__init__.py +13 -6
- biotite/structure/io/pdbx/bcif.py +649 -0
- biotite/structure/io/pdbx/cif.py +1028 -0
- biotite/structure/io/pdbx/component.py +243 -0
- biotite/structure/io/pdbx/convert.py +707 -359
- biotite/structure/io/pdbx/encoding.c +112803 -0
- biotite/structure/io/pdbx/encoding.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/pdbx/error.py +14 -0
- biotite/structure/io/pdbx/legacy.py +267 -0
- biotite/structure/molecules.py +151 -151
- biotite/structure/sasa.c +213 -194
- biotite/structure/sasa.cp312-win_amd64.pyd +0 -0
- biotite/structure/superimpose.py +158 -115
- {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/METADATA +2 -2
- {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/RECORD +92 -90
- {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/WHEEL +1 -1
- biotite/structure/info/amino_acids.json +0 -1556
- biotite/structure/info/amino_acids.py +0 -42
- biotite/structure/info/carbohydrates.json +0 -1122
- biotite/structure/info/carbohydrates.py +0 -39
- biotite/structure/info/intra_bonds.msgpack +0 -0
- biotite/structure/info/link_types.msgpack +0 -1
- biotite/structure/info/nucleotides.json +0 -772
- biotite/structure/info/nucleotides.py +0 -39
- biotite/structure/info/residue_masses.msgpack +0 -0
- biotite/structure/info/residue_names.msgpack +0 -3
- biotite/structure/info/residues.msgpack +0 -0
- biotite/structure/io/pdbx/file.py +0 -652
- {biotite-0.39.0.dist-info → biotite-0.40.0.dist-info}/LICENSE.rst +0 -0
- {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.
|
|
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 *
|
biotite/application/dssp/app.py
CHANGED
|
@@ -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.
|
|
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 =
|
|
81
|
-
set_structure(in_file, self._array
|
|
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.",
|