react-cheminfo 0.22.0 → 0.24.0

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.
Files changed (464) hide show
  1. package/README.md +51 -28
  2. package/lib/chrome/ui/HeaderToggle.d.ts +52 -0
  3. package/lib/chrome/ui/HeaderToggle.d.ts.map +1 -0
  4. package/lib/chrome/ui/HeaderToggle.js +31 -0
  5. package/lib/chrome/ui/HeaderToggle.js.map +1 -0
  6. package/lib/chrome/ui/index.d.ts +2 -0
  7. package/lib/chrome/ui/index.d.ts.map +1 -1
  8. package/lib/chrome/ui/index.js +1 -0
  9. package/lib/chrome/ui/index.js.map +1 -1
  10. package/lib/citation/core/gfn2Paper.d.ts +10 -0
  11. package/lib/citation/core/gfn2Paper.d.ts.map +1 -0
  12. package/lib/citation/core/gfn2Paper.js +28 -0
  13. package/lib/citation/core/gfn2Paper.js.map +1 -0
  14. package/lib/citation/core/index.d.ts +1 -0
  15. package/lib/citation/core/index.d.ts.map +1 -1
  16. package/lib/citation/core/index.js +1 -0
  17. package/lib/citation/core/index.js.map +1 -1
  18. package/lib/clipboard/ui/ClickToCopy.d.ts +8 -7
  19. package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
  20. package/lib/clipboard/ui/ClickToCopy.js +3 -3
  21. package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
  22. package/lib/conformers.d.ts +27 -0
  23. package/lib/conformers.d.ts.map +1 -0
  24. package/lib/conformers.js +19 -0
  25. package/lib/conformers.js.map +1 -0
  26. package/lib/core.d.ts +1 -0
  27. package/lib/core.d.ts.map +1 -1
  28. package/lib/core.js +1 -0
  29. package/lib/core.js.map +1 -1
  30. package/lib/credits/core/credits.d.ts +12 -0
  31. package/lib/credits/core/credits.d.ts.map +1 -1
  32. package/lib/credits/core/credits.js +14 -0
  33. package/lib/credits/core/credits.js.map +1 -1
  34. package/lib/ecosystem/core/index.d.ts +1 -1
  35. package/lib/ecosystem/core/index.d.ts.map +1 -1
  36. package/lib/ecosystem/core/index.js.map +1 -1
  37. package/lib/ecosystem/core/sites.d.ts +11 -1
  38. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  39. package/lib/ecosystem/core/sites.js +7 -2
  40. package/lib/ecosystem/core/sites.js.map +1 -1
  41. package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -1
  42. package/lib/ecosystem/ui/EcosystemLinks.js +3 -1
  43. package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
  44. package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
  45. package/lib/ecosystem/ui/SiteTile.js +3 -1
  46. package/lib/ecosystem/ui/SiteTile.js.map +1 -1
  47. package/lib/format/core/index.d.ts +1 -1
  48. package/lib/format/core/index.d.ts.map +1 -1
  49. package/lib/format/core/index.js +1 -1
  50. package/lib/format/core/index.js.map +1 -1
  51. package/lib/format/core/words.d.ts +9 -0
  52. package/lib/format/core/words.d.ts.map +1 -1
  53. package/lib/format/core/words.js +16 -0
  54. package/lib/format/core/words.js.map +1 -1
  55. package/lib/language/core/index.d.ts +3 -0
  56. package/lib/language/core/index.d.ts.map +1 -0
  57. package/lib/language/core/index.js +3 -0
  58. package/lib/language/core/index.js.map +1 -0
  59. package/lib/language/core/languageName.d.ts +8 -0
  60. package/lib/language/core/languageName.d.ts.map +1 -0
  61. package/lib/language/core/languageName.js +16 -0
  62. package/lib/language/core/languageName.js.map +1 -0
  63. package/lib/language/core/languageParam.d.ts +35 -0
  64. package/lib/language/core/languageParam.d.ts.map +1 -0
  65. package/lib/language/core/languageParam.js +67 -0
  66. package/lib/language/core/languageParam.js.map +1 -0
  67. package/lib/language/ui/SiteLanguage.d.ts +20 -0
  68. package/lib/language/ui/SiteLanguage.d.ts.map +1 -0
  69. package/lib/language/ui/SiteLanguage.js +14 -0
  70. package/lib/language/ui/SiteLanguage.js.map +1 -0
  71. package/lib/language/ui/index.d.ts +4 -0
  72. package/lib/language/ui/index.d.ts.map +1 -0
  73. package/lib/language/ui/index.js +3 -0
  74. package/lib/language/ui/index.js.map +1 -0
  75. package/lib/language/ui/siteLanguageContext.d.ts +12 -0
  76. package/lib/language/ui/siteLanguageContext.d.ts.map +1 -0
  77. package/lib/language/ui/siteLanguageContext.js +19 -0
  78. package/lib/language/ui/siteLanguageContext.js.map +1 -0
  79. package/lib/orbital/core/atomicOrbitals.d.ts +9 -1
  80. package/lib/orbital/core/atomicOrbitals.d.ts.map +1 -1
  81. package/lib/orbital/core/atomicOrbitals.js +7 -0
  82. package/lib/orbital/core/atomicOrbitals.js.map +1 -1
  83. package/lib/orbital/core/hydrogenic.d.ts +2 -1
  84. package/lib/orbital/core/hydrogenic.d.ts.map +1 -1
  85. package/lib/orbital/core/hydrogenic.js +2 -1
  86. package/lib/orbital/core/hydrogenic.js.map +1 -1
  87. package/lib/orbital/core/index.d.ts +1 -0
  88. package/lib/orbital/core/index.d.ts.map +1 -1
  89. package/lib/orbital/core/index.js +1 -0
  90. package/lib/orbital/core/index.js.map +1 -1
  91. package/lib/orbital/core/slaterEnergy.d.ts +35 -0
  92. package/lib/orbital/core/slaterEnergy.d.ts.map +1 -0
  93. package/lib/orbital/core/slaterEnergy.js +66 -0
  94. package/lib/orbital/core/slaterEnergy.js.map +1 -0
  95. package/lib/overlay/core/index.d.ts +2 -2
  96. package/lib/overlay/core/index.d.ts.map +1 -1
  97. package/lib/overlay/core/index.js +1 -1
  98. package/lib/overlay/core/index.js.map +1 -1
  99. package/lib/overlay/core/overlayMarks.d.ts +20 -5
  100. package/lib/overlay/core/overlayMarks.d.ts.map +1 -1
  101. package/lib/overlay/core/overlayMarks.js +31 -5
  102. package/lib/overlay/core/overlayMarks.js.map +1 -1
  103. package/lib/overlay/ui/OverlayLegendMark.js +5 -0
  104. package/lib/overlay/ui/OverlayLegendMark.js.map +1 -1
  105. package/lib/projection/core/index.d.ts +4 -4
  106. package/lib/projection/core/index.d.ts.map +1 -1
  107. package/lib/projection/core/index.js +2 -2
  108. package/lib/projection/core/index.js.map +1 -1
  109. package/lib/projection/core/projectionCopy.d.ts +2 -0
  110. package/lib/projection/core/projectionCopy.d.ts.map +1 -1
  111. package/lib/projection/core/projectionCopy.js +1 -0
  112. package/lib/projection/core/projectionCopy.js.map +1 -1
  113. package/lib/projection/core/projectionGroupings.d.ts +44 -0
  114. package/lib/projection/core/projectionGroupings.d.ts.map +1 -0
  115. package/lib/projection/core/projectionGroupings.js +132 -0
  116. package/lib/projection/core/projectionGroupings.js.map +1 -0
  117. package/lib/projection/core/projectionOptions.d.ts +16 -6
  118. package/lib/projection/core/projectionOptions.d.ts.map +1 -1
  119. package/lib/projection/core/projectionOptions.js +7 -1
  120. package/lib/projection/core/projectionOptions.js.map +1 -1
  121. package/lib/projection/core/projectionPanelWords.d.ts +6 -0
  122. package/lib/projection/core/projectionPanelWords.d.ts.map +1 -1
  123. package/lib/projection/core/projectionPanelWords.js +4 -0
  124. package/lib/projection/core/projectionPanelWords.js.map +1 -1
  125. package/lib/projection/core/projectionSamples.d.ts +63 -32
  126. package/lib/projection/core/projectionSamples.d.ts.map +1 -1
  127. package/lib/projection/core/projectionSamples.js +1 -80
  128. package/lib/projection/core/projectionSamples.js.map +1 -1
  129. package/lib/projection/core/projectionStrings.d.ts +2 -0
  130. package/lib/projection/core/projectionStrings.d.ts.map +1 -1
  131. package/lib/projection/core/projectionStrings.js +10 -1
  132. package/lib/projection/core/projectionStrings.js.map +1 -1
  133. package/lib/projection/core/resolveProjectionOptions.d.ts +8 -3
  134. package/lib/projection/core/resolveProjectionOptions.d.ts.map +1 -1
  135. package/lib/projection/core/resolveProjectionOptions.js +58 -5
  136. package/lib/projection/core/resolveProjectionOptions.js.map +1 -1
  137. package/lib/projection/ui/ProjectionBar.d.ts +1 -1
  138. package/lib/projection/ui/ProjectionBar.d.ts.map +1 -1
  139. package/lib/projection/ui/ProjectionBar.js +3 -1
  140. package/lib/projection/ui/ProjectionBar.js.map +1 -1
  141. package/lib/projection/ui/ProjectionGroupingPickers.d.ts +38 -0
  142. package/lib/projection/ui/ProjectionGroupingPickers.d.ts.map +1 -0
  143. package/lib/projection/ui/ProjectionGroupingPickers.js +33 -0
  144. package/lib/projection/ui/ProjectionGroupingPickers.js.map +1 -0
  145. package/lib/projection/ui/ProjectionMapControls.d.ts +6 -7
  146. package/lib/projection/ui/ProjectionMapControls.d.ts.map +1 -1
  147. package/lib/projection/ui/ProjectionMapControls.js +11 -9
  148. package/lib/projection/ui/ProjectionMapControls.js.map +1 -1
  149. package/lib/projection/ui/ProjectionMapLegend.d.ts.map +1 -1
  150. package/lib/projection/ui/ProjectionMapLegend.js +1 -1
  151. package/lib/projection/ui/ProjectionMapLegend.js.map +1 -1
  152. package/lib/projection/ui/ProjectionMapMore.d.ts +2 -2
  153. package/lib/projection/ui/ProjectionMapMore.d.ts.map +1 -1
  154. package/lib/projection/ui/ProjectionMapMore.js +7 -5
  155. package/lib/projection/ui/ProjectionMapMore.js.map +1 -1
  156. package/lib/projection/ui/ProjectionMapTab.d.ts +15 -6
  157. package/lib/projection/ui/ProjectionMapTab.d.ts.map +1 -1
  158. package/lib/projection/ui/ProjectionMapTab.js +11 -7
  159. package/lib/projection/ui/ProjectionMapTab.js.map +1 -1
  160. package/lib/projection/ui/ProjectionPairsMore.d.ts +3 -7
  161. package/lib/projection/ui/ProjectionPairsMore.d.ts.map +1 -1
  162. package/lib/projection/ui/ProjectionPairsMore.js +4 -5
  163. package/lib/projection/ui/ProjectionPairsMore.js.map +1 -1
  164. package/lib/projection/ui/ProjectionPairsTab.d.ts.map +1 -1
  165. package/lib/projection/ui/ProjectionPairsTab.js +2 -2
  166. package/lib/projection/ui/ProjectionPairsTab.js.map +1 -1
  167. package/lib/projection/ui/ProjectionPanel.d.ts +1 -1
  168. package/lib/projection/ui/ProjectionPanel.d.ts.map +1 -1
  169. package/lib/projection/ui/ProjectionPanel.js +1 -1
  170. package/lib/projection/ui/ProjectionPanel.js.map +1 -1
  171. package/lib/projection/ui/ProjectionReadout.d.ts +7 -1
  172. package/lib/projection/ui/ProjectionReadout.d.ts.map +1 -1
  173. package/lib/projection/ui/ProjectionReadout.js +19 -7
  174. package/lib/projection/ui/ProjectionReadout.js.map +1 -1
  175. package/lib/projection/ui/ProjectionSpaceControls.d.ts +3 -5
  176. package/lib/projection/ui/ProjectionSpaceControls.d.ts.map +1 -1
  177. package/lib/projection/ui/ProjectionSpaceControls.js +9 -7
  178. package/lib/projection/ui/ProjectionSpaceControls.js.map +1 -1
  179. package/lib/projection/ui/ProjectionSpaceMore.d.ts +2 -2
  180. package/lib/projection/ui/ProjectionSpaceMore.d.ts.map +1 -1
  181. package/lib/projection/ui/ProjectionSpaceMore.js +5 -4
  182. package/lib/projection/ui/ProjectionSpaceMore.js.map +1 -1
  183. package/lib/projection/ui/ProjectionSpaceTab.d.ts +11 -3
  184. package/lib/projection/ui/ProjectionSpaceTab.d.ts.map +1 -1
  185. package/lib/projection/ui/ProjectionSpaceTab.js +7 -4
  186. package/lib/projection/ui/ProjectionSpaceTab.js.map +1 -1
  187. package/lib/projection/ui/ProjectionViewer.d.ts.map +1 -1
  188. package/lib/projection/ui/ProjectionViewer.js +1 -0
  189. package/lib/projection/ui/ProjectionViewer.js.map +1 -1
  190. package/lib/projection/ui/projectionBarReadings.d.ts +4 -1
  191. package/lib/projection/ui/projectionBarReadings.d.ts.map +1 -1
  192. package/lib/projection/ui/projectionBarReadings.js +14 -4
  193. package/lib/projection/ui/projectionBarReadings.js.map +1 -1
  194. package/lib/projection/ui/projectionBarSlots.d.ts +4 -2
  195. package/lib/projection/ui/projectionBarSlots.d.ts.map +1 -1
  196. package/lib/projection/ui/projectionBarSlots.js +3 -7
  197. package/lib/projection/ui/projectionBarSlots.js.map +1 -1
  198. package/lib/projection/ui/projectionMapChoices.d.ts +31 -6
  199. package/lib/projection/ui/projectionMapChoices.d.ts.map +1 -1
  200. package/lib/projection/ui/projectionMapChoices.js +58 -9
  201. package/lib/projection/ui/projectionMapChoices.js.map +1 -1
  202. package/lib/projection/ui/projectionMapChrome.d.ts +3 -9
  203. package/lib/projection/ui/projectionMapChrome.d.ts.map +1 -1
  204. package/lib/projection/ui/projectionMapChrome.js +41 -27
  205. package/lib/projection/ui/projectionMapChrome.js.map +1 -1
  206. package/lib/projection/ui/projectionMapCorner.d.ts +25 -0
  207. package/lib/projection/ui/projectionMapCorner.d.ts.map +1 -0
  208. package/lib/projection/ui/projectionMapCorner.js +46 -0
  209. package/lib/projection/ui/projectionMapCorner.js.map +1 -0
  210. package/lib/projection/ui/projectionMapModel.d.ts +9 -18
  211. package/lib/projection/ui/projectionMapModel.d.ts.map +1 -1
  212. package/lib/projection/ui/projectionMapModel.js +14 -39
  213. package/lib/projection/ui/projectionMapModel.js.map +1 -1
  214. package/lib/projection/ui/projectionMapView.d.ts +3 -1
  215. package/lib/projection/ui/projectionMapView.d.ts.map +1 -1
  216. package/lib/projection/ui/projectionMapView.js +9 -4
  217. package/lib/projection/ui/projectionMapView.js.map +1 -1
  218. package/lib/projection/ui/projectionSelectionSentence.d.ts +10 -0
  219. package/lib/projection/ui/projectionSelectionSentence.d.ts.map +1 -0
  220. package/lib/projection/ui/projectionSelectionSentence.js +18 -0
  221. package/lib/projection/ui/projectionSelectionSentence.js.map +1 -0
  222. package/lib/projection/ui/projectionStateApi.d.ts +47 -0
  223. package/lib/projection/ui/projectionStateApi.d.ts.map +1 -0
  224. package/lib/projection/ui/projectionStateApi.js +9 -0
  225. package/lib/projection/ui/projectionStateApi.js.map +1 -0
  226. package/lib/projection/ui/projectionTabModels.js +1 -1
  227. package/lib/projection/ui/projectionTabModels.js.map +1 -1
  228. package/lib/projection/ui/useProjectionState.d.ts +1 -29
  229. package/lib/projection/ui/useProjectionState.d.ts.map +1 -1
  230. package/lib/projection/ui/useProjectionState.js +13 -5
  231. package/lib/projection/ui/useProjectionState.js.map +1 -1
  232. package/lib/scatter/core/index.d.ts +1 -0
  233. package/lib/scatter/core/index.d.ts.map +1 -1
  234. package/lib/scatter/core/index.js +1 -0
  235. package/lib/scatter/core/index.js.map +1 -1
  236. package/lib/scatter/core/pointShape.d.ts +18 -0
  237. package/lib/scatter/core/pointShape.d.ts.map +1 -0
  238. package/lib/scatter/core/pointShape.js +70 -0
  239. package/lib/scatter/core/pointShape.js.map +1 -0
  240. package/lib/scatter/ui/ScatterPlot.d.ts.map +1 -1
  241. package/lib/scatter/ui/ScatterPlot.js +3 -2
  242. package/lib/scatter/ui/ScatterPlot.js.map +1 -1
  243. package/lib/scatter/ui/ScatterPointLayer.d.ts +14 -1
  244. package/lib/scatter/ui/ScatterPointLayer.d.ts.map +1 -1
  245. package/lib/scatter/ui/ScatterPointLayer.js +15 -3
  246. package/lib/scatter/ui/ScatterPointLayer.js.map +1 -1
  247. package/lib/scatter/ui/scatterFigureProps.d.ts +13 -0
  248. package/lib/scatter/ui/scatterFigureProps.d.ts.map +1 -1
  249. package/lib/scatter/ui/scatterMarkGlyph.d.ts +2 -1
  250. package/lib/scatter/ui/scatterMarkGlyph.d.ts.map +1 -1
  251. package/lib/scatter/ui/scatterMarkGlyph.js +7 -1
  252. package/lib/scatter/ui/scatterMarkGlyph.js.map +1 -1
  253. package/lib/scatter3d/ui/ScatterCloud.d.ts.map +1 -1
  254. package/lib/scatter3d/ui/ScatterCloud.js +2 -1
  255. package/lib/scatter3d/ui/ScatterCloud.js.map +1 -1
  256. package/lib/shared/ui/MenuButton.d.ts +3 -2
  257. package/lib/shared/ui/MenuButton.d.ts.map +1 -1
  258. package/lib/shared/ui/MenuButton.js +1 -1
  259. package/lib/shared/ui/MenuButton.js.map +1 -1
  260. package/lib/structure/core/conformerMinimise.d.ts +36 -0
  261. package/lib/structure/core/conformerMinimise.d.ts.map +1 -0
  262. package/lib/structure/core/conformerMinimise.js +81 -0
  263. package/lib/structure/core/conformerMinimise.js.map +1 -0
  264. package/lib/structure/core/conformerMinimum.d.ts +62 -0
  265. package/lib/structure/core/conformerMinimum.d.ts.map +1 -0
  266. package/lib/structure/core/conformerMinimum.js +90 -0
  267. package/lib/structure/core/conformerMinimum.js.map +1 -0
  268. package/lib/structure/core/conformerOptions.d.ts +62 -0
  269. package/lib/structure/core/conformerOptions.d.ts.map +1 -0
  270. package/lib/structure/core/conformerOptions.js +83 -0
  271. package/lib/structure/core/conformerOptions.js.map +1 -0
  272. package/lib/structure/core/conformerRefine.d.ts +104 -0
  273. package/lib/structure/core/conformerRefine.d.ts.map +1 -0
  274. package/lib/structure/core/conformerRefine.js +130 -0
  275. package/lib/structure/core/conformerRefine.js.map +1 -0
  276. package/lib/structure/core/conformerRefineRank.d.ts +36 -0
  277. package/lib/structure/core/conformerRefineRank.d.ts.map +1 -0
  278. package/lib/structure/core/conformerRefineRank.js +69 -0
  279. package/lib/structure/core/conformerRefineRank.js.map +1 -0
  280. package/lib/structure/core/conformerSession.d.ts +50 -0
  281. package/lib/structure/core/conformerSession.d.ts.map +1 -0
  282. package/lib/structure/core/conformerSession.js +88 -0
  283. package/lib/structure/core/conformerSession.js.map +1 -0
  284. package/lib/structure/core/conformerShape.d.ts +36 -0
  285. package/lib/structure/core/conformerShape.d.ts.map +1 -0
  286. package/lib/structure/core/conformerShape.js +150 -0
  287. package/lib/structure/core/conformerShape.js.map +1 -0
  288. package/lib/structure/core/conformers.d.ts +107 -0
  289. package/lib/structure/core/conformers.d.ts.map +1 -0
  290. package/lib/structure/core/conformers.js +149 -0
  291. package/lib/structure/core/conformers.js.map +1 -0
  292. package/lib/structure/core/geometryRelaxer.d.ts +66 -0
  293. package/lib/structure/core/geometryRelaxer.d.ts.map +1 -0
  294. package/lib/structure/core/geometryRelaxer.js +2 -0
  295. package/lib/structure/core/geometryRelaxer.js.map +1 -0
  296. package/lib/structure/core/index.d.ts +4 -0
  297. package/lib/structure/core/index.d.ts.map +1 -1
  298. package/lib/structure/core/index.js +2 -0
  299. package/lib/structure/core/index.js.map +1 -1
  300. package/lib/structure/core/moleculeCoordinates.d.ts +31 -0
  301. package/lib/structure/core/moleculeCoordinates.d.ts.map +1 -0
  302. package/lib/structure/core/moleculeCoordinates.js +80 -0
  303. package/lib/structure/core/moleculeCoordinates.js.map +1 -0
  304. package/lib/structure/core/molfileExport.d.ts +42 -0
  305. package/lib/structure/core/molfileExport.d.ts.map +1 -0
  306. package/lib/structure/core/molfileExport.js +47 -0
  307. package/lib/structure/core/molfileExport.js.map +1 -0
  308. package/lib/structure/core/oclResources.d.ts +12 -0
  309. package/lib/structure/core/oclResources.d.ts.map +1 -0
  310. package/lib/structure/core/oclResources.js +35 -0
  311. package/lib/structure/core/oclResources.js.map +1 -0
  312. package/lib/translate/core/catalog.d.ts +61 -0
  313. package/lib/translate/core/catalog.d.ts.map +1 -0
  314. package/lib/translate/core/catalog.js +49 -0
  315. package/lib/translate/core/catalog.js.map +1 -0
  316. package/lib/translate/core/checkTranslation.d.ts +32 -0
  317. package/lib/translate/core/checkTranslation.d.ts.map +1 -0
  318. package/lib/translate/core/checkTranslation.js +98 -0
  319. package/lib/translate/core/checkTranslation.js.map +1 -0
  320. package/lib/translate/core/contribution.d.ts +88 -0
  321. package/lib/translate/core/contribution.d.ts.map +1 -0
  322. package/lib/translate/core/contribution.js +14 -0
  323. package/lib/translate/core/contribution.js.map +1 -0
  324. package/lib/translate/core/index.d.ts +19 -0
  325. package/lib/translate/core/index.d.ts.map +1 -0
  326. package/lib/translate/core/index.js +15 -0
  327. package/lib/translate/core/index.js.map +1 -0
  328. package/lib/translate/core/marker.d.ts +45 -0
  329. package/lib/translate/core/marker.d.ts.map +1 -0
  330. package/lib/translate/core/marker.js +79 -0
  331. package/lib/translate/core/marker.js.map +1 -0
  332. package/lib/translate/core/mergeMessages.d.ts +35 -0
  333. package/lib/translate/core/mergeMessages.d.ts.map +1 -0
  334. package/lib/translate/core/mergeMessages.js +69 -0
  335. package/lib/translate/core/mergeMessages.js.map +1 -0
  336. package/lib/translate/core/session.d.ts +102 -0
  337. package/lib/translate/core/session.d.ts.map +1 -0
  338. package/lib/translate/core/session.js +162 -0
  339. package/lib/translate/core/session.js.map +1 -0
  340. package/lib/translate/core/start.d.ts +70 -0
  341. package/lib/translate/core/start.d.ts.map +1 -0
  342. package/lib/translate/core/start.js +73 -0
  343. package/lib/translate/core/start.js.map +1 -0
  344. package/lib/translate/core/suggestions.d.ts +77 -0
  345. package/lib/translate/core/suggestions.d.ts.map +1 -0
  346. package/lib/translate/core/suggestions.js +143 -0
  347. package/lib/translate/core/suggestions.js.map +1 -0
  348. package/lib/translate/core/tables.d.ts +100 -0
  349. package/lib/translate/core/tables.d.ts.map +1 -0
  350. package/lib/translate/core/tables.js +51 -0
  351. package/lib/translate/core/tables.js.map +1 -0
  352. package/lib/translate.d.ts +2 -0
  353. package/lib/translate.d.ts.map +1 -0
  354. package/lib/translate.js +6 -0
  355. package/lib/translate.js.map +1 -0
  356. package/lib/ui.d.ts +1 -0
  357. package/lib/ui.d.ts.map +1 -1
  358. package/lib/ui.js +1 -0
  359. package/lib/ui.js.map +1 -1
  360. package/lib/xtb/core/xtbRelaxer.d.ts +61 -0
  361. package/lib/xtb/core/xtbRelaxer.d.ts.map +1 -0
  362. package/lib/xtb/core/xtbRelaxer.js +108 -0
  363. package/lib/xtb/core/xtbRelaxer.js.map +1 -0
  364. package/lib/xtb.d.ts +11 -0
  365. package/lib/xtb.d.ts.map +1 -0
  366. package/lib/xtb.js +10 -0
  367. package/lib/xtb.js.map +1 -0
  368. package/package.json +18 -11
  369. package/src/chrome/ui/HeaderToggle.tsx +100 -0
  370. package/src/chrome/ui/index.ts +2 -0
  371. package/src/citation/core/gfn2Paper.ts +32 -0
  372. package/src/citation/core/index.ts +1 -0
  373. package/src/clipboard/ui/ClickToCopy.tsx +8 -7
  374. package/src/conformers.ts +87 -0
  375. package/src/core.ts +1 -0
  376. package/src/credits/core/credits.ts +16 -0
  377. package/src/ecosystem/core/index.ts +1 -0
  378. package/src/ecosystem/core/sites.ts +20 -2
  379. package/src/ecosystem/ui/EcosystemLinks.tsx +3 -1
  380. package/src/ecosystem/ui/SiteTile.tsx +3 -1
  381. package/src/format/core/index.ts +1 -1
  382. package/src/format/core/words.ts +19 -0
  383. package/src/language/core/index.ts +7 -0
  384. package/src/language/core/languageName.ts +16 -0
  385. package/src/language/core/languageParam.ts +70 -0
  386. package/src/language/ui/SiteLanguage.tsx +26 -0
  387. package/src/language/ui/index.ts +3 -0
  388. package/src/language/ui/siteLanguageContext.ts +20 -0
  389. package/src/orbital/core/atomicOrbitals.ts +17 -1
  390. package/src/orbital/core/hydrogenic.ts +2 -1
  391. package/src/orbital/core/index.ts +1 -0
  392. package/src/orbital/core/slaterEnergy.ts +83 -0
  393. package/src/overlay/core/index.ts +6 -2
  394. package/src/overlay/core/overlayMarks.ts +51 -6
  395. package/src/overlay/ui/OverlayLegendMark.tsx +5 -0
  396. package/src/projection/core/index.ts +11 -3
  397. package/src/projection/core/projectionCopy.ts +3 -0
  398. package/src/projection/core/projectionGroupings.ts +174 -0
  399. package/src/projection/core/projectionOptions.ts +18 -7
  400. package/src/projection/core/projectionPanelWords.ts +10 -0
  401. package/src/projection/core/projectionSamples.ts +62 -120
  402. package/src/projection/core/projectionStrings.ts +12 -1
  403. package/src/projection/core/resolveProjectionOptions.ts +66 -4
  404. package/src/projection/ui/ProjectionBar.tsx +4 -2
  405. package/src/projection/ui/ProjectionGroupingPickers.tsx +91 -0
  406. package/src/projection/ui/ProjectionMapControls.tsx +29 -32
  407. package/src/projection/ui/ProjectionMapLegend.tsx +1 -1
  408. package/src/projection/ui/ProjectionMapMore.tsx +14 -4
  409. package/src/projection/ui/ProjectionMapTab.tsx +27 -9
  410. package/src/projection/ui/ProjectionPairsMore.tsx +12 -21
  411. package/src/projection/ui/ProjectionPairsTab.tsx +5 -2
  412. package/src/projection/ui/ProjectionPanel.tsx +7 -3
  413. package/src/projection/ui/ProjectionReadout.tsx +28 -8
  414. package/src/projection/ui/ProjectionSpaceControls.tsx +20 -27
  415. package/src/projection/ui/ProjectionSpaceMore.tsx +12 -3
  416. package/src/projection/ui/ProjectionSpaceTab.tsx +23 -6
  417. package/src/projection/ui/ProjectionViewer.tsx +1 -0
  418. package/src/projection/ui/projectionBarReadings.ts +24 -8
  419. package/src/projection/ui/projectionBarSlots.tsx +10 -9
  420. package/src/projection/ui/projectionMapChoices.ts +71 -14
  421. package/src/projection/ui/projectionMapChrome.ts +55 -30
  422. package/src/projection/ui/projectionMapCorner.ts +67 -0
  423. package/src/projection/ui/projectionMapModel.ts +20 -59
  424. package/src/projection/ui/projectionMapView.ts +15 -8
  425. package/src/projection/ui/projectionSelectionSentence.ts +22 -0
  426. package/src/projection/ui/projectionStateApi.ts +57 -0
  427. package/src/projection/ui/projectionTabModels.ts +1 -1
  428. package/src/projection/ui/useProjectionState.ts +33 -37
  429. package/src/scatter/core/index.ts +1 -0
  430. package/src/scatter/core/pointShape.ts +80 -0
  431. package/src/scatter/ui/ScatterPlot.tsx +4 -1
  432. package/src/scatter/ui/ScatterPointLayer.tsx +39 -11
  433. package/src/scatter/ui/scatterFigureProps.ts +13 -0
  434. package/src/scatter/ui/scatterMarkGlyph.tsx +9 -1
  435. package/src/scatter3d/ui/ScatterCloud.tsx +3 -0
  436. package/src/shared/ui/MenuButton.tsx +4 -3
  437. package/src/structure/core/conformerMinimise.ts +99 -0
  438. package/src/structure/core/conformerMinimum.ts +125 -0
  439. package/src/structure/core/conformerOptions.ts +125 -0
  440. package/src/structure/core/conformerRefine.ts +234 -0
  441. package/src/structure/core/conformerRefineRank.ts +89 -0
  442. package/src/structure/core/conformerSession.ts +123 -0
  443. package/src/structure/core/conformerShape.ts +181 -0
  444. package/src/structure/core/conformers.ts +282 -0
  445. package/src/structure/core/geometryRelaxer.ts +71 -0
  446. package/src/structure/core/index.ts +13 -0
  447. package/src/structure/core/moleculeCoordinates.ts +93 -0
  448. package/src/structure/core/molfileExport.ts +62 -0
  449. package/src/structure/core/oclResources.ts +41 -0
  450. package/src/translate/core/catalog.ts +83 -0
  451. package/src/translate/core/checkTranslation.ts +128 -0
  452. package/src/translate/core/contribution.ts +99 -0
  453. package/src/translate/core/index.ts +72 -0
  454. package/src/translate/core/marker.ts +85 -0
  455. package/src/translate/core/mergeMessages.ts +74 -0
  456. package/src/translate/core/session.ts +250 -0
  457. package/src/translate/core/start.ts +121 -0
  458. package/src/translate/core/suggestions.ts +211 -0
  459. package/src/translate/core/tables.ts +120 -0
  460. package/src/translate.ts +5 -0
  461. package/src/ui.ts +1 -0
  462. package/src/xtb/core/xtbRelaxer.ts +160 -0
  463. package/src/xtb.ts +16 -0
  464. package/styles/chrome.css +61 -30
@@ -0,0 +1,69 @@
1
+ import { isSameShape } from "./conformerMinimum.js";
2
+ /**
3
+ * Order refined conformers from the most stable down, number them from one in
4
+ * that order, and measure every refined energy from the lowest.
5
+ *
6
+ * `reordered` counts the conformers whose position changed, which is the number
7
+ * worth showing: it says how much the better method disagreed with the force
8
+ * field.
9
+ * @param conformers - The refined conformers, in the force field's own order.
10
+ * @returns The ranked conformers and the disagreement count.
11
+ */
12
+ export function rankByRefinedEnergy(conformers) {
13
+ let lowest = Number.POSITIVE_INFINITY;
14
+ for (const conformer of conformers) {
15
+ const energy = conformer.refinement?.energy;
16
+ if (energy !== undefined && energy < lowest)
17
+ lowest = energy;
18
+ }
19
+ const ranked = conformers.toSorted(compareRefined);
20
+ const result = [];
21
+ let reordered = 0;
22
+ for (const [index, conformer] of ranked.entries()) {
23
+ if (conformer.id !== index + 1)
24
+ reordered++;
25
+ const refinement = conformer.refinement;
26
+ result.push({
27
+ ...conformer,
28
+ id: index + 1,
29
+ refinement: refinement === null
30
+ ? null
31
+ : { ...refinement, relativeEnergy: refinement.energy - lowest },
32
+ });
33
+ }
34
+ return { conformers: result, reordered };
35
+ }
36
+ /**
37
+ * Whether a refined conformer landed in a minimum one of `kept` already holds:
38
+ * the same energy within `tolerance`, and the same shape.
39
+ * @param candidate - The refined conformer's energy and shape.
40
+ * @param kept - The minima kept so far.
41
+ * @param tolerance - Energy gap in kcal/mol under which two energies are one.
42
+ * @returns `true` when one of them is the same minimum.
43
+ */
44
+ export function isRefinedDuplicate(candidate, kept, tolerance) {
45
+ for (const entry of kept) {
46
+ if (Math.abs(candidate.energy - entry.energy) > tolerance)
47
+ continue;
48
+ if (isSameShape(candidate.shape, entry.shape))
49
+ return true;
50
+ }
51
+ return false;
52
+ }
53
+ /**
54
+ * Order two conformers by refined energy; one without a refinement ranks after
55
+ * every one that has one.
56
+ * @param a - One conformer.
57
+ * @param b - The other.
58
+ * @returns Negative when `a` is the more stable, positive when `b` is.
59
+ */
60
+ function compareRefined(a, b) {
61
+ const energyA = a.refinement?.energy;
62
+ const energyB = b.refinement?.energy;
63
+ if (energyA === undefined)
64
+ return energyB === undefined ? 0 : 1;
65
+ if (energyB === undefined)
66
+ return -1;
67
+ return energyA - energyB;
68
+ }
69
+ //# sourceMappingURL=conformerRefineRank.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformerRefineRank.js","sourceRoot":"","sources":["../../../src/structure/core/conformerRefineRank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAmBpD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAgC;IAEhC,IAAI,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACtC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,GAAG,MAAM;YAAE,MAAM,GAAG,MAAM,CAAC;IAC/D,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACnD,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QAClD,IAAI,SAAS,CAAC,EAAE,KAAK,KAAK,GAAG,CAAC;Y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openchemlib';
2
+ import { ConformerGenerator } from 'openchemlib';
3
+ import type { ConformerOptions, ConformerStrategy } from './conformerOptions.ts';
4
+ /** A generator, positioned after the conformers it has already handed back. */
5
+ export interface ConformerSession {
6
+ generator: ConformerGenerator;
7
+ /** Conformers handed back so far, kept or dropped. */
8
+ produced: number;
9
+ /**
10
+ * A conformer drawn from the generator but not yet processed, because the
11
+ * deadline passed while it was drawn. Not counted in `produced`.
12
+ */
13
+ pending: Molecule | null;
14
+ }
15
+ /**
16
+ * A generator for a prepared structure, positioned after `produced` conformers.
17
+ *
18
+ * The generator is seeded, so the same structure and options always hand back
19
+ * the same sequence. The last session is kept, and resumed when it is exactly
20
+ * where the caller left it; otherwise a fresh generator is initialised and the
21
+ * first `produced` conformers are drawn and discarded, which yields the same
22
+ * position without their minimisation.
23
+ * @param prepared - The hydrogen-saturated copy the run embeds.
24
+ * @param options - The options that fixed the sequence: strategy, seed, torsion sets.
25
+ * @param produced - How far into the sequence the caller already is.
26
+ * @returns The session, to be handed back through {@link keepConformerSession}.
27
+ * @throws {Error} When OpenChemLib refuses to initialise the structure.
28
+ */
29
+ export declare function openConformerSession(prepared: Molecule, options: ConformerOptions, produced: number): ConformerSession;
30
+ /**
31
+ * Keep a session so the next continuation of the same run resumes it.
32
+ * @param prepared - The structure the session was opened on.
33
+ * @param options - The options it was opened with.
34
+ * @param session - The session, positioned where the run stopped.
35
+ */
36
+ export declare function keepConformerSession(prepared: Molecule, options: ConformerOptions, session: ConformerSession): void;
37
+ /**
38
+ * OpenChemLib's estimate of the conformers a session can reach.
39
+ * @param session - A freshly opened session.
40
+ * @returns The estimate, or `-1` when the generator declines to make one.
41
+ */
42
+ export declare function readPotentialCount(session: ConformerSession): number;
43
+ /**
44
+ * Map one of our strategy ids onto the `ConformerGenerator` constant it stands
45
+ * for.
46
+ * @param strategy - The id stored in the preferences.
47
+ * @returns The numeric constant OpenChemLib expects.
48
+ */
49
+ export declare function strategyConstant(strategy: ConformerStrategy): number;
50
+ //# sourceMappingURL=conformerSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformerSession.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformerSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAE/B,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,MAAM,GACf,gBAAgB,CA2BlB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAMpE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAEpE"}
@@ -0,0 +1,88 @@
1
+ import { ConformerGenerator } from 'openchemlib';
2
+ /**
3
+ * A generator for a prepared structure, positioned after `produced` conformers.
4
+ *
5
+ * The generator is seeded, so the same structure and options always hand back
6
+ * the same sequence. The last session is kept, and resumed when it is exactly
7
+ * where the caller left it; otherwise a fresh generator is initialised and the
8
+ * first `produced` conformers are drawn and discarded, which yields the same
9
+ * position without their minimisation.
10
+ * @param prepared - The hydrogen-saturated copy the run embeds.
11
+ * @param options - The options that fixed the sequence: strategy, seed, torsion sets.
12
+ * @param produced - How far into the sequence the caller already is.
13
+ * @returns The session, to be handed back through {@link keepConformerSession}.
14
+ * @throws {Error} When OpenChemLib refuses to initialise the structure.
15
+ */
16
+ export function openConformerSession(prepared, options, produced) {
17
+ const key = sessionKey(prepared, options);
18
+ if (produced > 0 && last?.key === key && last.session.produced === produced) {
19
+ const session = last.session;
20
+ last = null;
21
+ return session;
22
+ }
23
+ last = null;
24
+ const generator = new ConformerGenerator(options.seed);
25
+ const initialised = generator.initializeConformers(prepared, {
26
+ strategy: strategyConstant(options.strategy),
27
+ maxTorsionSets: options.maxTorsionSets,
28
+ use60degreeSteps: options.use60DegreeSteps,
29
+ });
30
+ if (!initialised) {
31
+ throw new Error(`OpenChemLib could not set up conformer generation for ${prepared.getMolecularFormula().formula}. The structure has a problem the generator cannot resolve, such as an impossible valence or an over-constrained ring.`);
32
+ }
33
+ let skipped = 0;
34
+ while (skipped < produced &&
35
+ generator.getNextConformerAsMolecule() !== null) {
36
+ skipped++;
37
+ }
38
+ return { generator, produced: skipped, pending: null };
39
+ }
40
+ /**
41
+ * Keep a session so the next continuation of the same run resumes it.
42
+ * @param prepared - The structure the session was opened on.
43
+ * @param options - The options it was opened with.
44
+ * @param session - The session, positioned where the run stopped.
45
+ */
46
+ export function keepConformerSession(prepared, options, session) {
47
+ last = { key: sessionKey(prepared, options), session };
48
+ }
49
+ /**
50
+ * OpenChemLib's estimate of the conformers a session can reach.
51
+ * @param session - A freshly opened session.
52
+ * @returns The estimate, or `-1` when the generator declines to make one.
53
+ */
54
+ export function readPotentialCount(session) {
55
+ try {
56
+ return session.generator.getPotentialConformerCount();
57
+ }
58
+ catch {
59
+ return -1;
60
+ }
61
+ }
62
+ /**
63
+ * Map one of our strategy ids onto the `ConformerGenerator` constant it stands
64
+ * for.
65
+ * @param strategy - The id stored in the preferences.
66
+ * @returns The numeric constant OpenChemLib expects.
67
+ */
68
+ export function strategyConstant(strategy) {
69
+ return STRATEGY_CONSTANTS[strategy];
70
+ }
71
+ const STRATEGY_CONSTANTS = {
72
+ 'adaptive-random': ConformerGenerator.STRATEGY_ADAPTIVE_RANDOM,
73
+ 'likely-random': ConformerGenerator.STRATEGY_LIKELY_RANDOM,
74
+ 'pure-random': ConformerGenerator.STRATEGY_PURE_RANDOM,
75
+ 'likely-systematic': ConformerGenerator.STRATEGY_LIKELY_SYSTEMATIC,
76
+ };
77
+ let last = null;
78
+ // The atom order matters as much as the structure, so the molfile is the key.
79
+ function sessionKey(prepared, options) {
80
+ return [
81
+ options.strategy,
82
+ options.seed,
83
+ options.maxTorsionSets,
84
+ options.use60DegreeSteps,
85
+ prepared.toMolfileV3(),
86
+ ].join('\n');
87
+ }
88
+ //# sourceMappingURL=conformerSession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformerSession.js","sourceRoot":"","sources":["../../../src/structure/core/conformerSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAmBjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAkB,EAClB,OAAyB,EACzB,QAAgB;IAEhB,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1C,IAAI,QAAQ,GAAG,CAAC,IAAI,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,GAAG,IAAI,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,GAAG,IAAI,CAAC;IACZ,MAAM,SAAS,GAAG,IAAI,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE;QAC3D,QAAQ,EAAE,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,CAAC,0BAA0B;CACnE,CAAC;AAEF,IAAI,IAAI,GAAsD,IAAI,CAAC;AAEnE,8EAA8E;AAC9E,SAAS,UAAU,CAAC,QAAkB,EAAE,OAAyB;IAC/D,OAAO;QACL,OAAO,CAAC,QAAQ;QAChB,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,cAAc;QACtB,OAAO,CAAC,gBAAgB;QACxB,QAAQ,CAAC,WAAW,EAAE;KACvB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { Molecule } from 'openchemlib';
2
+ /** Principal second moments of a conformer's atoms, in increasing order. */
3
+ export type PrincipalMoments = readonly [number, number, number];
4
+ /** What tells two minimised conformers of one energy apart. */
5
+ export interface ConformerShape {
6
+ /** Principal second moments, smallest first. */
7
+ moments: PrincipalMoments;
8
+ /** Handedness in [-1, 1]: opposite for mirror images, 0 for a shape that is its own mirror image. */
9
+ chirality: number;
10
+ }
11
+ /**
12
+ * Shape of a conformer: the principal second moments of its atoms, weighted by
13
+ * atomic number, about their weighted centre, and the handedness of the atoms
14
+ * in that principal frame.
15
+ *
16
+ * Neither changes when the conformer is turned or has its symmetry-equivalent
17
+ * atoms numbered differently, which is how the generator hands back the same
18
+ * minimum twice, as with a cyclohexane chair and its flipped copy. A mirror
19
+ * image keeps the moments and flips the sign of the chirality, so gauche butane
20
+ * and its mirror image share the one and not the other.
21
+ *
22
+ * The chirality is Σ w·u₁u₂u₃ over Σ w·|u₁u₂u₃|, u being the coordinates along
23
+ * right-handed principal axes. A mirror plane or an inversion centre makes it
24
+ * vanish. It is 0 as well for a flat conformer, and when the principal axes
25
+ * cannot be drawn.
26
+ * @param molecule - A conformer with 3D coordinates.
27
+ * @returns Its moments, smallest first, and its chirality.
28
+ */
29
+ export declare function conformerShape(molecule: Molecule): ConformerShape;
30
+ /**
31
+ * Whether every atom of a conformer sits at finite coordinates.
32
+ * @param conformer - A conformer with 3D coordinates.
33
+ * @returns `false` as soon as one coordinate is `NaN` or infinite.
34
+ */
35
+ export declare function hasFiniteCoordinates(conformer: Molecule): boolean;
36
+ //# sourceMappingURL=conformerShape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformerShape.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformerShape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,4EAA4E;AAC5E,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjE,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,qGAAqG;IACrG,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAuDjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAYjE"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Shape of a conformer: the principal second moments of its atoms, weighted by
3
+ * atomic number, about their weighted centre, and the handedness of the atoms
4
+ * in that principal frame.
5
+ *
6
+ * Neither changes when the conformer is turned or has its symmetry-equivalent
7
+ * atoms numbered differently, which is how the generator hands back the same
8
+ * minimum twice, as with a cyclohexane chair and its flipped copy. A mirror
9
+ * image keeps the moments and flips the sign of the chirality, so gauche butane
10
+ * and its mirror image share the one and not the other.
11
+ *
12
+ * The chirality is Σ w·u₁u₂u₃ over Σ w·|u₁u₂u₃|, u being the coordinates along
13
+ * right-handed principal axes. A mirror plane or an inversion centre makes it
14
+ * vanish. It is 0 as well for a flat conformer, and when the principal axes
15
+ * cannot be drawn.
16
+ * @param molecule - A conformer with 3D coordinates.
17
+ * @returns Its moments, smallest first, and its chirality.
18
+ */
19
+ export function conformerShape(molecule) {
20
+ const atomCount = molecule.getAllAtoms();
21
+ let total = 0;
22
+ let centreX = 0;
23
+ let centreY = 0;
24
+ let centreZ = 0;
25
+ for (let atom = 0; atom < atomCount; atom++) {
26
+ const weight = molecule.getAtomicNo(atom);
27
+ total += weight;
28
+ centreX += weight * molecule.getAtomX(atom);
29
+ centreY += weight * molecule.getAtomY(atom);
30
+ centreZ += weight * molecule.getAtomZ(atom);
31
+ }
32
+ if (total === 0)
33
+ return { moments: [0, 0, 0], chirality: 0 };
34
+ centreX /= total;
35
+ centreY /= total;
36
+ centreZ /= total;
37
+ const tensor = { xx: 0, yy: 0, zz: 0, xy: 0, xz: 0, yz: 0 };
38
+ for (let atom = 0; atom < atomCount; atom++) {
39
+ const weight = molecule.getAtomicNo(atom);
40
+ const x = molecule.getAtomX(atom) - centreX;
41
+ const y = molecule.getAtomY(atom) - centreY;
42
+ const z = molecule.getAtomZ(atom) - centreZ;
43
+ tensor.xx += weight * x * x;
44
+ tensor.yy += weight * y * y;
45
+ tensor.zz += weight * z * z;
46
+ tensor.xy += weight * x * y;
47
+ tensor.xz += weight * x * z;
48
+ tensor.yz += weight * y * z;
49
+ }
50
+ const moments = symmetricEigenvalues(tensor);
51
+ const first = principalAxis(tensor, moments[0]);
52
+ const third = principalAxis(tensor, moments[2]);
53
+ if (first === null || third === null)
54
+ return { moments, chirality: 0 };
55
+ const second = cross(third, first);
56
+ let signed = 0;
57
+ let absolute = 0;
58
+ for (let atom = 0; atom < atomCount; atom++) {
59
+ const weight = molecule.getAtomicNo(atom);
60
+ const x = molecule.getAtomX(atom) - centreX;
61
+ const y = molecule.getAtomY(atom) - centreY;
62
+ const z = molecule.getAtomZ(atom) - centreZ;
63
+ const product = (x * first[0] + y * first[1] + z * first[2]) *
64
+ (x * second[0] + y * second[1] + z * second[2]) *
65
+ (x * third[0] + y * third[1] + z * third[2]);
66
+ signed += weight * product;
67
+ absolute += weight * Math.abs(product);
68
+ }
69
+ const radius = Math.sqrt((moments[0] + moments[1] + moments[2]) / total);
70
+ if (absolute <= FLAT_TOLERANCE * total * radius * radius * radius) {
71
+ return { moments, chirality: 0 };
72
+ }
73
+ return { moments, chirality: signed / absolute };
74
+ }
75
+ /**
76
+ * Whether every atom of a conformer sits at finite coordinates.
77
+ * @param conformer - A conformer with 3D coordinates.
78
+ * @returns `false` as soon as one coordinate is `NaN` or infinite.
79
+ */
80
+ export function hasFiniteCoordinates(conformer) {
81
+ const atomCount = conformer.getAllAtoms();
82
+ for (let atom = 0; atom < atomCount; atom++) {
83
+ if (!Number.isFinite(conformer.getAtomX(atom)) ||
84
+ !Number.isFinite(conformer.getAtomY(atom)) ||
85
+ !Number.isFinite(conformer.getAtomZ(atom))) {
86
+ return false;
87
+ }
88
+ }
89
+ return true;
90
+ }
91
+ /**
92
+ * Σ w·|u₁u₂u₃|, relative to the total weight times the cubed radius of
93
+ * gyration, under which a conformer is flat: its handedness is rounding noise.
94
+ */
95
+ const FLAT_TOLERANCE = 1e-4;
96
+ // Unit eigenvector of `moment`: the longest cross product of two rows of the tensor minus `moment`.
97
+ function principalAxis(tensor, moment) {
98
+ const rows = [
99
+ [tensor.xx - moment, tensor.xy, tensor.xz],
100
+ [tensor.xy, tensor.yy - moment, tensor.yz],
101
+ [tensor.xz, tensor.yz, tensor.zz - moment],
102
+ ];
103
+ let best = [0, 0, 0];
104
+ let bestLength = 0;
105
+ for (let a = 0; a < 3; a++) {
106
+ for (let b = a + 1; b < 3; b++) {
107
+ const candidate = cross(rows[a], rows[b]);
108
+ const length = Math.hypot(candidate[0], candidate[1], candidate[2]);
109
+ if (length > bestLength) {
110
+ best = candidate;
111
+ bestLength = length;
112
+ }
113
+ }
114
+ }
115
+ if (bestLength === 0)
116
+ return null;
117
+ return [best[0] / bestLength, best[1] / bestLength, best[2] / bestLength];
118
+ }
119
+ function cross(a, b) {
120
+ return [
121
+ a[1] * b[2] - a[2] * b[1],
122
+ a[2] * b[0] - a[0] * b[2],
123
+ a[0] * b[1] - a[1] * b[0],
124
+ ];
125
+ }
126
+ // Closed-form eigenvalues of a symmetric 3×3 matrix (Smith, 1961).
127
+ function symmetricEigenvalues(tensor) {
128
+ const { xx, yy, zz, xy, xz, yz } = tensor;
129
+ const mean = (xx + yy + zz) / 3;
130
+ const offDiagonal = xy * xy + xz * xz + yz * yz;
131
+ const spread = (xx - mean) * (xx - mean) +
132
+ (yy - mean) * (yy - mean) +
133
+ (zz - mean) * (zz - mean) +
134
+ 2 * offDiagonal;
135
+ if (spread === 0)
136
+ return [mean, mean, mean];
137
+ const p = Math.sqrt(spread / 6);
138
+ const a = (xx - mean) / p;
139
+ const b = (yy - mean) / p;
140
+ const c = (zz - mean) / p;
141
+ const d = xy / p;
142
+ const e = xz / p;
143
+ const f = yz / p;
144
+ const halfDeterminant = (a * (b * c - f * f) - d * (d * c - f * e) + e * (d * f - b * e)) / 2;
145
+ const angle = Math.acos(Math.min(1, Math.max(-1, halfDeterminant))) / 3;
146
+ const largest = mean + 2 * p * Math.cos(angle);
147
+ const smallest = mean + 2 * p * Math.cos(angle + (2 * Math.PI) / 3);
148
+ return [smallest, 3 * mean - largest - smallest, largest];
149
+ }
150
+ //# sourceMappingURL=conformerShape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformerShape.js","sourceRoot":"","sources":["../../../src/structure/core/conformerShape.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,cAAc,CAAC,QAAkB;IAC/C,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACzC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,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AAM,QAAQ,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,107 @@
1
+ import type { Molecule } from 'openchemlib';
2
+ import type { ConformerOptions, MinimisationAlgorithm } from './conformerOptions.ts';
3
+ import type { ConformerRefinement, ConformerSetRefinement } from './conformerRefine.ts';
4
+ import type { MolfileExport } from './molfileExport.ts';
5
+ export { strategyConstant } from './conformerSession.ts';
6
+ /** One conformer of the input structure, ready to display and to export. */
7
+ export interface Conformer {
8
+ /** 1-based position in {@link ConformerSet.conformers}. */
9
+ id: number;
10
+ /** The 3D structure, as a molfile the viewer can parse. */
11
+ molfile: MolfileExport;
12
+ /** Total force-field energy in kcal/mol, `null` when it was not computed. */
13
+ energy: number | null;
14
+ /** Energy above the lowest conformer of the set, `null` without an energy. */
15
+ relativeEnergy: number | null;
16
+ /**
17
+ * What a better method said about this conformer, once `refineConformers` has
18
+ * relaxed it. `null` until then, which is what a plain force-field run leaves.
19
+ * @default null
20
+ */
21
+ refinement: ConformerRefinement | null;
22
+ }
23
+ /**
24
+ * Which energies a set is ordered by: the force field's own, or the ones a
25
+ * refinement pass produced.
26
+ */
27
+ export type ConformerRanking = 'force-field' | 'refined';
28
+ /** Why {@link generateConformers} stopped asking for more conformers. */
29
+ export type StopReason = 'exhausted' | 'count' | 'timeout';
30
+ /** The complete outcome of one conformer run. */
31
+ export interface ConformerSet {
32
+ /** The conformers kept, most stable first; one without an energy follows every one that has one. */
33
+ conformers: Conformer[];
34
+ /** OpenChemLib's estimate of the reachable conformers, `-1` when unavailable. */
35
+ potentialConformerCount: number;
36
+ /** Which of the three limits ended the run. */
37
+ stoppedBy: StopReason;
38
+ /** Wall-clock duration of the run, initialisation and continuations included. */
39
+ elapsedMilliseconds: number;
40
+ /** Plain sentences about conformers that were dropped or left unminimised. */
41
+ warnings: string[];
42
+ /** The force field that was asked for, echoed so a reader knows what the energies mean. */
43
+ minimisation: MinimisationAlgorithm;
44
+ /** Conformers the generator handed back, dropped ones included: where a continuation resumes. */
45
+ produced: number;
46
+ /** The options of the run, so a continuation draws from the same sequence. */
47
+ options: ConformerOptions;
48
+ /** Which of the two energies {@link ConformerSet.conformers} is ordered by. */
49
+ rankedBy: ConformerRanking;
50
+ /**
51
+ * What the refinement pass did, `null` for a set no better method has seen.
52
+ * @default null
53
+ */
54
+ refinement: ConformerSetRefinement | null;
55
+ }
56
+ /** The two options a continuation takes from the caller rather than from the run. */
57
+ export type ConformerLimits = Pick<ConformerOptions, 'maxConformers' | 'timeoutSeconds'>;
58
+ /**
59
+ * Generate conformers of a structure, optionally relaxing each one with MMFF94.
60
+ *
61
+ * The caller's molecule is never touched: the run works on a compact copy that
62
+ * receives the explicit hydrogens the generator needs.
63
+ *
64
+ * The run ends on the first of three limits — the generator runs out of new
65
+ * torsion sets, `maxConformers` conformers are in hand, or the time budget is
66
+ * spent. **A timeout is not an error**: whatever was produced is returned, with
67
+ * `stoppedBy` saying why there is not more.
68
+ *
69
+ * The budget covers the whole call, initialisation included, and is read again
70
+ * once a conformer is in hand, so no further minimisation starts past the
71
+ * deadline. The one step already running cannot be cut short, so a caller
72
+ * waiting from another thread must allow one step on top of `timeoutSeconds`.
73
+ *
74
+ * Minimisation is best-effort: a conformer MMFF94 refuses is kept with a `null`
75
+ * energy and a warning rather than lost. A minimised conformer that lands in a
76
+ * minimum already kept, such as the flipped copy of a cyclohexane chair, is
77
+ * not kept a second time; the mirror image of a chiral minimum, such as the
78
+ * second gauche butane, is a minimum of its own.
79
+ * @param molecule - Structure to embed. Not mutated.
80
+ * @param options - Strategy, limits, seed and force field.
81
+ * @param now - Clock used for the time budget, injectable for tests.
82
+ * @returns Every conformer kept, most stable first, with relative energies and any warnings.
83
+ * @throws {Error} When the structure is empty or OpenChemLib refuses to initialise it.
84
+ */
85
+ export declare function generateConformers(molecule: Molecule, options: ConformerOptions, now?: () => number): ConformerSet;
86
+ /**
87
+ * Ask the run that produced `previous` for more conformers.
88
+ *
89
+ * The continuation draws from the same seeded sequence with the same force
90
+ * field, so the result is the set a single larger run would have produced:
91
+ * the new conformers are ranked among the previous ones, the ids follow that
92
+ * order, and every relative energy is measured again from the lowest of all.
93
+ * A refined set cannot be extended: its molfiles hold the relaxed geometries
94
+ * while its `energy` fields still hold the force field's numbers, so the two
95
+ * would no longer describe one conformer and the duplicate check would compare
96
+ * shapes against energies that do not belong to them. Generate a larger set and
97
+ * refine that instead.
98
+ * @param molecule - The structure `previous` was generated from. Not mutated.
99
+ * @param previous - The set to extend. Not mutated.
100
+ * @param limits - How many more conformers to find, and the time budget of this call.
101
+ * @param now - Clock used for the time budget, injectable for tests.
102
+ * @returns The extended set, its duration the sum of both runs.
103
+ * @throws {Error} When the structure is empty, when `previous` has been refined,
104
+ * or when OpenChemLib refuses to initialise it.
105
+ */
106
+ export declare function continueConformers(molecule: Molecule, previous: ConformerSet, limits: ConformerLimits, now?: () => number): ConformerSet;
107
+ //# sourceMappingURL=conformers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformers.d.ts","sourceRoot":"","sources":["../../../src/structure/core/conformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,4EAA4E;AAC5E,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