biotite 1.5.0__cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.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 (354) hide show
  1. biotite/__init__.py +18 -0
  2. biotite/application/__init__.py +69 -0
  3. biotite/application/application.py +276 -0
  4. biotite/application/autodock/__init__.py +12 -0
  5. biotite/application/autodock/app.py +500 -0
  6. biotite/application/blast/__init__.py +14 -0
  7. biotite/application/blast/alignment.py +92 -0
  8. biotite/application/blast/webapp.py +428 -0
  9. biotite/application/clustalo/__init__.py +12 -0
  10. biotite/application/clustalo/app.py +223 -0
  11. biotite/application/dssp/__init__.py +12 -0
  12. biotite/application/dssp/app.py +216 -0
  13. biotite/application/localapp.py +342 -0
  14. biotite/application/mafft/__init__.py +12 -0
  15. biotite/application/mafft/app.py +116 -0
  16. biotite/application/msaapp.py +363 -0
  17. biotite/application/muscle/__init__.py +13 -0
  18. biotite/application/muscle/app3.py +227 -0
  19. biotite/application/muscle/app5.py +163 -0
  20. biotite/application/sra/__init__.py +18 -0
  21. biotite/application/sra/app.py +447 -0
  22. biotite/application/tantan/__init__.py +12 -0
  23. biotite/application/tantan/app.py +199 -0
  24. biotite/application/util.py +77 -0
  25. biotite/application/viennarna/__init__.py +18 -0
  26. biotite/application/viennarna/rnaalifold.py +310 -0
  27. biotite/application/viennarna/rnafold.py +254 -0
  28. biotite/application/viennarna/rnaplot.py +208 -0
  29. biotite/application/viennarna/util.py +77 -0
  30. biotite/application/webapp.py +76 -0
  31. biotite/copyable.py +71 -0
  32. biotite/database/__init__.py +23 -0
  33. biotite/database/afdb/__init__.py +12 -0
  34. biotite/database/afdb/download.py +197 -0
  35. biotite/database/entrez/__init__.py +15 -0
  36. biotite/database/entrez/check.py +60 -0
  37. biotite/database/entrez/dbnames.py +101 -0
  38. biotite/database/entrez/download.py +228 -0
  39. biotite/database/entrez/key.py +44 -0
  40. biotite/database/entrez/query.py +263 -0
  41. biotite/database/error.py +16 -0
  42. biotite/database/pubchem/__init__.py +21 -0
  43. biotite/database/pubchem/download.py +258 -0
  44. biotite/database/pubchem/error.py +30 -0
  45. biotite/database/pubchem/query.py +819 -0
  46. biotite/database/pubchem/throttle.py +98 -0
  47. biotite/database/rcsb/__init__.py +13 -0
  48. biotite/database/rcsb/download.py +161 -0
  49. biotite/database/rcsb/query.py +963 -0
  50. biotite/database/uniprot/__init__.py +13 -0
  51. biotite/database/uniprot/check.py +40 -0
  52. biotite/database/uniprot/download.py +126 -0
  53. biotite/database/uniprot/query.py +292 -0
  54. biotite/file.py +244 -0
  55. biotite/interface/__init__.py +19 -0
  56. biotite/interface/openmm/__init__.py +20 -0
  57. biotite/interface/openmm/state.py +93 -0
  58. biotite/interface/openmm/system.py +227 -0
  59. biotite/interface/pymol/__init__.py +201 -0
  60. biotite/interface/pymol/cgo.py +346 -0
  61. biotite/interface/pymol/convert.py +185 -0
  62. biotite/interface/pymol/display.py +267 -0
  63. biotite/interface/pymol/object.py +1228 -0
  64. biotite/interface/pymol/shapes.py +178 -0
  65. biotite/interface/pymol/startup.py +169 -0
  66. biotite/interface/rdkit/__init__.py +19 -0
  67. biotite/interface/rdkit/mol.py +490 -0
  68. biotite/interface/version.py +94 -0
  69. biotite/interface/warning.py +19 -0
  70. biotite/sequence/__init__.py +84 -0
  71. biotite/sequence/align/__init__.py +199 -0
  72. biotite/sequence/align/alignment.py +702 -0
  73. biotite/sequence/align/banded.cpython-311-x86_64-linux-gnu.so +0 -0
  74. biotite/sequence/align/banded.pyx +652 -0
  75. biotite/sequence/align/buckets.py +71 -0
  76. biotite/sequence/align/cigar.py +425 -0
  77. biotite/sequence/align/kmeralphabet.cpython-311-x86_64-linux-gnu.so +0 -0
  78. biotite/sequence/align/kmeralphabet.pyx +595 -0
  79. biotite/sequence/align/kmersimilarity.cpython-311-x86_64-linux-gnu.so +0 -0
  80. biotite/sequence/align/kmersimilarity.pyx +233 -0
  81. biotite/sequence/align/kmertable.cpython-311-x86_64-linux-gnu.so +0 -0
  82. biotite/sequence/align/kmertable.pyx +3411 -0
  83. biotite/sequence/align/localgapped.cpython-311-x86_64-linux-gnu.so +0 -0
  84. biotite/sequence/align/localgapped.pyx +892 -0
  85. biotite/sequence/align/localungapped.cpython-311-x86_64-linux-gnu.so +0 -0
  86. biotite/sequence/align/localungapped.pyx +279 -0
  87. biotite/sequence/align/matrix.py +631 -0
  88. biotite/sequence/align/matrix_data/3Di.mat +24 -0
  89. biotite/sequence/align/matrix_data/BLOSUM100.mat +31 -0
  90. biotite/sequence/align/matrix_data/BLOSUM30.mat +31 -0
  91. biotite/sequence/align/matrix_data/BLOSUM35.mat +31 -0
  92. biotite/sequence/align/matrix_data/BLOSUM40.mat +31 -0
  93. biotite/sequence/align/matrix_data/BLOSUM45.mat +31 -0
  94. biotite/sequence/align/matrix_data/BLOSUM50.mat +31 -0
  95. biotite/sequence/align/matrix_data/BLOSUM50_13p.mat +25 -0
  96. biotite/sequence/align/matrix_data/BLOSUM50_14.3.mat +25 -0
  97. biotite/sequence/align/matrix_data/BLOSUM50_5.0.mat +25 -0
  98. biotite/sequence/align/matrix_data/BLOSUM55.mat +31 -0
  99. biotite/sequence/align/matrix_data/BLOSUM60.mat +31 -0
  100. biotite/sequence/align/matrix_data/BLOSUM62.mat +31 -0
  101. biotite/sequence/align/matrix_data/BLOSUM62_13p.mat +25 -0
  102. biotite/sequence/align/matrix_data/BLOSUM62_14.3.mat +25 -0
  103. biotite/sequence/align/matrix_data/BLOSUM62_5.0.mat +25 -0
  104. biotite/sequence/align/matrix_data/BLOSUM65.mat +31 -0
  105. biotite/sequence/align/matrix_data/BLOSUM70.mat +31 -0
  106. biotite/sequence/align/matrix_data/BLOSUM75.mat +31 -0
  107. biotite/sequence/align/matrix_data/BLOSUM80.mat +31 -0
  108. biotite/sequence/align/matrix_data/BLOSUM85.mat +31 -0
  109. biotite/sequence/align/matrix_data/BLOSUM90.mat +31 -0
  110. biotite/sequence/align/matrix_data/BLOSUMN.mat +31 -0
  111. biotite/sequence/align/matrix_data/CorBLOSUM49_5.0.mat +25 -0
  112. biotite/sequence/align/matrix_data/CorBLOSUM57_13p.mat +25 -0
  113. biotite/sequence/align/matrix_data/CorBLOSUM57_14.3.mat +25 -0
  114. biotite/sequence/align/matrix_data/CorBLOSUM61_5.0.mat +25 -0
  115. biotite/sequence/align/matrix_data/CorBLOSUM66_13p.mat +25 -0
  116. biotite/sequence/align/matrix_data/CorBLOSUM67_14.3.mat +25 -0
  117. biotite/sequence/align/matrix_data/DAYHOFF.mat +32 -0
  118. biotite/sequence/align/matrix_data/GONNET.mat +26 -0
  119. biotite/sequence/align/matrix_data/IDENTITY.mat +25 -0
  120. biotite/sequence/align/matrix_data/MATCH.mat +25 -0
  121. biotite/sequence/align/matrix_data/NUC.mat +25 -0
  122. biotite/sequence/align/matrix_data/PAM10.mat +34 -0
  123. biotite/sequence/align/matrix_data/PAM100.mat +34 -0
  124. biotite/sequence/align/matrix_data/PAM110.mat +34 -0
  125. biotite/sequence/align/matrix_data/PAM120.mat +34 -0
  126. biotite/sequence/align/matrix_data/PAM130.mat +34 -0
  127. biotite/sequence/align/matrix_data/PAM140.mat +34 -0
  128. biotite/sequence/align/matrix_data/PAM150.mat +34 -0
  129. biotite/sequence/align/matrix_data/PAM160.mat +34 -0
  130. biotite/sequence/align/matrix_data/PAM170.mat +34 -0
  131. biotite/sequence/align/matrix_data/PAM180.mat +34 -0
  132. biotite/sequence/align/matrix_data/PAM190.mat +34 -0
  133. biotite/sequence/align/matrix_data/PAM20.mat +34 -0
  134. biotite/sequence/align/matrix_data/PAM200.mat +34 -0
  135. biotite/sequence/align/matrix_data/PAM210.mat +34 -0
  136. biotite/sequence/align/matrix_data/PAM220.mat +34 -0
  137. biotite/sequence/align/matrix_data/PAM230.mat +34 -0
  138. biotite/sequence/align/matrix_data/PAM240.mat +34 -0
  139. biotite/sequence/align/matrix_data/PAM250.mat +34 -0
  140. biotite/sequence/align/matrix_data/PAM260.mat +34 -0
  141. biotite/sequence/align/matrix_data/PAM270.mat +34 -0
  142. biotite/sequence/align/matrix_data/PAM280.mat +34 -0
  143. biotite/sequence/align/matrix_data/PAM290.mat +34 -0
  144. biotite/sequence/align/matrix_data/PAM30.mat +34 -0
  145. biotite/sequence/align/matrix_data/PAM300.mat +34 -0
  146. biotite/sequence/align/matrix_data/PAM310.mat +34 -0
  147. biotite/sequence/align/matrix_data/PAM320.mat +34 -0
  148. biotite/sequence/align/matrix_data/PAM330.mat +34 -0
  149. biotite/sequence/align/matrix_data/PAM340.mat +34 -0
  150. biotite/sequence/align/matrix_data/PAM350.mat +34 -0
  151. biotite/sequence/align/matrix_data/PAM360.mat +34 -0
  152. biotite/sequence/align/matrix_data/PAM370.mat +34 -0
  153. biotite/sequence/align/matrix_data/PAM380.mat +34 -0
  154. biotite/sequence/align/matrix_data/PAM390.mat +34 -0
  155. biotite/sequence/align/matrix_data/PAM40.mat +34 -0
  156. biotite/sequence/align/matrix_data/PAM400.mat +34 -0
  157. biotite/sequence/align/matrix_data/PAM410.mat +34 -0
  158. biotite/sequence/align/matrix_data/PAM420.mat +34 -0
  159. biotite/sequence/align/matrix_data/PAM430.mat +34 -0
  160. biotite/sequence/align/matrix_data/PAM440.mat +34 -0
  161. biotite/sequence/align/matrix_data/PAM450.mat +34 -0
  162. biotite/sequence/align/matrix_data/PAM460.mat +34 -0
  163. biotite/sequence/align/matrix_data/PAM470.mat +34 -0
  164. biotite/sequence/align/matrix_data/PAM480.mat +34 -0
  165. biotite/sequence/align/matrix_data/PAM490.mat +34 -0
  166. biotite/sequence/align/matrix_data/PAM50.mat +34 -0
  167. biotite/sequence/align/matrix_data/PAM500.mat +34 -0
  168. biotite/sequence/align/matrix_data/PAM60.mat +34 -0
  169. biotite/sequence/align/matrix_data/PAM70.mat +34 -0
  170. biotite/sequence/align/matrix_data/PAM80.mat +34 -0
  171. biotite/sequence/align/matrix_data/PAM90.mat +34 -0
  172. biotite/sequence/align/matrix_data/PB.license +21 -0
  173. biotite/sequence/align/matrix_data/PB.mat +18 -0
  174. biotite/sequence/align/matrix_data/RBLOSUM52_5.0.mat +25 -0
  175. biotite/sequence/align/matrix_data/RBLOSUM59_13p.mat +25 -0
  176. biotite/sequence/align/matrix_data/RBLOSUM59_14.3.mat +25 -0
  177. biotite/sequence/align/matrix_data/RBLOSUM64_5.0.mat +25 -0
  178. biotite/sequence/align/matrix_data/RBLOSUM69_13p.mat +25 -0
  179. biotite/sequence/align/matrix_data/RBLOSUM69_14.3.mat +25 -0
  180. biotite/sequence/align/multiple.cpython-311-x86_64-linux-gnu.so +0 -0
  181. biotite/sequence/align/multiple.pyx +619 -0
  182. biotite/sequence/align/pairwise.cpython-311-x86_64-linux-gnu.so +0 -0
  183. biotite/sequence/align/pairwise.pyx +585 -0
  184. biotite/sequence/align/permutation.cpython-311-x86_64-linux-gnu.so +0 -0
  185. biotite/sequence/align/permutation.pyx +313 -0
  186. biotite/sequence/align/primes.txt +821 -0
  187. biotite/sequence/align/selector.cpython-311-x86_64-linux-gnu.so +0 -0
  188. biotite/sequence/align/selector.pyx +954 -0
  189. biotite/sequence/align/statistics.py +264 -0
  190. biotite/sequence/align/tracetable.cpython-311-x86_64-linux-gnu.so +0 -0
  191. biotite/sequence/align/tracetable.pxd +64 -0
  192. biotite/sequence/align/tracetable.pyx +370 -0
  193. biotite/sequence/alphabet.py +555 -0
  194. biotite/sequence/annotation.py +836 -0
  195. biotite/sequence/codec.cpython-311-x86_64-linux-gnu.so +0 -0
  196. biotite/sequence/codec.pyx +155 -0
  197. biotite/sequence/codon.py +476 -0
  198. biotite/sequence/codon_tables.txt +202 -0
  199. biotite/sequence/graphics/__init__.py +33 -0
  200. biotite/sequence/graphics/alignment.py +1101 -0
  201. biotite/sequence/graphics/color_schemes/3di_flower.json +48 -0
  202. biotite/sequence/graphics/color_schemes/autumn.json +51 -0
  203. biotite/sequence/graphics/color_schemes/blossom.json +51 -0
  204. biotite/sequence/graphics/color_schemes/clustalx_dna.json +11 -0
  205. biotite/sequence/graphics/color_schemes/clustalx_protein.json +28 -0
  206. biotite/sequence/graphics/color_schemes/flower.json +51 -0
  207. biotite/sequence/graphics/color_schemes/jalview_buried.json +31 -0
  208. biotite/sequence/graphics/color_schemes/jalview_hydrophobicity.json +31 -0
  209. biotite/sequence/graphics/color_schemes/jalview_prop_helix.json +31 -0
  210. biotite/sequence/graphics/color_schemes/jalview_prop_strand.json +31 -0
  211. biotite/sequence/graphics/color_schemes/jalview_prop_turn.json +31 -0
  212. biotite/sequence/graphics/color_schemes/jalview_taylor.json +28 -0
  213. biotite/sequence/graphics/color_schemes/jalview_zappo.json +28 -0
  214. biotite/sequence/graphics/color_schemes/ocean.json +51 -0
  215. biotite/sequence/graphics/color_schemes/pb_flower.json +40 -0
  216. biotite/sequence/graphics/color_schemes/rainbow_dna.json +11 -0
  217. biotite/sequence/graphics/color_schemes/rainbow_protein.json +30 -0
  218. biotite/sequence/graphics/color_schemes/spring.json +51 -0
  219. biotite/sequence/graphics/color_schemes/sunset.json +51 -0
  220. biotite/sequence/graphics/color_schemes/wither.json +51 -0
  221. biotite/sequence/graphics/colorschemes.py +170 -0
  222. biotite/sequence/graphics/dendrogram.py +231 -0
  223. biotite/sequence/graphics/features.py +544 -0
  224. biotite/sequence/graphics/logo.py +102 -0
  225. biotite/sequence/graphics/plasmid.py +712 -0
  226. biotite/sequence/io/__init__.py +12 -0
  227. biotite/sequence/io/fasta/__init__.py +22 -0
  228. biotite/sequence/io/fasta/convert.py +283 -0
  229. biotite/sequence/io/fasta/file.py +265 -0
  230. biotite/sequence/io/fastq/__init__.py +19 -0
  231. biotite/sequence/io/fastq/convert.py +117 -0
  232. biotite/sequence/io/fastq/file.py +507 -0
  233. biotite/sequence/io/genbank/__init__.py +17 -0
  234. biotite/sequence/io/genbank/annotation.py +269 -0
  235. biotite/sequence/io/genbank/file.py +573 -0
  236. biotite/sequence/io/genbank/metadata.py +336 -0
  237. biotite/sequence/io/genbank/sequence.py +173 -0
  238. biotite/sequence/io/general.py +201 -0
  239. biotite/sequence/io/gff/__init__.py +26 -0
  240. biotite/sequence/io/gff/convert.py +128 -0
  241. biotite/sequence/io/gff/file.py +449 -0
  242. biotite/sequence/phylo/__init__.py +36 -0
  243. biotite/sequence/phylo/nj.cpython-311-x86_64-linux-gnu.so +0 -0
  244. biotite/sequence/phylo/nj.pyx +221 -0
  245. biotite/sequence/phylo/tree.cpython-311-x86_64-linux-gnu.so +0 -0
  246. biotite/sequence/phylo/tree.pyx +1169 -0
  247. biotite/sequence/phylo/upgma.cpython-311-x86_64-linux-gnu.so +0 -0
  248. biotite/sequence/phylo/upgma.pyx +164 -0
  249. biotite/sequence/profile.py +561 -0
  250. biotite/sequence/search.py +117 -0
  251. biotite/sequence/seqtypes.py +720 -0
  252. biotite/sequence/sequence.py +373 -0
  253. biotite/setup_ccd.py +197 -0
  254. biotite/structure/__init__.py +135 -0
  255. biotite/structure/alphabet/__init__.py +25 -0
  256. biotite/structure/alphabet/encoder.py +332 -0
  257. biotite/structure/alphabet/encoder_weights_3di.kerasify +0 -0
  258. biotite/structure/alphabet/i3d.py +109 -0
  259. biotite/structure/alphabet/layers.py +86 -0
  260. biotite/structure/alphabet/pb.license +21 -0
  261. biotite/structure/alphabet/pb.py +170 -0
  262. biotite/structure/alphabet/unkerasify.py +128 -0
  263. biotite/structure/atoms.py +1562 -0
  264. biotite/structure/basepairs.py +1403 -0
  265. biotite/structure/bonds.cpython-311-x86_64-linux-gnu.so +0 -0
  266. biotite/structure/bonds.pyx +2036 -0
  267. biotite/structure/box.py +724 -0
  268. biotite/structure/celllist.cpython-311-x86_64-linux-gnu.so +0 -0
  269. biotite/structure/celllist.pyx +864 -0
  270. biotite/structure/chains.py +310 -0
  271. biotite/structure/charges.cpython-311-x86_64-linux-gnu.so +0 -0
  272. biotite/structure/charges.pyx +520 -0
  273. biotite/structure/compare.py +683 -0
  274. biotite/structure/density.py +109 -0
  275. biotite/structure/dotbracket.py +213 -0
  276. biotite/structure/error.py +39 -0
  277. biotite/structure/filter.py +591 -0
  278. biotite/structure/geometry.py +817 -0
  279. biotite/structure/graphics/__init__.py +13 -0
  280. biotite/structure/graphics/atoms.py +243 -0
  281. biotite/structure/graphics/rna.py +298 -0
  282. biotite/structure/hbond.py +425 -0
  283. biotite/structure/info/__init__.py +24 -0
  284. biotite/structure/info/atom_masses.json +121 -0
  285. biotite/structure/info/atoms.py +98 -0
  286. biotite/structure/info/bonds.py +149 -0
  287. biotite/structure/info/ccd.py +200 -0
  288. biotite/structure/info/components.bcif +0 -0
  289. biotite/structure/info/groups.py +128 -0
  290. biotite/structure/info/masses.py +121 -0
  291. biotite/structure/info/misc.py +137 -0
  292. biotite/structure/info/radii.py +267 -0
  293. biotite/structure/info/standardize.py +185 -0
  294. biotite/structure/integrity.py +213 -0
  295. biotite/structure/io/__init__.py +29 -0
  296. biotite/structure/io/dcd/__init__.py +13 -0
  297. biotite/structure/io/dcd/file.py +67 -0
  298. biotite/structure/io/general.py +243 -0
  299. biotite/structure/io/gro/__init__.py +14 -0
  300. biotite/structure/io/gro/file.py +343 -0
  301. biotite/structure/io/mol/__init__.py +20 -0
  302. biotite/structure/io/mol/convert.py +112 -0
  303. biotite/structure/io/mol/ctab.py +420 -0
  304. biotite/structure/io/mol/header.py +120 -0
  305. biotite/structure/io/mol/mol.py +149 -0
  306. biotite/structure/io/mol/sdf.py +940 -0
  307. biotite/structure/io/netcdf/__init__.py +13 -0
  308. biotite/structure/io/netcdf/file.py +64 -0
  309. biotite/structure/io/pdb/__init__.py +20 -0
  310. biotite/structure/io/pdb/convert.py +389 -0
  311. biotite/structure/io/pdb/file.py +1380 -0
  312. biotite/structure/io/pdb/hybrid36.cpython-311-x86_64-linux-gnu.so +0 -0
  313. biotite/structure/io/pdb/hybrid36.pyx +242 -0
  314. biotite/structure/io/pdbqt/__init__.py +15 -0
  315. biotite/structure/io/pdbqt/convert.py +113 -0
  316. biotite/structure/io/pdbqt/file.py +688 -0
  317. biotite/structure/io/pdbx/__init__.py +23 -0
  318. biotite/structure/io/pdbx/bcif.py +674 -0
  319. biotite/structure/io/pdbx/cif.py +1091 -0
  320. biotite/structure/io/pdbx/component.py +251 -0
  321. biotite/structure/io/pdbx/compress.py +362 -0
  322. biotite/structure/io/pdbx/convert.py +2113 -0
  323. biotite/structure/io/pdbx/encoding.cpython-311-x86_64-linux-gnu.so +0 -0
  324. biotite/structure/io/pdbx/encoding.pyx +1078 -0
  325. biotite/structure/io/trajfile.py +696 -0
  326. biotite/structure/io/trr/__init__.py +13 -0
  327. biotite/structure/io/trr/file.py +43 -0
  328. biotite/structure/io/util.py +38 -0
  329. biotite/structure/io/xtc/__init__.py +13 -0
  330. biotite/structure/io/xtc/file.py +43 -0
  331. biotite/structure/mechanics.py +72 -0
  332. biotite/structure/molecules.py +337 -0
  333. biotite/structure/pseudoknots.py +622 -0
  334. biotite/structure/rdf.py +245 -0
  335. biotite/structure/repair.py +302 -0
  336. biotite/structure/residues.py +716 -0
  337. biotite/structure/rings.py +451 -0
  338. biotite/structure/sasa.cpython-311-x86_64-linux-gnu.so +0 -0
  339. biotite/structure/sasa.pyx +322 -0
  340. biotite/structure/segments.py +328 -0
  341. biotite/structure/sequence.py +110 -0
  342. biotite/structure/spacegroups.json +1567 -0
  343. biotite/structure/spacegroups.license +26 -0
  344. biotite/structure/sse.py +306 -0
  345. biotite/structure/superimpose.py +511 -0
  346. biotite/structure/tm.py +581 -0
  347. biotite/structure/transform.py +736 -0
  348. biotite/structure/util.py +160 -0
  349. biotite/version.py +34 -0
  350. biotite/visualize.py +375 -0
  351. biotite-1.5.0.dist-info/METADATA +162 -0
  352. biotite-1.5.0.dist-info/RECORD +354 -0
  353. biotite-1.5.0.dist-info/WHEEL +6 -0
  354. biotite-1.5.0.dist-info/licenses/LICENSE.rst +30 -0
@@ -0,0 +1,254 @@
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.application.viennarna"
6
+ __author__ = "Tom David Müller, Patrick Kunzmann"
7
+ __all__ = ["RNAfoldApp"]
8
+
9
+ from tempfile import NamedTemporaryFile
10
+ import numpy as np
11
+ from biotite.application.application import AppState, requires_state
12
+ from biotite.application.localapp import LocalApp, cleanup_tempfile
13
+ from biotite.application.viennarna.util import build_constraint_string
14
+ from biotite.sequence.io.fasta import FastaFile, set_sequence
15
+ from biotite.structure.dotbracket import base_pairs_from_dot_bracket
16
+
17
+
18
+ class RNAfoldApp(LocalApp):
19
+ """
20
+ Compute the minimum free energy secondary structure of a ribonucleic
21
+ acid sequence using *ViennaRNA's* *RNAfold* software.
22
+
23
+ Internally this creates a :class:`Popen` instance, which handles
24
+ the execution.
25
+
26
+ Parameters
27
+ ----------
28
+ sequence : NucleotideSequence
29
+ The RNA sequence.
30
+ temperature : int, optional
31
+ The temperature (°C) to be assumed for the energy parameters.
32
+ bin_path : str, optional
33
+ Path of the *RNAfold* binary.
34
+
35
+ Examples
36
+ --------
37
+
38
+ >>> sequence = NucleotideSequence("CGACGTAGATGCTAGCTGACTCGATGC")
39
+ >>> app = RNAfoldApp(sequence)
40
+ >>> app.start()
41
+ >>> app.join()
42
+ >>> print(app.get_free_energy())
43
+ -1.3
44
+ >>> print(app.get_dot_bracket())
45
+ (((.((((.......)).)))))....
46
+ """
47
+
48
+ def __init__(self, sequence, temperature=37, bin_path="RNAfold"):
49
+ self._sequence = sequence.copy()
50
+ self._temperature = str(temperature)
51
+ self._constraints = None
52
+ self._enforce = None
53
+ self._in_file = NamedTemporaryFile("w", suffix=".fa", delete=False)
54
+ super().__init__(bin_path)
55
+
56
+ def run(self):
57
+ # Insert no line breaks
58
+ # -> Extremely high value for characters per line
59
+ fasta_file = FastaFile(chars_per_line=np.iinfo(np.int32).max)
60
+ set_sequence(fasta_file, self._sequence)
61
+ if self._constraints is not None:
62
+ fasta_file.lines.append(self._constraints)
63
+ fasta_file.write(self._in_file)
64
+ self._in_file.flush()
65
+
66
+ options = [
67
+ "--noPS",
68
+ "-T",
69
+ self._temperature,
70
+ ]
71
+ if self._enforce is True:
72
+ options.append("--enforceConstraint")
73
+ if self._constraints is not None:
74
+ options.append("-C")
75
+
76
+ self.set_arguments(options + [self._in_file.name])
77
+ super().run()
78
+
79
+ def evaluate(self):
80
+ super().evaluate()
81
+ lines = self.get_stdout().splitlines()
82
+ content = lines[2]
83
+ dotbracket, free_energy = content.split(" ", maxsplit=1)
84
+ free_energy = float(free_energy[1:-1])
85
+
86
+ self._free_energy = free_energy
87
+ self._dotbracket = dotbracket
88
+
89
+ def clean_up(self):
90
+ super().clean_up()
91
+ cleanup_tempfile(self._in_file)
92
+
93
+ @requires_state(AppState.CREATED)
94
+ def set_temperature(self, temperature):
95
+ """
96
+ Adjust the energy parameters according to a temperature in
97
+ degrees Celsius.
98
+
99
+ Parameters
100
+ ----------
101
+ temperature : int
102
+ The temperature.
103
+ """
104
+ self._temperature = str(temperature)
105
+
106
+ @requires_state(AppState.CREATED)
107
+ def set_constraints(
108
+ self,
109
+ pairs=None,
110
+ paired=None,
111
+ unpaired=None,
112
+ downstream=None,
113
+ upstream=None,
114
+ enforce=False,
115
+ ):
116
+ """
117
+ Add constraints of known paired or unpaired bases to the folding
118
+ algorithm.
119
+
120
+ Constraints forbid pairs conflicting with the respective
121
+ constraint.
122
+
123
+ Parameters
124
+ ----------
125
+ pairs : ndarray, shape=(n,2), dtype=int, optional
126
+ Positions of constrained base pairs.
127
+ paired : ndarray, shape=(n,), dtype=int or dtype=bool, optional
128
+ Positions of bases that are paired with any other base.
129
+ unpaired : ndarray, shape=(n,), dtype=int or dtype=bool, optional
130
+ Positions of bases that are unpaired.
131
+ downstream : ndarray, shape=(n,), dtype=int or dtype=bool, optional
132
+ Positions of bases that are paired with any downstream base.
133
+ upstream : ndarray, shape=(n,), dtype=int or dtype=bool, optional
134
+ Positions of bases that are paired with any upstream base.
135
+ enforce : bool, optional
136
+ If set to true, the given constraints are enforced, i.e. a
137
+ the respective base pairs must form.
138
+ By default (false), a constraint does only forbid formation
139
+ of a pair that would conflict with this constraint.
140
+ """
141
+ self._constraints = build_constraint_string(
142
+ len(self._sequence), pairs, paired, unpaired, downstream, upstream
143
+ )
144
+ self._enforce = enforce
145
+
146
+ @requires_state(AppState.JOINED)
147
+ def get_free_energy(self):
148
+ """
149
+ Get the free energy (kcal/mol) of the suggested
150
+ secondary structure.
151
+
152
+ Returns
153
+ -------
154
+ free_energy : float
155
+ The free energy.
156
+
157
+ Examples
158
+ --------
159
+
160
+ >>> sequence = NucleotideSequence("CGACGTAGATGCTAGCTGACTCGATGC")
161
+ >>> app = RNAfoldApp(sequence)
162
+ >>> app.start()
163
+ >>> app.join()
164
+ >>> print(app.get_free_energy())
165
+ -1.3
166
+ """
167
+ return self._free_energy
168
+
169
+ @requires_state(AppState.JOINED)
170
+ def get_dot_bracket(self):
171
+ """
172
+ Get the minimum free energy secondary structure of the input
173
+ sequence in dot bracket notation.
174
+
175
+ Returns
176
+ -------
177
+ dotbracket : str
178
+ The secondary structure in dot bracket notation.
179
+
180
+ Examples
181
+ --------
182
+
183
+ >>> sequence = NucleotideSequence("CGACGTAGATGCTAGCTGACTCGATGC")
184
+ >>> app = RNAfoldApp(sequence)
185
+ >>> app.start()
186
+ >>> app.join()
187
+ >>> print(app.get_dot_bracket())
188
+ (((.((((.......)).)))))....
189
+ """
190
+ return self._dotbracket
191
+
192
+ @requires_state(AppState.JOINED)
193
+ def get_base_pairs(self):
194
+ """
195
+ Get the base pairs from the minimum free energy secondary
196
+ structure of the input sequence.
197
+
198
+ Returns
199
+ -------
200
+ base_pairs : ndarray, shape=(n,2)
201
+ Each row corresponds to the positions of the bases in the
202
+ sequence.
203
+
204
+ Examples
205
+ --------
206
+
207
+ >>> sequence = NucleotideSequence("CGACGTAGATGCTAGCTGACTCGATGC")
208
+ >>> app = RNAfoldApp(sequence)
209
+ >>> app.start()
210
+ >>> app.join()
211
+ >>> print(app.get_base_pairs())
212
+ [[ 0 22]
213
+ [ 1 21]
214
+ [ 2 20]
215
+ [ 4 19]
216
+ [ 5 18]
217
+ [ 6 16]
218
+ [ 7 15]]
219
+
220
+ For reference, the corresponding dot bracket notation can be
221
+ displayed as below.
222
+
223
+ >>> print(app.get_dot_bracket())
224
+ (((.((((.......)).)))))....
225
+ """
226
+ return base_pairs_from_dot_bracket(self._dotbracket)
227
+
228
+ @staticmethod
229
+ def compute_secondary_structure(sequence, bin_path="RNAfold"):
230
+ """
231
+ Compute the minimum free energy secondary structure of a
232
+ ribonucleic acid sequence using *ViennaRNA's* *RNAfold* software.
233
+
234
+ This is a convenience function, that wraps the
235
+ :class:`RNAfoldApp` execution.
236
+
237
+ Parameters
238
+ ----------
239
+ sequence : NucleotideSequence
240
+ The RNA sequence.
241
+ bin_path : str, optional
242
+ Path of the *RNAfold* binary.
243
+
244
+ Returns
245
+ -------
246
+ dotbracket : str
247
+ The secondary structure in dot bracket notation.
248
+ free_energy : float
249
+ The free energy.
250
+ """
251
+ app = RNAfoldApp(sequence, bin_path=bin_path)
252
+ app.start()
253
+ app.join()
254
+ return app.get_dot_bracket(), app.get_free_energy()
@@ -0,0 +1,208 @@
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.application.viennarna"
6
+ __author__ = "Tom David Müller"
7
+ __all__ = ["RNAplotApp"]
8
+
9
+ from enum import IntEnum
10
+ from os import remove
11
+ from tempfile import NamedTemporaryFile
12
+ import numpy as np
13
+ from biotite.application.application import AppState, requires_state
14
+ from biotite.application.localapp import LocalApp, cleanup_tempfile
15
+ from biotite.structure.dotbracket import dot_bracket as dot_bracket_
16
+
17
+
18
+ class RNAplotApp(LocalApp):
19
+ """
20
+ Get coordinates for a 2D representation of any unknotted RNA
21
+ structure using *ViennaRNA's* *RNAplot*.
22
+
23
+ The structure has to be provided either in dot bracket notation or
24
+ as a ``ndarray`` of base pairs and the total sequence length.
25
+
26
+ Internally this creates a :class:`Popen` instance, which handles
27
+ the execution.
28
+
29
+ Parameters
30
+ ----------
31
+ dot_bracket : str, optional
32
+ The structure in dot bracket notation.
33
+ base_pairs : ndarray, shape=(n,2), optional
34
+ Each row corresponds to the positions of the bases in the
35
+ strand. This parameter is mutually exclusive to ``dot_bracket``.
36
+ length : int, optional
37
+ The number of bases in the strand. This parameter is required if
38
+ ``base_pairs`` is given.
39
+ layout_type : RNAplotApp.Layout, optional
40
+ The layout type according to the *RNAplot* documentation.
41
+ bin_path : str, optional
42
+ Path of the *RNAplot* binary.
43
+
44
+ Examples
45
+ --------
46
+
47
+ >>> app = RNAplotApp('((..))')
48
+ >>> app.start()
49
+ >>> app.join()
50
+ >>> print(app.get_coordinates())
51
+ [[ -92.50 92.50]
52
+ [ -92.50 77.50]
53
+ [ -90.31 58.24]
54
+ [-109.69 58.24]
55
+ [-107.50 77.50]
56
+ [-107.50 92.50]]
57
+ """
58
+
59
+ class Layout(IntEnum):
60
+ """
61
+ This enum type represents the layout type of the plot according
62
+ to the official *RNAplot* orientation.
63
+ """
64
+
65
+ RADIAL = (0,)
66
+ NAVIEW = (1,)
67
+ CIRCULAR = (2,)
68
+ RNATURTLE = (3,)
69
+ RNAPUZZLER = 4
70
+
71
+ def __init__(
72
+ self,
73
+ dot_bracket=None,
74
+ base_pairs=None,
75
+ length=None,
76
+ layout_type=Layout.NAVIEW,
77
+ bin_path="RNAplot",
78
+ ):
79
+ super().__init__(bin_path)
80
+
81
+ if dot_bracket is not None:
82
+ self._dot_bracket = dot_bracket
83
+ elif (base_pairs is not None) and (length is not None):
84
+ self._dot_bracket = dot_bracket_(
85
+ base_pairs, length, max_pseudoknot_order=0
86
+ )[0]
87
+ else:
88
+ raise ValueError(
89
+ "Structure has to be provided in either dot bracket notation "
90
+ "or as base pairs and total sequence length"
91
+ )
92
+
93
+ # Get the value of the enum type
94
+ self._layout_type = str(int(layout_type))
95
+ self._in_file = NamedTemporaryFile("w", suffix=".fold", delete=False)
96
+
97
+ def run(self):
98
+ self._in_file.write("N" * len(self._dot_bracket) + "\n")
99
+ self._in_file.write(self._dot_bracket)
100
+ self._in_file.flush()
101
+ self.set_arguments(
102
+ [
103
+ "-i", self._in_file.name,
104
+ "--output-format", "xrna",
105
+ "-t", self._layout_type,
106
+ ]
107
+ ) # fmt: skip
108
+ super().run()
109
+
110
+ def evaluate(self):
111
+ super().evaluate()
112
+ self._coordinates = np.loadtxt("rna.ss", usecols=(2, 3))
113
+
114
+ def clean_up(self):
115
+ super().clean_up()
116
+ cleanup_tempfile(self._in_file)
117
+ remove("rna.ss")
118
+
119
+ @requires_state(AppState.CREATED)
120
+ def set_layout_type(self, layout_type):
121
+ """
122
+ Adjust the layout type for the plot according to the *RNAplot*
123
+ documentation.
124
+
125
+ Parameters
126
+ ----------
127
+ layout_type : RNAplotApp.Layout
128
+ The layout type.
129
+ """
130
+ self._layout_type = str(layout_type)
131
+
132
+ @requires_state(AppState.JOINED)
133
+ def get_coordinates(self):
134
+ """
135
+ Get coordinates for a 2D representation of the input structure.
136
+
137
+ Returns
138
+ -------
139
+ coordinates : ndarray, shape=(n,2)
140
+ The 2D coordinates. Each row represents the *x* and *y*
141
+ coordinates for a total sequence length of *n*.
142
+
143
+ Examples
144
+ --------
145
+
146
+ >>> app = RNAplotApp('((..))')
147
+ >>> app.start()
148
+ >>> app.join()
149
+ >>> print(app.get_coordinates())
150
+ [[ -92.50 92.50]
151
+ [ -92.50 77.50]
152
+ [ -90.31 58.24]
153
+ [-109.69 58.24]
154
+ [-107.50 77.50]
155
+ [-107.50 92.50]]
156
+ """
157
+ return self._coordinates
158
+
159
+ @staticmethod
160
+ def compute_coordinates(
161
+ dot_bracket=None,
162
+ base_pairs=None,
163
+ length=None,
164
+ layout_type=Layout.NAVIEW,
165
+ bin_path="RNAplot",
166
+ ):
167
+ """
168
+ Get coordinates for a 2D representation of any unknotted RNA
169
+ structure using *ViennaRNA's* *RNAplot*.
170
+
171
+ The structure has to be provided either in dot bracket notation
172
+ or as a ``ndarray`` of base pairs and the total sequence length.
173
+
174
+ This is a convenience function, that wraps the
175
+ :class:`RNAplotApp` execution.
176
+
177
+ Parameters
178
+ ----------
179
+ dot_bracket : str, optional
180
+ The structure in dot bracket notation.
181
+ base_pairs : ndarray, shape=(n,2), optional
182
+ Each row corresponds to the positions of the bases in the
183
+ strand. This parameter is mutually exclusive to
184
+ ``dot_bracket``.
185
+ length : int, optional
186
+ The number of bases in the strand. This parameter is
187
+ required if ``base_pairs`` is given.
188
+ layout_type : Layout
189
+ The desired layout of the plot.
190
+ bin_path : str, optional
191
+ Path of the *RNAplot* binary.
192
+
193
+ Returns
194
+ -------
195
+ coordinates : ndarray, shape=(n,2)
196
+ The 2D coordinates. Each row represents the *x* and *y*
197
+ coordinates for a total sequence length of *n*.
198
+ """
199
+ app = RNAplotApp(
200
+ dot_bracket=dot_bracket,
201
+ base_pairs=base_pairs,
202
+ length=length,
203
+ layout_type=layout_type,
204
+ bin_path=bin_path,
205
+ )
206
+ app.start()
207
+ app.join()
208
+ return app.get_coordinates()
@@ -0,0 +1,77 @@
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.application.viennarna"
6
+ __author__ = "Patrick Kunzmann"
7
+ __all__ = ["build_constraint_string"]
8
+
9
+ import numpy as np
10
+ from biotite.structure.pseudoknots import pseudoknots
11
+
12
+
13
+ def build_constraint_string(
14
+ sequence_length,
15
+ pairs=None,
16
+ paired=None,
17
+ unpaired=None,
18
+ downstream=None,
19
+ upstream=None,
20
+ ):
21
+ """
22
+ Build a ViennaRNA constraint string.
23
+
24
+ Parameters
25
+ ----------
26
+ sequence_length : int
27
+ The length of the string to be built.
28
+ pairs : ndarray, shape=(n,2), dtype=int, optional
29
+ Positions of constrained base pairs.
30
+ paired : ndarray, shape=(n,), dtype=int or dtype=bool, optional
31
+ Positions of bases that are paired with any other base.
32
+ unpaired : ndarray, shape=(n,), dtype=int or dtype=bool, optional
33
+ Positions of bases that are unpaired.
34
+ downstream : ndarray, shape=(n,), dtype=int or dtype=bool, optional
35
+ Positions of bases that are paired with any downstream base.
36
+ upstream : ndarray, shape=(n,), dtype=int or dtype=bool, optional
37
+ Positions of bases that are paired with any upstream base.
38
+
39
+ Returns
40
+ -------
41
+ constraints : str
42
+ The constraint string.
43
+ """
44
+ constraints = np.full(sequence_length, ".", dtype="U1")
45
+
46
+ if pairs is not None:
47
+ pairs = np.asarray(pairs)
48
+ # Ensure that pairs do not contain pseudoknots
49
+ if (pseudoknots(pairs, max_pseudoknot_order=1) == -1).any():
50
+ raise ValueError("Given pairs include pseudoknots")
51
+ # Ensure the lower base comes first for each pair
52
+ pairs = np.sort(pairs, axis=-1)
53
+ _set_constraints(constraints, pairs[:, 0], "(")
54
+ _set_constraints(constraints, pairs[:, 1], ")")
55
+
56
+ _set_constraints(constraints, paired, "|")
57
+ _set_constraints(constraints, unpaired, "x")
58
+ _set_constraints(constraints, downstream, "<")
59
+ _set_constraints(constraints, upstream, ">")
60
+
61
+ return "".join(constraints)
62
+
63
+
64
+ def _set_constraints(constraints, index, character):
65
+ if index is None:
66
+ return
67
+
68
+ # Search for conflicts with other constraints
69
+ potential_conflict_indices = np.where(constraints[index] != ".")[0]
70
+ if len(potential_conflict_indices) > 0:
71
+ conflict_i = index[potential_conflict_indices[0]]
72
+ raise ValueError(
73
+ f"Constraint '{character}' at position {conflict_i} "
74
+ f"conflicts with existing constraint '{constraints[conflict_i]}'"
75
+ )
76
+
77
+ constraints[index] = character
@@ -0,0 +1,76 @@
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.application"
6
+ __author__ = "Patrick Kunzmann"
7
+ __all__ = ["WebApp", "RuleViolationError"]
8
+
9
+ import abc
10
+ from biotite.application.application import Application
11
+
12
+
13
+ class WebApp(Application, metaclass=abc.ABCMeta):
14
+ """
15
+ The base class for all web based applications.
16
+
17
+ It allows for getting and setting the URL of the app and raises
18
+ an :class:`RuleViolationError` when a subclass calls
19
+ :func:`violate_rule()`
20
+ (e.g. when the server was contacted too often.)
21
+
22
+ Be careful, when calling func:`get_app_state()`. This may involve a
23
+ server contact and therefore frequent calls may raise a
24
+ :class:`RuleViolationError`.
25
+
26
+ Parameters
27
+ ----------
28
+ app_url : str
29
+ URL of the web app.
30
+ obey_rules : bool, optional
31
+ If true, the application raises an :class:`RuleViolationError`, if
32
+ the server rules are violated.
33
+ """
34
+
35
+ def __init__(self, app_url, obey_rules=True):
36
+ super().__init__()
37
+ self._obey_rules = obey_rules
38
+ self._app_url = app_url
39
+
40
+ def violate_rule(self, msg=None):
41
+ """
42
+ Indicate that a server rule was violated, i.e. this raises a
43
+ :class:`RuleViolationError` unless `obey_rules` is false.
44
+
45
+ PROTECTED: Do not call from outside.
46
+
47
+ Parameters
48
+ ----------
49
+ msg : str, optional
50
+ A custom message for the :class:`RuleViolationError`.
51
+ """
52
+ if self._obey_rules:
53
+ if msg is None:
54
+ raise RuleViolationError("The user guidelines would be violated")
55
+ else:
56
+ raise RuleViolationError(msg)
57
+
58
+ def app_url(self):
59
+ """
60
+ Get the URL of the web app.
61
+
62
+ Returns
63
+ -------
64
+ url : str
65
+ URL of the web app.
66
+ """
67
+ return self._app_url
68
+
69
+
70
+ class RuleViolationError(Exception):
71
+ """
72
+ Indicates that the user guidelines of the web application would be
73
+ violated, if the program continued.
74
+ """
75
+
76
+ pass
biotite/copyable.py ADDED
@@ -0,0 +1,71 @@
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"
6
+ __author__ = "Patrick Kunzmann"
7
+ __all__ = ["Copyable"]
8
+
9
+ import abc
10
+
11
+
12
+ class Copyable(metaclass=abc.ABCMeta):
13
+ """
14
+ Base class for all objects, that should be copyable.
15
+
16
+ The public method `copy()` first creates a fresh instance of the
17
+ class of the instance, that is copied via the `__copy_create__()`
18
+ method. All variables, that could not be set via the constructor,
19
+ are then copied via `__copy_fill__()`, starting with the method in
20
+ the uppermost base class and ending with the class of the instance
21
+ to be copied.
22
+
23
+ This approach solves the problem of encapsulated variables in
24
+ superclasses.
25
+ """
26
+
27
+ def copy(self):
28
+ """
29
+ Create a deep copy of this object.
30
+
31
+ Returns
32
+ -------
33
+ copy
34
+ A copy of this object.
35
+ """
36
+ clone = self.__copy_create__()
37
+ self.__copy_fill__(clone)
38
+ return clone
39
+
40
+ def __copy_create__(self):
41
+ """
42
+ Instantiate a new object of this class.
43
+
44
+ Only the constructor should be called in this method.
45
+ All further attributes, that need to be copied are handled
46
+ in `__copy_fill__()`
47
+
48
+ Do not call the `super()` method here.
49
+
50
+ This method must be overridden, if the constructor takes
51
+ parameters.
52
+
53
+ Returns
54
+ -------
55
+ copy
56
+ A freshly instantiated copy of *self*.
57
+ """
58
+ return type(self)()
59
+
60
+ def __copy_fill__(self, clone):
61
+ """
62
+ Copy all necessary attributes to the new object.
63
+
64
+ Always call the `super()` method as first statement.
65
+
66
+ Parameters
67
+ ----------
68
+ clone
69
+ The freshly instantiated copy of *self*.
70
+ """
71
+ pass
@@ -0,0 +1,23 @@
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
+ A subpackage for fetching data from online databases.
7
+
8
+ Each subpackage of the database package contains an interface for a
9
+ specific database.
10
+
11
+ All subpackages provide at least two functions:
12
+ :func:`search()` is used to search for IDs (e.g. PDB ID) that match the
13
+ given search parameters.
14
+ The search parameters are usually abstracted by the respective
15
+ :class:`Query` objects.
16
+ Then the obtained IDs can be given to the :func:`fetch()` function to
17
+ download the associated files.
18
+ """
19
+
20
+ __name__ = "biotite.database"
21
+ __author__ = "Patrick Kunzmann"
22
+
23
+ from .error import *