biotite 0.41.1__cp311-cp311-macosx_10_16_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 (340) hide show
  1. biotite/__init__.py +19 -0
  2. biotite/application/__init__.py +43 -0
  3. biotite/application/application.py +265 -0
  4. biotite/application/autodock/__init__.py +12 -0
  5. biotite/application/autodock/app.py +505 -0
  6. biotite/application/blast/__init__.py +14 -0
  7. biotite/application/blast/alignment.py +83 -0
  8. biotite/application/blast/webapp.py +421 -0
  9. biotite/application/clustalo/__init__.py +12 -0
  10. biotite/application/clustalo/app.py +238 -0
  11. biotite/application/dssp/__init__.py +12 -0
  12. biotite/application/dssp/app.py +152 -0
  13. biotite/application/localapp.py +306 -0
  14. biotite/application/mafft/__init__.py +12 -0
  15. biotite/application/mafft/app.py +122 -0
  16. biotite/application/msaapp.py +374 -0
  17. biotite/application/muscle/__init__.py +13 -0
  18. biotite/application/muscle/app3.py +254 -0
  19. biotite/application/muscle/app5.py +171 -0
  20. biotite/application/sra/__init__.py +18 -0
  21. biotite/application/sra/app.py +456 -0
  22. biotite/application/tantan/__init__.py +12 -0
  23. biotite/application/tantan/app.py +222 -0
  24. biotite/application/util.py +59 -0
  25. biotite/application/viennarna/__init__.py +18 -0
  26. biotite/application/viennarna/rnaalifold.py +304 -0
  27. biotite/application/viennarna/rnafold.py +269 -0
  28. biotite/application/viennarna/rnaplot.py +187 -0
  29. biotite/application/viennarna/util.py +72 -0
  30. biotite/application/webapp.py +77 -0
  31. biotite/copyable.py +71 -0
  32. biotite/database/__init__.py +23 -0
  33. biotite/database/entrez/__init__.py +15 -0
  34. biotite/database/entrez/check.py +61 -0
  35. biotite/database/entrez/dbnames.py +89 -0
  36. biotite/database/entrez/download.py +223 -0
  37. biotite/database/entrez/key.py +44 -0
  38. biotite/database/entrez/query.py +223 -0
  39. biotite/database/error.py +15 -0
  40. biotite/database/pubchem/__init__.py +21 -0
  41. biotite/database/pubchem/download.py +260 -0
  42. biotite/database/pubchem/error.py +20 -0
  43. biotite/database/pubchem/query.py +827 -0
  44. biotite/database/pubchem/throttle.py +99 -0
  45. biotite/database/rcsb/__init__.py +13 -0
  46. biotite/database/rcsb/download.py +167 -0
  47. biotite/database/rcsb/query.py +959 -0
  48. biotite/database/uniprot/__init__.py +13 -0
  49. biotite/database/uniprot/check.py +32 -0
  50. biotite/database/uniprot/download.py +134 -0
  51. biotite/database/uniprot/query.py +209 -0
  52. biotite/file.py +251 -0
  53. biotite/sequence/__init__.py +73 -0
  54. biotite/sequence/align/__init__.py +49 -0
  55. biotite/sequence/align/alignment.py +658 -0
  56. biotite/sequence/align/banded.cpython-311-darwin.so +0 -0
  57. biotite/sequence/align/banded.pyx +652 -0
  58. biotite/sequence/align/buckets.py +69 -0
  59. biotite/sequence/align/cigar.py +434 -0
  60. biotite/sequence/align/kmeralphabet.cpython-311-darwin.so +0 -0
  61. biotite/sequence/align/kmeralphabet.pyx +574 -0
  62. biotite/sequence/align/kmersimilarity.cpython-311-darwin.so +0 -0
  63. biotite/sequence/align/kmersimilarity.pyx +233 -0
  64. biotite/sequence/align/kmertable.cpython-311-darwin.so +0 -0
  65. biotite/sequence/align/kmertable.pyx +3400 -0
  66. biotite/sequence/align/localgapped.cpython-311-darwin.so +0 -0
  67. biotite/sequence/align/localgapped.pyx +892 -0
  68. biotite/sequence/align/localungapped.cpython-311-darwin.so +0 -0
  69. biotite/sequence/align/localungapped.pyx +279 -0
  70. biotite/sequence/align/matrix.py +405 -0
  71. biotite/sequence/align/matrix_data/BLOSUM100.mat +31 -0
  72. biotite/sequence/align/matrix_data/BLOSUM30.mat +31 -0
  73. biotite/sequence/align/matrix_data/BLOSUM35.mat +31 -0
  74. biotite/sequence/align/matrix_data/BLOSUM40.mat +31 -0
  75. biotite/sequence/align/matrix_data/BLOSUM45.mat +31 -0
  76. biotite/sequence/align/matrix_data/BLOSUM50.mat +31 -0
  77. biotite/sequence/align/matrix_data/BLOSUM50_13p.mat +25 -0
  78. biotite/sequence/align/matrix_data/BLOSUM50_14.3.mat +25 -0
  79. biotite/sequence/align/matrix_data/BLOSUM50_5.0.mat +25 -0
  80. biotite/sequence/align/matrix_data/BLOSUM55.mat +31 -0
  81. biotite/sequence/align/matrix_data/BLOSUM60.mat +31 -0
  82. biotite/sequence/align/matrix_data/BLOSUM62.mat +31 -0
  83. biotite/sequence/align/matrix_data/BLOSUM62_13p.mat +25 -0
  84. biotite/sequence/align/matrix_data/BLOSUM62_14.3.mat +25 -0
  85. biotite/sequence/align/matrix_data/BLOSUM62_5.0.mat +25 -0
  86. biotite/sequence/align/matrix_data/BLOSUM65.mat +31 -0
  87. biotite/sequence/align/matrix_data/BLOSUM70.mat +31 -0
  88. biotite/sequence/align/matrix_data/BLOSUM75.mat +31 -0
  89. biotite/sequence/align/matrix_data/BLOSUM80.mat +31 -0
  90. biotite/sequence/align/matrix_data/BLOSUM85.mat +31 -0
  91. biotite/sequence/align/matrix_data/BLOSUM90.mat +31 -0
  92. biotite/sequence/align/matrix_data/BLOSUMN.mat +31 -0
  93. biotite/sequence/align/matrix_data/CorBLOSUM49_5.0.mat +25 -0
  94. biotite/sequence/align/matrix_data/CorBLOSUM57_13p.mat +25 -0
  95. biotite/sequence/align/matrix_data/CorBLOSUM57_14.3.mat +25 -0
  96. biotite/sequence/align/matrix_data/CorBLOSUM61_5.0.mat +25 -0
  97. biotite/sequence/align/matrix_data/CorBLOSUM66_13p.mat +25 -0
  98. biotite/sequence/align/matrix_data/CorBLOSUM67_14.3.mat +25 -0
  99. biotite/sequence/align/matrix_data/DAYHOFF.mat +32 -0
  100. biotite/sequence/align/matrix_data/GONNET.mat +26 -0
  101. biotite/sequence/align/matrix_data/IDENTITY.mat +25 -0
  102. biotite/sequence/align/matrix_data/MATCH.mat +25 -0
  103. biotite/sequence/align/matrix_data/NUC.mat +25 -0
  104. biotite/sequence/align/matrix_data/PAM10.mat +34 -0
  105. biotite/sequence/align/matrix_data/PAM100.mat +34 -0
  106. biotite/sequence/align/matrix_data/PAM110.mat +34 -0
  107. biotite/sequence/align/matrix_data/PAM120.mat +34 -0
  108. biotite/sequence/align/matrix_data/PAM130.mat +34 -0
  109. biotite/sequence/align/matrix_data/PAM140.mat +34 -0
  110. biotite/sequence/align/matrix_data/PAM150.mat +34 -0
  111. biotite/sequence/align/matrix_data/PAM160.mat +34 -0
  112. biotite/sequence/align/matrix_data/PAM170.mat +34 -0
  113. biotite/sequence/align/matrix_data/PAM180.mat +34 -0
  114. biotite/sequence/align/matrix_data/PAM190.mat +34 -0
  115. biotite/sequence/align/matrix_data/PAM20.mat +34 -0
  116. biotite/sequence/align/matrix_data/PAM200.mat +34 -0
  117. biotite/sequence/align/matrix_data/PAM210.mat +34 -0
  118. biotite/sequence/align/matrix_data/PAM220.mat +34 -0
  119. biotite/sequence/align/matrix_data/PAM230.mat +34 -0
  120. biotite/sequence/align/matrix_data/PAM240.mat +34 -0
  121. biotite/sequence/align/matrix_data/PAM250.mat +34 -0
  122. biotite/sequence/align/matrix_data/PAM260.mat +34 -0
  123. biotite/sequence/align/matrix_data/PAM270.mat +34 -0
  124. biotite/sequence/align/matrix_data/PAM280.mat +34 -0
  125. biotite/sequence/align/matrix_data/PAM290.mat +34 -0
  126. biotite/sequence/align/matrix_data/PAM30.mat +34 -0
  127. biotite/sequence/align/matrix_data/PAM300.mat +34 -0
  128. biotite/sequence/align/matrix_data/PAM310.mat +34 -0
  129. biotite/sequence/align/matrix_data/PAM320.mat +34 -0
  130. biotite/sequence/align/matrix_data/PAM330.mat +34 -0
  131. biotite/sequence/align/matrix_data/PAM340.mat +34 -0
  132. biotite/sequence/align/matrix_data/PAM350.mat +34 -0
  133. biotite/sequence/align/matrix_data/PAM360.mat +34 -0
  134. biotite/sequence/align/matrix_data/PAM370.mat +34 -0
  135. biotite/sequence/align/matrix_data/PAM380.mat +34 -0
  136. biotite/sequence/align/matrix_data/PAM390.mat +34 -0
  137. biotite/sequence/align/matrix_data/PAM40.mat +34 -0
  138. biotite/sequence/align/matrix_data/PAM400.mat +34 -0
  139. biotite/sequence/align/matrix_data/PAM410.mat +34 -0
  140. biotite/sequence/align/matrix_data/PAM420.mat +34 -0
  141. biotite/sequence/align/matrix_data/PAM430.mat +34 -0
  142. biotite/sequence/align/matrix_data/PAM440.mat +34 -0
  143. biotite/sequence/align/matrix_data/PAM450.mat +34 -0
  144. biotite/sequence/align/matrix_data/PAM460.mat +34 -0
  145. biotite/sequence/align/matrix_data/PAM470.mat +34 -0
  146. biotite/sequence/align/matrix_data/PAM480.mat +34 -0
  147. biotite/sequence/align/matrix_data/PAM490.mat +34 -0
  148. biotite/sequence/align/matrix_data/PAM50.mat +34 -0
  149. biotite/sequence/align/matrix_data/PAM500.mat +34 -0
  150. biotite/sequence/align/matrix_data/PAM60.mat +34 -0
  151. biotite/sequence/align/matrix_data/PAM70.mat +34 -0
  152. biotite/sequence/align/matrix_data/PAM80.mat +34 -0
  153. biotite/sequence/align/matrix_data/PAM90.mat +34 -0
  154. biotite/sequence/align/matrix_data/RBLOSUM52_5.0.mat +25 -0
  155. biotite/sequence/align/matrix_data/RBLOSUM59_13p.mat +25 -0
  156. biotite/sequence/align/matrix_data/RBLOSUM59_14.3.mat +25 -0
  157. biotite/sequence/align/matrix_data/RBLOSUM64_5.0.mat +25 -0
  158. biotite/sequence/align/matrix_data/RBLOSUM69_13p.mat +25 -0
  159. biotite/sequence/align/matrix_data/RBLOSUM69_14.3.mat +25 -0
  160. biotite/sequence/align/multiple.cpython-311-darwin.so +0 -0
  161. biotite/sequence/align/multiple.pyx +620 -0
  162. biotite/sequence/align/pairwise.cpython-311-darwin.so +0 -0
  163. biotite/sequence/align/pairwise.pyx +587 -0
  164. biotite/sequence/align/permutation.cpython-311-darwin.so +0 -0
  165. biotite/sequence/align/permutation.pyx +305 -0
  166. biotite/sequence/align/primes.txt +821 -0
  167. biotite/sequence/align/selector.cpython-311-darwin.so +0 -0
  168. biotite/sequence/align/selector.pyx +956 -0
  169. biotite/sequence/align/statistics.py +265 -0
  170. biotite/sequence/align/tracetable.cpython-311-darwin.so +0 -0
  171. biotite/sequence/align/tracetable.pxd +64 -0
  172. biotite/sequence/align/tracetable.pyx +370 -0
  173. biotite/sequence/alphabet.py +566 -0
  174. biotite/sequence/annotation.py +829 -0
  175. biotite/sequence/codec.cpython-311-darwin.so +0 -0
  176. biotite/sequence/codec.pyx +155 -0
  177. biotite/sequence/codon.py +466 -0
  178. biotite/sequence/codon_tables.txt +202 -0
  179. biotite/sequence/graphics/__init__.py +33 -0
  180. biotite/sequence/graphics/alignment.py +1034 -0
  181. biotite/sequence/graphics/color_schemes/autumn.json +51 -0
  182. biotite/sequence/graphics/color_schemes/blossom.json +51 -0
  183. biotite/sequence/graphics/color_schemes/clustalx_dna.json +11 -0
  184. biotite/sequence/graphics/color_schemes/clustalx_protein.json +28 -0
  185. biotite/sequence/graphics/color_schemes/flower.json +51 -0
  186. biotite/sequence/graphics/color_schemes/jalview_buried.json +31 -0
  187. biotite/sequence/graphics/color_schemes/jalview_hydrophobicity.json +31 -0
  188. biotite/sequence/graphics/color_schemes/jalview_prop_helix.json +31 -0
  189. biotite/sequence/graphics/color_schemes/jalview_prop_strand.json +31 -0
  190. biotite/sequence/graphics/color_schemes/jalview_prop_turn.json +31 -0
  191. biotite/sequence/graphics/color_schemes/jalview_taylor.json +28 -0
  192. biotite/sequence/graphics/color_schemes/jalview_zappo.json +28 -0
  193. biotite/sequence/graphics/color_schemes/ocean.json +51 -0
  194. biotite/sequence/graphics/color_schemes/pb_flower.json +39 -0
  195. biotite/sequence/graphics/color_schemes/rainbow_dna.json +11 -0
  196. biotite/sequence/graphics/color_schemes/rainbow_protein.json +30 -0
  197. biotite/sequence/graphics/color_schemes/spring.json +51 -0
  198. biotite/sequence/graphics/color_schemes/sunset.json +51 -0
  199. biotite/sequence/graphics/color_schemes/wither.json +51 -0
  200. biotite/sequence/graphics/colorschemes.py +139 -0
  201. biotite/sequence/graphics/dendrogram.py +184 -0
  202. biotite/sequence/graphics/features.py +510 -0
  203. biotite/sequence/graphics/logo.py +110 -0
  204. biotite/sequence/graphics/plasmid.py +661 -0
  205. biotite/sequence/io/__init__.py +12 -0
  206. biotite/sequence/io/fasta/__init__.py +22 -0
  207. biotite/sequence/io/fasta/convert.py +273 -0
  208. biotite/sequence/io/fasta/file.py +278 -0
  209. biotite/sequence/io/fastq/__init__.py +19 -0
  210. biotite/sequence/io/fastq/convert.py +120 -0
  211. biotite/sequence/io/fastq/file.py +551 -0
  212. biotite/sequence/io/genbank/__init__.py +17 -0
  213. biotite/sequence/io/genbank/annotation.py +277 -0
  214. biotite/sequence/io/genbank/file.py +575 -0
  215. biotite/sequence/io/genbank/metadata.py +324 -0
  216. biotite/sequence/io/genbank/sequence.py +172 -0
  217. biotite/sequence/io/general.py +192 -0
  218. biotite/sequence/io/gff/__init__.py +26 -0
  219. biotite/sequence/io/gff/convert.py +133 -0
  220. biotite/sequence/io/gff/file.py +434 -0
  221. biotite/sequence/phylo/__init__.py +36 -0
  222. biotite/sequence/phylo/nj.cpython-311-darwin.so +0 -0
  223. biotite/sequence/phylo/nj.pyx +221 -0
  224. biotite/sequence/phylo/tree.cpython-311-darwin.so +0 -0
  225. biotite/sequence/phylo/tree.pyx +1169 -0
  226. biotite/sequence/phylo/upgma.cpython-311-darwin.so +0 -0
  227. biotite/sequence/phylo/upgma.pyx +164 -0
  228. biotite/sequence/profile.py +456 -0
  229. biotite/sequence/search.py +116 -0
  230. biotite/sequence/seqtypes.py +556 -0
  231. biotite/sequence/sequence.py +374 -0
  232. biotite/structure/__init__.py +132 -0
  233. biotite/structure/atoms.py +1455 -0
  234. biotite/structure/basepairs.py +1415 -0
  235. biotite/structure/bonds.cpython-311-darwin.so +0 -0
  236. biotite/structure/bonds.pyx +1933 -0
  237. biotite/structure/box.py +592 -0
  238. biotite/structure/celllist.cpython-311-darwin.so +0 -0
  239. biotite/structure/celllist.pyx +849 -0
  240. biotite/structure/chains.py +298 -0
  241. biotite/structure/charges.cpython-311-darwin.so +0 -0
  242. biotite/structure/charges.pyx +520 -0
  243. biotite/structure/compare.py +274 -0
  244. biotite/structure/density.py +114 -0
  245. biotite/structure/dotbracket.py +216 -0
  246. biotite/structure/error.py +31 -0
  247. biotite/structure/filter.py +585 -0
  248. biotite/structure/geometry.py +697 -0
  249. biotite/structure/graphics/__init__.py +13 -0
  250. biotite/structure/graphics/atoms.py +226 -0
  251. biotite/structure/graphics/rna.py +282 -0
  252. biotite/structure/hbond.py +409 -0
  253. biotite/structure/info/__init__.py +25 -0
  254. biotite/structure/info/atom_masses.json +121 -0
  255. biotite/structure/info/atoms.py +82 -0
  256. biotite/structure/info/bonds.py +145 -0
  257. biotite/structure/info/ccd/README.rst +8 -0
  258. biotite/structure/info/ccd/amino_acids.txt +1663 -0
  259. biotite/structure/info/ccd/carbohydrates.txt +1135 -0
  260. biotite/structure/info/ccd/components.bcif +0 -0
  261. biotite/structure/info/ccd/nucleotides.txt +798 -0
  262. biotite/structure/info/ccd.py +95 -0
  263. biotite/structure/info/groups.py +90 -0
  264. biotite/structure/info/masses.py +123 -0
  265. biotite/structure/info/misc.py +144 -0
  266. biotite/structure/info/radii.py +197 -0
  267. biotite/structure/info/standardize.py +196 -0
  268. biotite/structure/integrity.py +268 -0
  269. biotite/structure/io/__init__.py +30 -0
  270. biotite/structure/io/ctab.py +72 -0
  271. biotite/structure/io/dcd/__init__.py +13 -0
  272. biotite/structure/io/dcd/file.py +65 -0
  273. biotite/structure/io/general.py +257 -0
  274. biotite/structure/io/gro/__init__.py +14 -0
  275. biotite/structure/io/gro/file.py +343 -0
  276. biotite/structure/io/mmtf/__init__.py +21 -0
  277. biotite/structure/io/mmtf/assembly.py +214 -0
  278. biotite/structure/io/mmtf/convertarray.cpython-311-darwin.so +0 -0
  279. biotite/structure/io/mmtf/convertarray.pyx +341 -0
  280. biotite/structure/io/mmtf/convertfile.cpython-311-darwin.so +0 -0
  281. biotite/structure/io/mmtf/convertfile.pyx +501 -0
  282. biotite/structure/io/mmtf/decode.cpython-311-darwin.so +0 -0
  283. biotite/structure/io/mmtf/decode.pyx +152 -0
  284. biotite/structure/io/mmtf/encode.cpython-311-darwin.so +0 -0
  285. biotite/structure/io/mmtf/encode.pyx +183 -0
  286. biotite/structure/io/mmtf/file.py +233 -0
  287. biotite/structure/io/mol/__init__.py +20 -0
  288. biotite/structure/io/mol/convert.py +115 -0
  289. biotite/structure/io/mol/ctab.py +414 -0
  290. biotite/structure/io/mol/header.py +116 -0
  291. biotite/structure/io/mol/mol.py +193 -0
  292. biotite/structure/io/mol/sdf.py +916 -0
  293. biotite/structure/io/netcdf/__init__.py +13 -0
  294. biotite/structure/io/netcdf/file.py +63 -0
  295. biotite/structure/io/npz/__init__.py +20 -0
  296. biotite/structure/io/npz/file.py +152 -0
  297. biotite/structure/io/pdb/__init__.py +20 -0
  298. biotite/structure/io/pdb/convert.py +293 -0
  299. biotite/structure/io/pdb/file.py +1240 -0
  300. biotite/structure/io/pdb/hybrid36.cpython-311-darwin.so +0 -0
  301. biotite/structure/io/pdb/hybrid36.pyx +242 -0
  302. biotite/structure/io/pdbqt/__init__.py +15 -0
  303. biotite/structure/io/pdbqt/convert.py +107 -0
  304. biotite/structure/io/pdbqt/file.py +640 -0
  305. biotite/structure/io/pdbx/__init__.py +23 -0
  306. biotite/structure/io/pdbx/bcif.py +648 -0
  307. biotite/structure/io/pdbx/cif.py +1032 -0
  308. biotite/structure/io/pdbx/component.py +246 -0
  309. biotite/structure/io/pdbx/convert.py +1597 -0
  310. biotite/structure/io/pdbx/encoding.cpython-311-darwin.so +0 -0
  311. biotite/structure/io/pdbx/encoding.pyx +950 -0
  312. biotite/structure/io/pdbx/legacy.py +267 -0
  313. biotite/structure/io/tng/__init__.py +13 -0
  314. biotite/structure/io/tng/file.py +46 -0
  315. biotite/structure/io/trajfile.py +710 -0
  316. biotite/structure/io/trr/__init__.py +13 -0
  317. biotite/structure/io/trr/file.py +46 -0
  318. biotite/structure/io/xtc/__init__.py +13 -0
  319. biotite/structure/io/xtc/file.py +46 -0
  320. biotite/structure/mechanics.py +75 -0
  321. biotite/structure/molecules.py +353 -0
  322. biotite/structure/pseudoknots.py +642 -0
  323. biotite/structure/rdf.py +243 -0
  324. biotite/structure/repair.py +253 -0
  325. biotite/structure/residues.py +562 -0
  326. biotite/structure/resutil.py +178 -0
  327. biotite/structure/sasa.cpython-311-darwin.so +0 -0
  328. biotite/structure/sasa.pyx +322 -0
  329. biotite/structure/sequence.py +112 -0
  330. biotite/structure/sse.py +327 -0
  331. biotite/structure/superimpose.py +727 -0
  332. biotite/structure/transform.py +504 -0
  333. biotite/structure/util.py +98 -0
  334. biotite/temp.py +86 -0
  335. biotite/version.py +16 -0
  336. biotite/visualize.py +251 -0
  337. biotite-0.41.1.dist-info/METADATA +187 -0
  338. biotite-0.41.1.dist-info/RECORD +340 -0
  339. biotite-0.41.1.dist-info/WHEEL +4 -0
  340. biotite-0.41.1.dist-info/licenses/LICENSE.rst +30 -0
@@ -0,0 +1,13 @@
1
+ # This source code is part of the Biotite package and is distributed
2
+ # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
3
+ # information.
4
+
5
+ """
6
+ This subpackage is used for reading and writing trajectories in the
7
+ uncompressed *Gromacs* TRR format.
8
+ """
9
+
10
+ __name__ = "biotite.structure.io.trr"
11
+ __author__ = "Patrick Kunzmann"
12
+
13
+ from .file import *
@@ -0,0 +1,46 @@
1
+ # This source code is part of the Biotite package and is distributed
2
+ # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
3
+ # information.
4
+
5
+ __name__ = "biotite.structure.io.trr"
6
+ __author__ = "Patrick Kunzmann"
7
+ __all__ = ["TRRFile"]
8
+
9
+ import numpy as np
10
+ from ..trajfile import TrajectoryFile
11
+
12
+
13
+ class TRRFile(TrajectoryFile):
14
+ """
15
+ This file class represents a TRR trajectory file.
16
+ """
17
+
18
+ @classmethod
19
+ def traj_type(cls):
20
+ import mdtraj.formats as traj
21
+ return traj.TRRTrajectoryFile
22
+
23
+ @classmethod
24
+ def process_read_values(cls, read_values):
25
+ # nm to Angstrom
26
+ coord = read_values[0] * 10
27
+ box = read_values[3]
28
+ if box is not None:
29
+ box *= 10
30
+ time = read_values[1]
31
+ return coord, box, time
32
+
33
+ @classmethod
34
+ def prepare_write_values(cls, coord, box, time):
35
+ # Angstrom to nm
36
+ xyz = np.divide(coord, 10, dtype=np.float32) \
37
+ if coord is not None else None
38
+ time = time.astype(np.float32, copy=False) \
39
+ if time is not None else None
40
+ box = np.divide(box, 10, dtype=np.float32) \
41
+ if box is not None else None
42
+ return {
43
+ "xyz" : xyz,
44
+ "box" : box,
45
+ "time" : time,
46
+ }
@@ -0,0 +1,13 @@
1
+ # This source code is part of the Biotite package and is distributed
2
+ # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
3
+ # information.
4
+
5
+ """
6
+ This subpackage is used for reading and writing trajectories in the
7
+ compressed *Gromacs* XTC format.
8
+ """
9
+
10
+ __name__ = "biotite.structure.io.xtc"
11
+ __author__ = "Patrick Kunzmann"
12
+
13
+ from .file import *
@@ -0,0 +1,46 @@
1
+ # This source code is part of the Biotite package and is distributed
2
+ # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
3
+ # information.
4
+
5
+ __name__ = "biotite.structure.io.xtc"
6
+ __author__ = "Patrick Kunzmann"
7
+ __all__ = ["XTCFile"]
8
+
9
+ import numpy as np
10
+ from ..trajfile import TrajectoryFile
11
+
12
+
13
+ class XTCFile(TrajectoryFile):
14
+ """
15
+ This file class represents a XTC trajectory file.
16
+ """
17
+
18
+ @classmethod
19
+ def traj_type(cls):
20
+ import mdtraj.formats as traj
21
+ return traj.XTCTrajectoryFile
22
+
23
+ @classmethod
24
+ def process_read_values(cls, read_values):
25
+ # nm to Angstrom
26
+ coord = read_values[0] * 10
27
+ box = read_values[3]
28
+ if box is not None:
29
+ box *= 10
30
+ time = read_values[1]
31
+ return coord, box, time
32
+
33
+ @classmethod
34
+ def prepare_write_values(cls, coord, box, time):
35
+ # Angstrom to nm
36
+ xyz = np.divide(coord, 10, dtype=np.float32) \
37
+ if coord is not None else None
38
+ time = time.astype(np.float32, copy=False) \
39
+ if time is not None else None
40
+ box = np.divide(box, 10, dtype=np.float32) \
41
+ if box is not None else None
42
+ return {
43
+ "xyz" : xyz,
44
+ "box" : box,
45
+ "time" : time,
46
+ }
@@ -0,0 +1,75 @@
1
+ # This source code is part of the Biotite package and is distributed
2
+ # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
3
+ # information.
4
+
5
+ """
6
+ This module provides functions for calculation of mechanical or
7
+ mass-related properties of a molecular structure.
8
+ """
9
+
10
+ __name__ = "biotite.structure"
11
+ __author__ = "Patrick Kunzmann"
12
+ __all__ = ["mass_center", "gyration_radius"]
13
+
14
+ import numpy as np
15
+ from .atoms import Atom, AtomArray, AtomArrayStack, coord
16
+ from .util import vector_dot, norm_vector
17
+ from .error import BadStructureError
18
+ from .geometry import distance
19
+ from .info.masses import mass
20
+
21
+
22
+ def gyration_radius(array, masses=None):
23
+ """
24
+ Compute the radius/radii of gyration of an atom array or stack.
25
+
26
+ Parameters
27
+ ----------
28
+ array : AtomArray or AtomArrayStack
29
+ The array or stack to calculate the radius/radii of gyration
30
+ for.
31
+ masses : ndarray, optional
32
+ The masses to use for each atom in the input `array`.
33
+ Must have the same length as `array`. By default, the standard
34
+ atomic mass for each element is taken.
35
+
36
+
37
+ Returns
38
+ -------
39
+ masses : float or ndarray, dtype=float
40
+ If `array` is an :class:`AtomArray`, the radius of gyration is
41
+ returned as single float.
42
+ If `array` is an :class:`AtomArrayStack`, a :class:`ndarray`
43
+ containing the radii of gyration for every model is returned.
44
+ """
45
+ if masses is None:
46
+ masses = np.array([mass(element) for element in array.element])
47
+ center = mass_center(array, masses)
48
+ radii = distance(array, center[..., np.newaxis, :])
49
+ inertia_moment = np.sum(masses * radii*radii, axis=-1)
50
+ return np.sqrt(inertia_moment / np.sum(masses))
51
+
52
+ def mass_center(array, masses=None):
53
+ """
54
+ Calculate the center(s) of mass of an atom array or stack.
55
+
56
+ Parameters
57
+ ----------
58
+ array : AtomArray or AtomArrayStack
59
+ The array or stack to calculate the center(s) of mass for.
60
+ masses : ndarray, optional
61
+ The masses to use for each atom in the input `array`.
62
+ Must have the same length as `array`. By default, the standard
63
+ atomic mass for each element is taken.
64
+
65
+ Returns
66
+ -------
67
+ radius : ndarray, ndarray, dtype=float
68
+ Array containing the the coordinates of the center of mass.
69
+ If `array` is an :class:`AtomArray`, this will be an length 3
70
+ :class:`ndarray`; if it is an :class:`AtomArrayStack` with *n* models,
71
+ a (*n x 3*) :class:`ndarray` is returned.
72
+ """
73
+ if masses is None:
74
+ masses = np.array([mass(element) for element in array.element])
75
+ return np.sum(masses[:,np.newaxis] * array.coord, axis=-2) / np.sum(masses)
@@ -0,0 +1,353 @@
1
+ # This source code is part of the Biotite package and is distributed
2
+ # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
3
+ # information.
4
+
5
+ """
6
+ This module provides utility for separating structures into single
7
+ molecules.
8
+ """
9
+
10
+ __name__ = "biotite.structure"
11
+ __author__ = "Patrick Kunzmann"
12
+ __all__ = ["get_molecule_indices", "get_molecule_masks", "molecule_iter"]
13
+
14
+ import numpy as np
15
+ from .atoms import AtomArray, AtomArrayStack
16
+ from .bonds import BondList, find_connected
17
+
18
+
19
+ def get_molecule_indices(array):
20
+ """
21
+ Get an index array for each molecule in the given structure.
22
+
23
+ A molecule is defined as a group of atoms that are directly or
24
+ indirectly connected via covalent bonds.
25
+ In this function a single atom, that has no connection to any other
26
+ atom (e.g. an ion), also qualifies as a molecule.
27
+
28
+ Parameters
29
+ ----------
30
+ array : AtomArray or AtomArrayStack or BondList
31
+ The input structure with an associated :class:`BondList`.
32
+ Alternatively, the :class:`BondList` can be directly supplied.
33
+
34
+ Returns
35
+ -------
36
+ indices : list of ndarray, dtype=int
37
+ Each element in the list is an index array referring to the
38
+ atoms of a single molecule.
39
+ Consequently, the length of this list is equal to the number of
40
+ molecules in the input `array`.
41
+
42
+ See also
43
+ --------
44
+ get_molecule_masks
45
+ molecule_iter
46
+
47
+ Examples
48
+ --------
49
+ Get an :class:`AtomArray` for ATP and show that it is a single
50
+ molecule:
51
+
52
+ >>> atp = residue("ATP")
53
+ >>> indices = get_molecule_indices(atp)
54
+ >>> print(len(indices))
55
+ 1
56
+
57
+ Separate ATP into two molecules by breaking the glycosidic bond
58
+ to the triphosphate:
59
+
60
+ >>> i, j = np.where(np.isin(atp.atom_name, ("O5'", "PA")))[0]
61
+ >>> atp.bonds.remove_bond(i, j)
62
+ >>> indices = get_molecule_indices(atp)
63
+ >>> print(len(indices))
64
+ 2
65
+ >>> print(atp[indices[0]])
66
+ HET 0 ATP PG P 1.200 -0.230 -6.850
67
+ HET 0 ATP O1G O 1.740 1.140 -6.670
68
+ HET 0 ATP O2G O 2.120 -1.040 -7.890
69
+ HET 0 ATP O3G O -0.300 -0.140 -7.420
70
+ HET 0 ATP PB P 0.260 -0.130 -4.450
71
+ HET 0 ATP O1B O 0.810 1.230 -4.300
72
+ HET 0 ATP O2B O -1.230 -0.040 -5.060
73
+ HET 0 ATP O3B O 1.190 -0.990 -5.430
74
+ HET 0 ATP PA P -0.740 0.070 -2.070
75
+ HET 0 ATP O1A O -2.100 0.140 -2.670
76
+ HET 0 ATP O2A O -0.120 1.550 -1.960
77
+ HET 0 ATP O3A O 0.200 -0.840 -3.000
78
+ HET 0 ATP HOG2 H 2.100 -0.550 -8.730
79
+ HET 0 ATP HOG3 H -0.620 -1.050 -7.520
80
+ HET 0 ATP HOB2 H -1.550 -0.950 -5.130
81
+ HET 0 ATP HOA2 H 0.750 1.460 -1.560
82
+ >>> print(atp[indices[1]])
83
+ HET 0 ATP O5' O -0.840 -0.590 -0.600
84
+ HET 0 ATP C5' C -1.690 0.260 0.170
85
+ HET 0 ATP C4' C -1.830 -0.310 1.580
86
+ HET 0 ATP O4' O -0.540 -0.360 2.230
87
+ HET 0 ATP C3' C -2.680 0.630 2.460
88
+ HET 0 ATP O3' O -4.030 0.160 2.530
89
+ HET 0 ATP C2' C -2.010 0.560 3.860
90
+ HET 0 ATP O2' O -2.930 0.040 4.830
91
+ HET 0 ATP C1' C -0.830 -0.420 3.650
92
+ HET 0 ATP N9 N 0.330 0.020 4.430
93
+ HET 0 ATP C8 C 1.300 0.880 4.010
94
+ HET 0 ATP N7 N 2.180 1.040 4.960
95
+ HET 0 ATP C5 C 1.830 0.300 6.030
96
+ HET 0 ATP C6 C 2.390 0.080 7.300
97
+ HET 0 ATP N6 N 3.560 0.710 7.680
98
+ HET 0 ATP N1 N 1.760 -0.750 8.140
99
+ HET 0 ATP C2 C 0.640 -1.350 7.780
100
+ HET 0 ATP N3 N 0.090 -1.180 6.600
101
+ HET 0 ATP C4 C 0.640 -0.370 5.700
102
+ HET 0 ATP H5'1 H -2.680 0.310 -0.300
103
+ HET 0 ATP H5'2 H -1.260 1.260 0.220
104
+ HET 0 ATP H4' H -2.280 -1.300 1.550
105
+ HET 0 ATP H3' H -2.650 1.650 2.080
106
+ HET 0 ATP HO3' H -4.520 0.790 3.090
107
+ HET 0 ATP H2' H -1.650 1.540 4.160
108
+ HET 0 ATP HO2' H -3.670 0.660 4.870
109
+ HET 0 ATP H1' H -1.120 -1.430 3.930
110
+ HET 0 ATP H8 H 1.330 1.360 3.040
111
+ HET 0 ATP HN61 H 3.940 0.550 8.560
112
+ HET 0 ATP HN62 H 4.020 1.300 7.060
113
+ HET 0 ATP H2 H 0.170 -2.010 8.490
114
+ """
115
+ if isinstance(array, BondList):
116
+ bonds = array
117
+ elif isinstance(array, (AtomArray, AtomArrayStack)):
118
+ if array.bonds is None:
119
+ raise ValueError("An associated BondList is required")
120
+ bonds = array.bonds
121
+ else:
122
+ raise TypeError(
123
+ f"Expected a 'BondList', 'AtomArray' or 'AtomArrayStack', "
124
+ f"not '{type(array).__name__}'"
125
+ )
126
+
127
+ molecule_indices = []
128
+ visited_mask = np.zeros(bonds.get_atom_count(), dtype=bool)
129
+ while not visited_mask.all():
130
+ root = np.argmin(visited_mask)
131
+ connected = find_connected(bonds, root)
132
+ visited_mask[connected] = True
133
+ molecule_indices.append(connected)
134
+ return molecule_indices
135
+
136
+
137
+ def get_molecule_masks(array):
138
+ """
139
+ Get a boolean mask for each molecule in the given structure.
140
+
141
+ A molecule is defined as a group of atoms that are directly or
142
+ indirectly connected via covalent bonds.
143
+ In this function a single atom, that has no connection to any other
144
+ atom (e.g. an ion), also qualifies as a molecule.
145
+
146
+ Parameters
147
+ ----------
148
+ array : AtomArray, shape=(n,) or AtomArrayStack, shape=(m,n) or BondList
149
+ The input structure with an associated :class:`BondList`.
150
+ Alternatively, the :class:`BondList` can be directly supplied.
151
+
152
+ Returns
153
+ -------
154
+ masks : ndarray, shape=(k,n), dtype=bool,
155
+ Each element in the array is a boolean mask referring to the
156
+ atoms of a single molecule.
157
+ Consequently, the length of this list is equal to the number of
158
+ molecules in the input `array`.
159
+
160
+ See also
161
+ --------
162
+ get_molecule_indices
163
+ molecule_iter
164
+
165
+ Examples
166
+ --------
167
+ Get an :class:`AtomArray` for ATP and show that it is a single
168
+ molecule:
169
+
170
+ >>> atp = residue("ATP")
171
+ >>> masks = get_molecule_masks(atp)
172
+ >>> print(len(masks))
173
+ 1
174
+
175
+ Separate ATP into two molecules by breaking the glycosidic bond
176
+ to the triphosphate:
177
+
178
+ >>> i, j = np.where(np.isin(atp.atom_name, ("O5'", "PA")))[0]
179
+ >>> atp.bonds.remove_bond(i, j)
180
+ >>> masks = get_molecule_masks(atp)
181
+ >>> print(len(masks))
182
+ 2
183
+ >>> print(atp[masks[0]])
184
+ HET 0 ATP PG P 1.200 -0.230 -6.850
185
+ HET 0 ATP O1G O 1.740 1.140 -6.670
186
+ HET 0 ATP O2G O 2.120 -1.040 -7.890
187
+ HET 0 ATP O3G O -0.300 -0.140 -7.420
188
+ HET 0 ATP PB P 0.260 -0.130 -4.450
189
+ HET 0 ATP O1B O 0.810 1.230 -4.300
190
+ HET 0 ATP O2B O -1.230 -0.040 -5.060
191
+ HET 0 ATP O3B O 1.190 -0.990 -5.430
192
+ HET 0 ATP PA P -0.740 0.070 -2.070
193
+ HET 0 ATP O1A O -2.100 0.140 -2.670
194
+ HET 0 ATP O2A O -0.120 1.550 -1.960
195
+ HET 0 ATP O3A O 0.200 -0.840 -3.000
196
+ HET 0 ATP HOG2 H 2.100 -0.550 -8.730
197
+ HET 0 ATP HOG3 H -0.620 -1.050 -7.520
198
+ HET 0 ATP HOB2 H -1.550 -0.950 -5.130
199
+ HET 0 ATP HOA2 H 0.750 1.460 -1.560
200
+ >>> print(atp[masks[1]])
201
+ HET 0 ATP O5' O -0.840 -0.590 -0.600
202
+ HET 0 ATP C5' C -1.690 0.260 0.170
203
+ HET 0 ATP C4' C -1.830 -0.310 1.580
204
+ HET 0 ATP O4' O -0.540 -0.360 2.230
205
+ HET 0 ATP C3' C -2.680 0.630 2.460
206
+ HET 0 ATP O3' O -4.030 0.160 2.530
207
+ HET 0 ATP C2' C -2.010 0.560 3.860
208
+ HET 0 ATP O2' O -2.930 0.040 4.830
209
+ HET 0 ATP C1' C -0.830 -0.420 3.650
210
+ HET 0 ATP N9 N 0.330 0.020 4.430
211
+ HET 0 ATP C8 C 1.300 0.880 4.010
212
+ HET 0 ATP N7 N 2.180 1.040 4.960
213
+ HET 0 ATP C5 C 1.830 0.300 6.030
214
+ HET 0 ATP C6 C 2.390 0.080 7.300
215
+ HET 0 ATP N6 N 3.560 0.710 7.680
216
+ HET 0 ATP N1 N 1.760 -0.750 8.140
217
+ HET 0 ATP C2 C 0.640 -1.350 7.780
218
+ HET 0 ATP N3 N 0.090 -1.180 6.600
219
+ HET 0 ATP C4 C 0.640 -0.370 5.700
220
+ HET 0 ATP H5'1 H -2.680 0.310 -0.300
221
+ HET 0 ATP H5'2 H -1.260 1.260 0.220
222
+ HET 0 ATP H4' H -2.280 -1.300 1.550
223
+ HET 0 ATP H3' H -2.650 1.650 2.080
224
+ HET 0 ATP HO3' H -4.520 0.790 3.090
225
+ HET 0 ATP H2' H -1.650 1.540 4.160
226
+ HET 0 ATP HO2' H -3.670 0.660 4.870
227
+ HET 0 ATP H1' H -1.120 -1.430 3.930
228
+ HET 0 ATP H8 H 1.330 1.360 3.040
229
+ HET 0 ATP HN61 H 3.940 0.550 8.560
230
+ HET 0 ATP HN62 H 4.020 1.300 7.060
231
+ HET 0 ATP H2 H 0.170 -2.010 8.490
232
+ """
233
+ if isinstance(array, BondList):
234
+ bonds = array
235
+ elif isinstance(array, (AtomArray, AtomArrayStack)):
236
+ if array.bonds is None:
237
+ raise ValueError("An associated BondList is required")
238
+ bonds = array.bonds
239
+ else:
240
+ raise TypeError(
241
+ f"Expected a 'BondList', 'AtomArray' or 'AtomArrayStack', "
242
+ f"not '{type(array).__name__}'"
243
+ )
244
+
245
+ molecule_indices = get_molecule_indices(bonds)
246
+ molecule_masks = np.zeros(
247
+ (len(molecule_indices), bonds.get_atom_count()),
248
+ dtype=bool
249
+ )
250
+ for i in range(len(molecule_indices)):
251
+ molecule_masks[i, molecule_indices[i]] = True
252
+ return molecule_masks
253
+
254
+
255
+ def molecule_iter(array):
256
+ """
257
+ Iterate over each molecule in a input structure.
258
+
259
+ A molecule is defined as a group of atoms that are directly or
260
+ indirectly connected via covalent bonds.
261
+ In this function a single atom, that has no connection to any other
262
+ atom (e.g. an ion), also qualifies as a molecule.
263
+
264
+ Parameters
265
+ ----------
266
+ array : AtomArray or AtomArrayStack
267
+ The input structure with an associated :class:`BondList`.
268
+
269
+ Yields
270
+ ------
271
+ molecule : AtomArray or AtomArrayStack
272
+ A single molecule of the input `array`.
273
+
274
+ See also
275
+ --------
276
+ get_molecule_indices
277
+ get_molecule_masks
278
+
279
+ Examples
280
+ --------
281
+ Get an :class:`AtomArray` for ATP and break it into two molecules
282
+ at the glycosidic bond to the triphosphate:
283
+
284
+ >>> atp = residue("ATP")
285
+ >>> i, j = np.where(np.isin(atp.atom_name, ("O5'", "PA")))[0]
286
+ >>> atp.bonds.remove_bond(i, j)
287
+ >>> for molecule in molecule_iter(atp):
288
+ ... print("New molecule")
289
+ ... print(molecule)
290
+ ... print()
291
+ New molecule
292
+ HET 0 ATP PG P 1.200 -0.230 -6.850
293
+ HET 0 ATP O1G O 1.740 1.140 -6.670
294
+ HET 0 ATP O2G O 2.120 -1.040 -7.890
295
+ HET 0 ATP O3G O -0.300 -0.140 -7.420
296
+ HET 0 ATP PB P 0.260 -0.130 -4.450
297
+ HET 0 ATP O1B O 0.810 1.230 -4.300
298
+ HET 0 ATP O2B O -1.230 -0.040 -5.060
299
+ HET 0 ATP O3B O 1.190 -0.990 -5.430
300
+ HET 0 ATP PA P -0.740 0.070 -2.070
301
+ HET 0 ATP O1A O -2.100 0.140 -2.670
302
+ HET 0 ATP O2A O -0.120 1.550 -1.960
303
+ HET 0 ATP O3A O 0.200 -0.840 -3.000
304
+ HET 0 ATP HOG2 H 2.100 -0.550 -8.730
305
+ HET 0 ATP HOG3 H -0.620 -1.050 -7.520
306
+ HET 0 ATP HOB2 H -1.550 -0.950 -5.130
307
+ HET 0 ATP HOA2 H 0.750 1.460 -1.560
308
+ <BLANKLINE>
309
+ New molecule
310
+ HET 0 ATP O5' O -0.840 -0.590 -0.600
311
+ HET 0 ATP C5' C -1.690 0.260 0.170
312
+ HET 0 ATP C4' C -1.830 -0.310 1.580
313
+ HET 0 ATP O4' O -0.540 -0.360 2.230
314
+ HET 0 ATP C3' C -2.680 0.630 2.460
315
+ HET 0 ATP O3' O -4.030 0.160 2.530
316
+ HET 0 ATP C2' C -2.010 0.560 3.860
317
+ HET 0 ATP O2' O -2.930 0.040 4.830
318
+ HET 0 ATP C1' C -0.830 -0.420 3.650
319
+ HET 0 ATP N9 N 0.330 0.020 4.430
320
+ HET 0 ATP C8 C 1.300 0.880 4.010
321
+ HET 0 ATP N7 N 2.180 1.040 4.960
322
+ HET 0 ATP C5 C 1.830 0.300 6.030
323
+ HET 0 ATP C6 C 2.390 0.080 7.300
324
+ HET 0 ATP N6 N 3.560 0.710 7.680
325
+ HET 0 ATP N1 N 1.760 -0.750 8.140
326
+ HET 0 ATP C2 C 0.640 -1.350 7.780
327
+ HET 0 ATP N3 N 0.090 -1.180 6.600
328
+ HET 0 ATP C4 C 0.640 -0.370 5.700
329
+ HET 0 ATP H5'1 H -2.680 0.310 -0.300
330
+ HET 0 ATP H5'2 H -1.260 1.260 0.220
331
+ HET 0 ATP H4' H -2.280 -1.300 1.550
332
+ HET 0 ATP H3' H -2.650 1.650 2.080
333
+ HET 0 ATP HO3' H -4.520 0.790 3.090
334
+ HET 0 ATP H2' H -1.650 1.540 4.160
335
+ HET 0 ATP HO2' H -3.670 0.660 4.870
336
+ HET 0 ATP H1' H -1.120 -1.430 3.930
337
+ HET 0 ATP H8 H 1.330 1.360 3.040
338
+ HET 0 ATP HN61 H 3.940 0.550 8.560
339
+ HET 0 ATP HN62 H 4.020 1.300 7.060
340
+ HET 0 ATP H2 H 0.170 -2.010 8.490
341
+ <BLANKLINE>
342
+ """
343
+ if array.bonds is None:
344
+ raise ValueError("An associated BondList is required")
345
+ bonds = array.bonds
346
+
347
+ visited_mask = np.zeros(bonds.get_atom_count(), dtype=bool)
348
+ while not visited_mask.all():
349
+ # Take the first atom that has not been considered yet as root
350
+ root = np.argmin(visited_mask)
351
+ connected = find_connected(bonds, root)
352
+ visited_mask[connected] = True
353
+ yield array[..., connected]