biotite 0.40.0__cp312-cp312-win_amd64.whl → 0.41.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 +1 -1
- biotite/database/pubchem/download.py +23 -23
- biotite/database/pubchem/query.py +7 -7
- biotite/file.py +17 -9
- biotite/sequence/align/banded.c +117 -117
- biotite/sequence/align/banded.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/cigar.py +60 -15
- biotite/sequence/align/kmeralphabet.c +117 -117
- biotite/sequence/align/kmeralphabet.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/kmersimilarity.c +117 -117
- 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 +117 -117
- biotite/sequence/align/localgapped.c +117 -117
- biotite/sequence/align/localgapped.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/localungapped.c +117 -117
- biotite/sequence/align/localungapped.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/multiple.c +117 -117
- biotite/sequence/align/multiple.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/pairwise.c +117 -117
- biotite/sequence/align/pairwise.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/permutation.c +117 -117
- biotite/sequence/align/permutation.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/selector.c +117 -117
- biotite/sequence/align/selector.cp312-win_amd64.pyd +0 -0
- biotite/sequence/align/tracetable.c +117 -117
- biotite/sequence/align/tracetable.cp312-win_amd64.pyd +0 -0
- biotite/sequence/annotation.py +2 -2
- biotite/sequence/codec.c +117 -117
- biotite/sequence/codec.cp312-win_amd64.pyd +0 -0
- biotite/sequence/io/fasta/convert.py +27 -24
- biotite/sequence/phylo/nj.c +117 -117
- biotite/sequence/phylo/nj.cp312-win_amd64.pyd +0 -0
- biotite/sequence/phylo/tree.c +117 -117
- biotite/sequence/phylo/tree.cp312-win_amd64.pyd +0 -0
- biotite/sequence/phylo/upgma.c +117 -117
- biotite/sequence/phylo/upgma.cp312-win_amd64.pyd +0 -0
- biotite/structure/__init__.py +2 -0
- biotite/structure/bonds.c +1122 -913
- biotite/structure/bonds.cp312-win_amd64.pyd +0 -0
- biotite/structure/celllist.c +117 -117
- biotite/structure/celllist.cp312-win_amd64.pyd +0 -0
- biotite/structure/charges.c +117 -117
- biotite/structure/charges.cp312-win_amd64.pyd +0 -0
- biotite/structure/dotbracket.py +2 -0
- biotite/structure/info/atoms.py +6 -1
- biotite/structure/info/bonds.py +1 -1
- biotite/structure/info/ccd/amino_acids.txt +17 -0
- biotite/structure/info/ccd/carbohydrates.txt +2 -0
- biotite/structure/info/ccd/components.bcif +0 -0
- biotite/structure/info/ccd/nucleotides.txt +1 -0
- biotite/structure/info/misc.py +69 -5
- biotite/structure/integrity.py +19 -70
- biotite/structure/io/ctab.py +12 -106
- biotite/structure/io/general.py +157 -165
- biotite/structure/io/gro/file.py +16 -16
- biotite/structure/io/mmtf/convertarray.c +117 -117
- biotite/structure/io/mmtf/convertarray.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/convertfile.c +117 -117
- biotite/structure/io/mmtf/convertfile.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/decode.c +117 -117
- biotite/structure/io/mmtf/decode.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mmtf/encode.c +117 -117
- biotite/structure/io/mmtf/encode.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/mol/__init__.py +4 -2
- biotite/structure/io/mol/convert.py +71 -7
- biotite/structure/io/mol/ctab.py +414 -0
- biotite/structure/io/mol/header.py +116 -0
- biotite/structure/io/mol/{file.py → mol.py} +69 -82
- biotite/structure/io/mol/sdf.py +909 -0
- biotite/structure/io/pdb/file.py +84 -31
- biotite/structure/io/pdb/hybrid36.cp312-win_amd64.pyd +0 -0
- biotite/structure/io/pdbx/__init__.py +0 -1
- biotite/structure/io/pdbx/bcif.py +2 -3
- biotite/structure/io/pdbx/cif.py +9 -5
- biotite/structure/io/pdbx/component.py +4 -1
- biotite/structure/io/pdbx/convert.py +203 -79
- biotite/structure/io/pdbx/encoding.c +117 -117
- biotite/structure/io/pdbx/encoding.cp312-win_amd64.pyd +0 -0
- biotite/structure/repair.py +253 -0
- biotite/structure/sasa.c +117 -117
- biotite/structure/sasa.cp312-win_amd64.pyd +0 -0
- biotite/structure/sequence.py +112 -0
- biotite/structure/superimpose.py +472 -13
- {biotite-0.40.0.dist-info → biotite-0.41.0.dist-info}/METADATA +2 -2
- {biotite-0.40.0.dist-info → biotite-0.41.0.dist-info}/RECORD +89 -85
- biotite/structure/io/pdbx/error.py +0 -14
- {biotite-0.40.0.dist-info → biotite-0.41.0.dist-info}/LICENSE.rst +0 -0
- {biotite-0.40.0.dist-info → biotite-0.41.0.dist-info}/WHEEL +0 -0
- {biotite-0.40.0.dist-info → biotite-0.41.0.dist-info}/top_level.txt +0 -0
|
@@ -6,25 +6,21 @@ __name__ = "biotite.structure.io.mol"
|
|
|
6
6
|
__author__ = "Patrick Kunzmann"
|
|
7
7
|
__all__ = ["MOLFile"]
|
|
8
8
|
|
|
9
|
-
import datetime
|
|
10
|
-
from warnings import warn
|
|
11
|
-
import numpy as np
|
|
12
|
-
from ...atoms import AtomArray
|
|
13
9
|
from ....file import TextFile, InvalidFileError
|
|
14
|
-
from
|
|
15
|
-
from
|
|
10
|
+
from .ctab import read_structure_from_ctab, write_structure_to_ctab
|
|
11
|
+
from .header import Header
|
|
16
12
|
from ...bonds import BondType
|
|
17
13
|
|
|
18
14
|
|
|
19
15
|
# Number of header lines
|
|
20
16
|
N_HEADER = 3
|
|
21
|
-
DATE_FORMAT = "%m%d%y%H%M"
|
|
22
17
|
|
|
23
18
|
|
|
24
19
|
class MOLFile(TextFile):
|
|
25
20
|
"""
|
|
26
21
|
This class represents a file in MOL format, that is used to store
|
|
27
|
-
structure information for small molecules.
|
|
22
|
+
structure information for small molecules.
|
|
23
|
+
:footcite:`Dalby1992`
|
|
28
24
|
|
|
29
25
|
Since its use is intended for single small molecules, it stores
|
|
30
26
|
less atom annotation information than the macromolecular structure
|
|
@@ -35,6 +31,11 @@ class MOLFile(TextFile):
|
|
|
35
31
|
This class can also be used to parse the first structure from an SDF
|
|
36
32
|
file, as the SDF format extends the MOL format.
|
|
37
33
|
|
|
34
|
+
Attributes
|
|
35
|
+
----------
|
|
36
|
+
header : Header
|
|
37
|
+
The header of the MOL file.
|
|
38
|
+
|
|
38
39
|
References
|
|
39
40
|
----------
|
|
40
41
|
|
|
@@ -77,88 +78,66 @@ class MOLFile(TextFile):
|
|
|
77
78
|
super().__init__()
|
|
78
79
|
# empty header lines
|
|
79
80
|
self.lines = [""] * N_HEADER
|
|
81
|
+
self._header = None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def read(cls, file):
|
|
86
|
+
mol_file = super().read(file)
|
|
87
|
+
mol_file._header = None
|
|
88
|
+
return mol_file
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def header(self):
|
|
93
|
+
if self._header is None:
|
|
94
|
+
self._header = Header.deserialize("\n".join(self.lines[0:3]) + "\n")
|
|
95
|
+
return self._header
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@header.setter
|
|
99
|
+
def header(self, header):
|
|
100
|
+
self._header = header
|
|
101
|
+
self.lines[0:3] = self._header.serialize().splitlines()
|
|
102
|
+
|
|
80
103
|
|
|
81
104
|
def get_header(self):
|
|
82
105
|
"""
|
|
83
106
|
Get the header from the MOL file.
|
|
84
107
|
|
|
108
|
+
DEPRECATED: Use the :attr:`header` property instead.
|
|
109
|
+
|
|
85
110
|
Returns
|
|
86
111
|
-------
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
initials : str
|
|
90
|
-
The author's initials.
|
|
91
|
-
program : str
|
|
92
|
-
The program name.
|
|
93
|
-
time : datetime
|
|
94
|
-
The time of file creation.
|
|
95
|
-
dimensions : str
|
|
96
|
-
Dimensional codes.
|
|
97
|
-
scaling_factors : str
|
|
98
|
-
Scaling factors.
|
|
99
|
-
energy : str
|
|
100
|
-
Energy from modeling program.
|
|
101
|
-
registry_number : str
|
|
102
|
-
MDL registry number.
|
|
103
|
-
comments : str
|
|
104
|
-
Additional comments.
|
|
112
|
+
header_attributes
|
|
113
|
+
See :class:`Header`.
|
|
105
114
|
"""
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
def set_header(self,
|
|
121
|
-
dimensions="", scaling_factors="", energy="",
|
|
122
|
-
registry_number="", comments=""):
|
|
115
|
+
header = self.header
|
|
116
|
+
return (
|
|
117
|
+
header.mol_name,
|
|
118
|
+
header.initials,
|
|
119
|
+
header.program,
|
|
120
|
+
header.time,
|
|
121
|
+
header.dimensions,
|
|
122
|
+
header.scaling_factors,
|
|
123
|
+
header.energy,
|
|
124
|
+
header.registry_number,
|
|
125
|
+
header.comments
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def set_header(self, *args, **kwargs):
|
|
123
130
|
"""
|
|
124
131
|
Set the header for the MOL file.
|
|
125
132
|
|
|
133
|
+
DEPRECATED: Use the :attr:`header` property instead.
|
|
134
|
+
|
|
126
135
|
Parameters
|
|
127
136
|
----------
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
initials : str, optional
|
|
131
|
-
The author's initials. Maximum length is 2.
|
|
132
|
-
program : str, optional
|
|
133
|
-
The program name. Maximum length is 8.
|
|
134
|
-
time : datetime or date, optional
|
|
135
|
-
The time of file creation.
|
|
136
|
-
dimensions : str, optional
|
|
137
|
-
Dimensional codes. Maximum length is 2.
|
|
138
|
-
scaling_factors : str, optional
|
|
139
|
-
Scaling factors. Maximum length is 12.
|
|
140
|
-
energy : str, optional
|
|
141
|
-
Energy from modeling program. Maximum length is 12.
|
|
142
|
-
registry_number : str, optional
|
|
143
|
-
MDL registry number. Maximum length is 6.
|
|
144
|
-
comments : str, optional
|
|
145
|
-
Additional comments.
|
|
137
|
+
**args, **kwars
|
|
138
|
+
See :class:`Header`.
|
|
146
139
|
"""
|
|
147
|
-
|
|
148
|
-
time = datetime.datetime.now()
|
|
149
|
-
time_str = time.strftime(DATE_FORMAT)
|
|
150
|
-
|
|
151
|
-
self.lines[0] = str(mol_name)
|
|
152
|
-
self.lines[1] = (
|
|
153
|
-
f"{initials:>2}"
|
|
154
|
-
f"{program:>8}"
|
|
155
|
-
f"{time_str:>10}"
|
|
156
|
-
f"{dimensions:>2}"
|
|
157
|
-
f"{scaling_factors:>12}"
|
|
158
|
-
f"{energy:>12}"
|
|
159
|
-
f"{registry_number:>6}"
|
|
160
|
-
)
|
|
161
|
-
self.lines[2] = str(comments)
|
|
140
|
+
self.header = Header(*args, **kwargs)
|
|
162
141
|
|
|
163
142
|
|
|
164
143
|
def get_structure(self):
|
|
@@ -179,7 +158,8 @@ class MOLFile(TextFile):
|
|
|
179
158
|
return read_structure_from_ctab(ctab_lines)
|
|
180
159
|
|
|
181
160
|
|
|
182
|
-
def set_structure(self, atoms, default_bond_type=BondType.ANY
|
|
161
|
+
def set_structure(self, atoms, default_bond_type=BondType.ANY,
|
|
162
|
+
version=None):
|
|
183
163
|
"""
|
|
184
164
|
Set the :class:`AtomArray` for the file.
|
|
185
165
|
|
|
@@ -188,17 +168,24 @@ class MOLFile(TextFile):
|
|
|
188
168
|
array : AtomArray
|
|
189
169
|
The array to be saved into this file.
|
|
190
170
|
Must have an associated :class:`BondList`.
|
|
191
|
-
default_bond_type : BondType
|
|
192
|
-
Bond type fallback
|
|
193
|
-
|
|
171
|
+
default_bond_type : BondType, optional
|
|
172
|
+
Bond type fallback for the *Bond block*, if a
|
|
173
|
+
:class:`BondType` has no CTAB counterpart.
|
|
174
|
+
By default, each such bond is treated as
|
|
194
175
|
:attr:`BondType.ANY`.
|
|
176
|
+
version : {"V2000", "V3000"}, optional
|
|
177
|
+
The version of the CTAB format.
|
|
178
|
+
``"V2000"`` uses the *Atom* and *Bond* block, while
|
|
179
|
+
``"V3000"`` uses the *Properties* block.
|
|
180
|
+
By default, ``"V2000"`` is used, unless the number of atoms
|
|
181
|
+
or bonds exceeds 999, in which case ``"V3000"`` is used.
|
|
195
182
|
"""
|
|
196
183
|
self.lines = self.lines[:N_HEADER] + write_structure_to_ctab(
|
|
197
|
-
atoms,
|
|
198
|
-
default_bond_type
|
|
184
|
+
atoms, default_bond_type, version
|
|
199
185
|
)
|
|
200
186
|
|
|
201
187
|
|
|
188
|
+
|
|
202
189
|
def _get_ctab_lines(lines):
|
|
203
190
|
for i, line in enumerate(lines):
|
|
204
191
|
if line.startswith("M END"):
|