react-cheminfo 0.76.0 → 0.78.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.
- package/README.md +141 -31
- package/lib/card/core/cardAddress.d.ts +19 -2
- package/lib/card/core/cardAddress.d.ts.map +1 -1
- package/lib/card/core/cardAddress.js +35 -2
- package/lib/card/core/cardAddress.js.map +1 -1
- package/lib/card/core/cardPageUrl.d.ts +7 -1
- package/lib/card/core/cardPageUrl.d.ts.map +1 -1
- package/lib/card/core/cardPageUrl.js +4 -2
- package/lib/card/core/cardPageUrl.js.map +1 -1
- package/lib/card/core/index.d.ts +1 -1
- package/lib/card/core/index.d.ts.map +1 -1
- package/lib/card/core/index.js +1 -1
- package/lib/card/core/index.js.map +1 -1
- package/lib/credits/core/credits.d.ts +30 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +35 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/download/core/downloadFigure.d.ts +12 -1
- package/lib/download/core/downloadFigure.d.ts.map +1 -1
- package/lib/download/core/downloadFigure.js +21 -0
- package/lib/download/core/downloadFigure.js.map +1 -1
- package/lib/download/core/figureDpi.d.ts +59 -0
- package/lib/download/core/figureDpi.d.ts.map +1 -0
- package/lib/download/core/figureDpi.js +75 -0
- package/lib/download/core/figureDpi.js.map +1 -0
- package/lib/download/core/figurePng.d.ts +4 -1
- package/lib/download/core/figurePng.d.ts.map +1 -1
- package/lib/download/core/figurePng.js +11 -2
- package/lib/download/core/figurePng.js.map +1 -1
- package/lib/download/core/index.d.ts +4 -1
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +3 -1
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/core/pngDpi.d.ts +22 -0
- package/lib/download/core/pngDpi.d.ts.map +1 -0
- package/lib/download/core/pngDpi.js +79 -0
- package/lib/download/core/pngDpi.js.map +1 -0
- package/lib/download/ui/FigureDownloadPanel.d.ts +13 -0
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +18 -34
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/download/ui/figureDownloadHint.d.ts +5 -0
- package/lib/download/ui/figureDownloadHint.d.ts.map +1 -1
- package/lib/download/ui/figureDownloadHint.js +8 -0
- package/lib/download/ui/figureDownloadHint.js.map +1 -1
- package/lib/download/ui/figureDownloadOptions.d.ts +84 -0
- package/lib/download/ui/figureDownloadOptions.d.ts.map +1 -0
- package/lib/download/ui/figureDownloadOptions.js +2 -0
- package/lib/download/ui/figureDownloadOptions.js.map +1 -0
- package/lib/download/ui/resolutionChoices.d.ts +27 -0
- package/lib/download/ui/resolutionChoices.d.ts.map +1 -0
- package/lib/download/ui/resolutionChoices.js +48 -0
- package/lib/download/ui/resolutionChoices.js.map +1 -0
- package/lib/download/ui/useFigureActions.d.ts +4 -1
- package/lib/download/ui/useFigureActions.d.ts.map +1 -1
- package/lib/download/ui/useFigureActions.js +17 -8
- package/lib/download/ui/useFigureActions.js.map +1 -1
- package/lib/download/ui/useFigureDownload.d.ts +2 -55
- package/lib/download/ui/useFigureDownload.d.ts.map +1 -1
- package/lib/download/ui/useFigureDownload.js +45 -13
- package/lib/download/ui/useFigureDownload.js.map +1 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +14 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +1 -1
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +3 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/host/core/connectHost.js +1 -1
- package/lib/host/core/connectHost.js.map +1 -1
- package/lib/host/core/connectTool.d.ts +103 -0
- package/lib/host/core/connectTool.d.ts.map +1 -0
- package/lib/host/core/connectTool.js +169 -0
- package/lib/host/core/connectTool.js.map +1 -0
- package/lib/host/core/hostOutputs.d.ts +16 -3
- package/lib/host/core/hostOutputs.d.ts.map +1 -1
- package/lib/host/core/hostOutputs.js +38 -4
- package/lib/host/core/hostOutputs.js.map +1 -1
- package/lib/host/core/index.d.ts +8 -2
- package/lib/host/core/index.d.ts.map +1 -1
- package/lib/host/core/index.js +4 -1
- package/lib/host/core/index.js.map +1 -1
- package/lib/host/core/kinds.d.ts +31 -3
- package/lib/host/core/kinds.d.ts.map +1 -1
- package/lib/host/core/kinds.js +35 -4
- package/lib/host/core/kinds.js.map +1 -1
- package/lib/host/core/messageValues.d.ts +29 -0
- package/lib/host/core/messageValues.d.ts.map +1 -0
- package/lib/host/core/messageValues.js +57 -0
- package/lib/host/core/messageValues.js.map +1 -0
- package/lib/host/core/protocol.d.ts +2 -5
- package/lib/host/core/protocol.d.ts.map +1 -1
- package/lib/host/core/protocol.js +3 -37
- package/lib/host/core/protocol.js.map +1 -1
- package/lib/host/core/resultKinds.d.ts +74 -0
- package/lib/host/core/resultKinds.d.ts.map +1 -0
- package/lib/host/core/resultKinds.js +40 -0
- package/lib/host/core/resultKinds.js.map +1 -0
- package/lib/host/core/toolMessages.d.ts +24 -0
- package/lib/host/core/toolMessages.d.ts.map +1 -0
- package/lib/host/core/toolMessages.js +136 -0
- package/lib/host/core/toolMessages.js.map +1 -0
- package/lib/host/ui/index.d.ts +2 -0
- package/lib/host/ui/index.d.ts.map +1 -1
- package/lib/host/ui/index.js +1 -0
- package/lib/host/ui/index.js.map +1 -1
- package/lib/host/ui/useFramedTool.d.ts +74 -0
- package/lib/host/ui/useFramedTool.d.ts.map +1 -0
- package/lib/host/ui/useFramedTool.js +125 -0
- package/lib/host/ui/useFramedTool.js.map +1 -0
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +30 -1
- package/lib/locales/en.json +30 -1
- package/lib/locales/es.json +30 -1
- package/lib/locales/fr.json +30 -1
- package/lib/locales/it.json +30 -1
- package/lib/molecule3d/ui/Molecule3DStage.d.ts +4 -33
- package/lib/molecule3d/ui/Molecule3DStage.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DStage.js +3 -37
- package/lib/molecule3d/ui/Molecule3DStage.js.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.js +10 -2
- package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
- package/lib/molecule3d/ui/exportMoleculeImage.d.ts +10 -0
- package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
- package/lib/molecule3d/ui/exportMoleculeImage.js +17 -0
- package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
- package/lib/molecule3d/ui/index.d.ts +1 -1
- package/lib/molecule3d/ui/index.d.ts.map +1 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +23 -0
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
- package/lib/molecule3d/ui/useImageExport.d.ts +3 -0
- package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
- package/lib/molecule3d/ui/useImageExport.js +21 -3
- package/lib/molecule3d/ui/useImageExport.js.map +1 -1
- package/lib/osiris/core/barGeometry.d.ts +42 -0
- package/lib/osiris/core/barGeometry.d.ts.map +1 -0
- package/lib/osiris/core/barGeometry.js +46 -0
- package/lib/osiris/core/barGeometry.js.map +1 -0
- package/lib/osiris/core/computeProperties.d.ts +42 -0
- package/lib/osiris/core/computeProperties.d.ts.map +1 -0
- package/lib/osiris/core/computeProperties.js +115 -0
- package/lib/osiris/core/computeProperties.js.map +1 -0
- package/lib/osiris/core/constants.d.ts +70 -0
- package/lib/osiris/core/constants.d.ts.map +1 -0
- package/lib/osiris/core/constants.js +99 -0
- package/lib/osiris/core/constants.js.map +1 -0
- package/lib/osiris/core/fitness.d.ts +32 -0
- package/lib/osiris/core/fitness.d.ts.map +1 -0
- package/lib/osiris/core/fitness.js +48 -0
- package/lib/osiris/core/fitness.js.map +1 -0
- package/lib/osiris/core/index.d.ts +29 -0
- package/lib/osiris/core/index.d.ts.map +1 -0
- package/lib/osiris/core/index.js +19 -0
- package/lib/osiris/core/index.js.map +1 -0
- package/lib/osiris/core/poolSize.d.ts +17 -0
- package/lib/osiris/core/poolSize.d.ts.map +1 -0
- package/lib/osiris/core/poolSize.js +22 -0
- package/lib/osiris/core/poolSize.js.map +1 -0
- package/lib/osiris/core/poolTypes.d.ts +140 -0
- package/lib/osiris/core/poolTypes.d.ts.map +1 -0
- package/lib/osiris/core/poolTypes.js +12 -0
- package/lib/osiris/core/poolTypes.js.map +1 -0
- package/lib/osiris/core/predictIdCode.d.ts +39 -0
- package/lib/osiris/core/predictIdCode.d.ts.map +1 -0
- package/lib/osiris/core/predictIdCode.js +54 -0
- package/lib/osiris/core/predictIdCode.js.map +1 -0
- package/lib/osiris/core/predictProtocol.d.ts +67 -0
- package/lib/osiris/core/predictProtocol.d.ts.map +1 -0
- package/lib/osiris/core/predictProtocol.js +29 -0
- package/lib/osiris/core/predictProtocol.js.map +1 -0
- package/lib/osiris/core/predictionPool.d.ts +23 -0
- package/lib/osiris/core/predictionPool.d.ts.map +1 -0
- package/lib/osiris/core/predictionPool.js +186 -0
- package/lib/osiris/core/predictionPool.js.map +1 -0
- package/lib/osiris/core/predictionQueue.d.ts +46 -0
- package/lib/osiris/core/predictionQueue.d.ts.map +1 -0
- package/lib/osiris/core/predictionQueue.js +57 -0
- package/lib/osiris/core/predictionQueue.js.map +1 -0
- package/lib/osiris/core/predictors.d.ts +62 -0
- package/lib/osiris/core/predictors.d.ts.map +1 -0
- package/lib/osiris/core/predictors.js +100 -0
- package/lib/osiris/core/predictors.js.map +1 -0
- package/lib/osiris/core/propertyKeys.d.ts +32 -0
- package/lib/osiris/core/propertyKeys.d.ts.map +1 -0
- package/lib/osiris/core/propertyKeys.js +44 -0
- package/lib/osiris/core/propertyKeys.js.map +1 -0
- package/lib/osiris/core/riskAppearance.d.ts +60 -0
- package/lib/osiris/core/riskAppearance.d.ts.map +1 -0
- package/lib/osiris/core/riskAppearance.js +59 -0
- package/lib/osiris/core/riskAppearance.js.map +1 -0
- package/lib/osiris/core/riskDetail.d.ts +22 -0
- package/lib/osiris/core/riskDetail.d.ts.map +1 -0
- package/lib/osiris/core/riskDetail.js +86 -0
- package/lib/osiris/core/riskDetail.js.map +1 -0
- package/lib/osiris/core/riskDetailRequest.d.ts +31 -0
- package/lib/osiris/core/riskDetailRequest.d.ts.map +1 -0
- package/lib/osiris/core/riskDetailRequest.js +49 -0
- package/lib/osiris/core/riskDetailRequest.js.map +1 -0
- package/lib/osiris/core/riskFindings.d.ts +26 -0
- package/lib/osiris/core/riskFindings.d.ts.map +1 -0
- package/lib/osiris/core/riskFindings.js +79 -0
- package/lib/osiris/core/riskFindings.js.map +1 -0
- package/lib/osiris/core/runPredictionJob.d.ts +20 -0
- package/lib/osiris/core/runPredictionJob.d.ts.map +1 -0
- package/lib/osiris/core/runPredictionJob.js +43 -0
- package/lib/osiris/core/runPredictionJob.js.map +1 -0
- package/lib/osiris/core/scales.d.ts +70 -0
- package/lib/osiris/core/scales.d.ts.map +1 -0
- package/lib/osiris/core/scales.js +185 -0
- package/lib/osiris/core/scales.js.map +1 -0
- package/lib/osiris/core/types.d.ts +91 -0
- package/lib/osiris/core/types.d.ts.map +1 -0
- package/lib/osiris/core/types.js +19 -0
- package/lib/osiris/core/types.js.map +1 -0
- package/lib/osiris/core/valuation.d.ts +28 -0
- package/lib/osiris/core/valuation.d.ts.map +1 -0
- package/lib/osiris/core/valuation.js +39 -0
- package/lib/osiris/core/valuation.js.map +1 -0
- package/lib/osiris/ui/PropertyBar.d.ts +27 -0
- package/lib/osiris/ui/PropertyBar.d.ts.map +1 -0
- package/lib/osiris/ui/PropertyBar.js +27 -0
- package/lib/osiris/ui/PropertyBar.js.map +1 -0
- package/lib/osiris/ui/PropertyPanel.d.ts +91 -0
- package/lib/osiris/ui/PropertyPanel.d.ts.map +1 -0
- package/lib/osiris/ui/PropertyPanel.js +77 -0
- package/lib/osiris/ui/PropertyPanel.js.map +1 -0
- package/lib/osiris/ui/PropertyRows.d.ts +40 -0
- package/lib/osiris/ui/PropertyRows.d.ts.map +1 -0
- package/lib/osiris/ui/PropertyRows.js +23 -0
- package/lib/osiris/ui/PropertyRows.js.map +1 -0
- package/lib/osiris/ui/RiskFindings.d.ts +43 -0
- package/lib/osiris/ui/RiskFindings.d.ts.map +1 -0
- package/lib/osiris/ui/RiskFindings.js +51 -0
- package/lib/osiris/ui/RiskFindings.js.map +1 -0
- package/lib/osiris/ui/RiskPanel.d.ts +46 -0
- package/lib/osiris/ui/RiskPanel.d.ts.map +1 -0
- package/lib/osiris/ui/RiskPanel.js +32 -0
- package/lib/osiris/ui/RiskPanel.js.map +1 -0
- package/lib/osiris/ui/RiskSquare.d.ts +51 -0
- package/lib/osiris/ui/RiskSquare.d.ts.map +1 -0
- package/lib/osiris/ui/RiskSquare.js +23 -0
- package/lib/osiris/ui/RiskSquare.js.map +1 -0
- package/lib/osiris/ui/index.d.ts +15 -0
- package/lib/osiris/ui/index.d.ts.map +1 -0
- package/lib/osiris/ui/index.js +8 -0
- package/lib/osiris/ui/index.js.map +1 -0
- package/lib/osiris/ui/usePredictions.d.ts +81 -0
- package/lib/osiris/ui/usePredictions.d.ts.map +1 -0
- package/lib/osiris/ui/usePredictions.js +102 -0
- package/lib/osiris/ui/usePredictions.js.map +1 -0
- package/lib/osiris-ui.d.ts +11 -0
- package/lib/osiris-ui.d.ts.map +1 -0
- package/lib/osiris-ui.js +11 -0
- package/lib/osiris-ui.js.map +1 -0
- package/lib/osiris.d.ts +17 -0
- package/lib/osiris.d.ts.map +1 -0
- package/lib/osiris.js +17 -0
- package/lib/osiris.js.map +1 -0
- package/lib/panel/ui/FilterInput.d.ts.map +1 -1
- package/lib/panel/ui/FilterInput.js +3 -1
- package/lib/panel/ui/FilterInput.js.map +1 -1
- package/lib/panel/ui/SidePanelItem.d.ts +39 -0
- package/lib/panel/ui/SidePanelItem.d.ts.map +1 -0
- package/lib/panel/ui/SidePanelItem.js +63 -0
- package/lib/panel/ui/SidePanelItem.js.map +1 -0
- package/lib/panel/ui/SidePanelStack.d.ts +11 -10
- package/lib/panel/ui/SidePanelStack.d.ts.map +1 -1
- package/lib/panel/ui/SidePanelStack.js +22 -15
- package/lib/panel/ui/SidePanelStack.js.map +1 -1
- package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -1
- package/lib/panel/ui/SpectrumColorSwatch.js +4 -2
- package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -1
- package/lib/panel/ui/usePanelFolds.d.ts +35 -0
- package/lib/panel/ui/usePanelFolds.d.ts.map +1 -0
- package/lib/panel/ui/usePanelFolds.js +73 -0
- package/lib/panel/ui/usePanelFolds.js.map +1 -0
- package/lib/shared/ui/FullscreenStage.d.ts +43 -0
- package/lib/shared/ui/FullscreenStage.d.ts.map +1 -0
- package/lib/shared/ui/FullscreenStage.js +38 -0
- package/lib/shared/ui/FullscreenStage.js.map +1 -0
- package/lib/shared/ui/canFillScreen.d.ts +7 -0
- package/lib/shared/ui/canFillScreen.d.ts.map +1 -0
- package/lib/shared/ui/canFillScreen.js +9 -0
- package/lib/shared/ui/canFillScreen.js.map +1 -0
- package/lib/shared/ui/index.d.ts +3 -0
- package/lib/shared/ui/index.d.ts.map +1 -1
- package/lib/shared/ui/index.js +2 -0
- package/lib/shared/ui/index.js.map +1 -1
- package/lib/split/ui/splitPanes.d.ts +3 -3
- package/lib/split/ui/splitPanes.js +1 -1
- package/lib/structure/core/structureNotations.d.ts +8 -1
- package/lib/structure/core/structureNotations.d.ts.map +1 -1
- package/lib/structure/core/structureNotations.js +14 -8
- package/lib/structure/core/structureNotations.js.map +1 -1
- package/lib/structure/ui/StructureExportPanel.d.ts +8 -0
- package/lib/structure/ui/StructureExportPanel.d.ts.map +1 -1
- package/lib/structure/ui/StructureExportPanel.js +9 -4
- package/lib/structure/ui/StructureExportPanel.js.map +1 -1
- package/lib/structure/ui/index.d.ts +1 -0
- package/lib/structure/ui/index.d.ts.map +1 -1
- package/lib/structure/ui/index.js.map +1 -1
- package/package.json +4 -1
- package/src/card/core/cardAddress.ts +39 -3
- package/src/card/core/cardPageUrl.ts +10 -3
- package/src/card/core/index.ts +7 -1
- package/src/credits/core/credits.ts +40 -0
- package/src/download/core/downloadFigure.ts +26 -1
- package/src/download/core/figureDpi.ts +94 -0
- package/src/download/core/figurePng.ts +11 -2
- package/src/download/core/index.ts +13 -1
- package/src/download/core/pngDpi.ts +84 -0
- package/src/download/ui/FigureDownloadPanel.tsx +41 -51
- package/src/download/ui/figureDownloadHint.ts +13 -0
- package/src/download/ui/figureDownloadOptions.ts +85 -0
- package/src/download/ui/resolutionChoices.ts +67 -0
- package/src/download/ui/useFigureActions.ts +24 -9
- package/src/download/ui/useFigureDownload.tsx +57 -71
- package/src/ecosystem/core/sites.ts +14 -0
- package/src/ecosystem/core/types.ts +2 -1
- package/src/ecosystem/ui/glyphs.tsx +20 -0
- package/src/host/core/connectHost.ts +1 -1
- package/src/host/core/connectTool.ts +285 -0
- package/src/host/core/hostOutputs.ts +47 -5
- package/src/host/core/index.ts +20 -1
- package/src/host/core/kinds.ts +53 -8
- package/src/host/core/messageValues.ts +58 -0
- package/src/host/core/protocol.ts +5 -37
- package/src/host/core/resultKinds.ts +65 -0
- package/src/host/core/toolMessages.ts +160 -0
- package/src/host/ui/index.ts +6 -0
- package/src/host/ui/useFramedTool.ts +213 -0
- package/src/locales/de.json +30 -1
- package/src/locales/en.json +30 -1
- package/src/locales/es.json +30 -1
- package/src/locales/fr.json +30 -1
- package/src/locales/it.json +30 -1
- package/src/molecule3d/ui/Molecule3DStage.tsx +4 -88
- package/src/molecule3d/ui/MoleculeCanvas3D.tsx +10 -1
- package/src/molecule3d/ui/exportMoleculeImage.ts +22 -0
- package/src/molecule3d/ui/index.ts +4 -1
- package/src/molecule3d/ui/moleculeViewer3DProps.ts +24 -0
- package/src/molecule3d/ui/useImageExport.ts +28 -2
- package/src/osiris/core/barGeometry.ts +74 -0
- package/src/osiris/core/computeProperties.ts +175 -0
- package/src/osiris/core/constants.ts +110 -0
- package/src/osiris/core/fitness.ts +59 -0
- package/src/osiris/core/index.ts +78 -0
- package/src/osiris/core/poolSize.ts +24 -0
- package/src/osiris/core/poolTypes.ts +140 -0
- package/src/osiris/core/predictIdCode.ts +69 -0
- package/src/osiris/core/predictProtocol.ts +78 -0
- package/src/osiris/core/predictionPool.ts +237 -0
- package/src/osiris/core/predictionQueue.ts +89 -0
- package/src/osiris/core/predictors.ts +142 -0
- package/src/osiris/core/propertyKeys.ts +54 -0
- package/src/osiris/core/riskAppearance.ts +86 -0
- package/src/osiris/core/riskDetail.ts +120 -0
- package/src/osiris/core/riskDetailRequest.ts +64 -0
- package/src/osiris/core/riskFindings.ts +92 -0
- package/src/osiris/core/runPredictionJob.ts +49 -0
- package/src/osiris/core/scales.ts +236 -0
- package/src/osiris/core/types.ts +103 -0
- package/src/osiris/core/valuation.ts +44 -0
- package/src/osiris/ui/PropertyBar.tsx +77 -0
- package/src/osiris/ui/PropertyPanel.tsx +227 -0
- package/src/osiris/ui/PropertyRows.tsx +92 -0
- package/src/osiris/ui/RiskFindings.tsx +137 -0
- package/src/osiris/ui/RiskPanel.tsx +81 -0
- package/src/osiris/ui/RiskSquare.tsx +108 -0
- package/src/osiris/ui/index.ts +17 -0
- package/src/osiris/ui/usePredictions.ts +194 -0
- package/src/osiris-ui.ts +11 -0
- package/src/osiris.ts +17 -0
- package/src/panel/ui/FilterInput.tsx +4 -1
- package/src/panel/ui/SidePanelItem.tsx +162 -0
- package/src/panel/ui/SidePanelStack.tsx +29 -36
- package/src/panel/ui/SpectrumColorSwatch.tsx +5 -3
- package/src/panel/ui/usePanelFolds.ts +103 -0
- package/src/shared/ui/FullscreenStage.tsx +96 -0
- package/src/shared/ui/canFillScreen.ts +8 -0
- package/src/shared/ui/index.ts +6 -0
- package/src/split/ui/splitPanes.tsx +4 -4
- package/src/structure/core/structureNotations.ts +25 -8
- package/src/structure/ui/StructureExportPanel.tsx +23 -4
- package/src/structure/ui/index.ts +4 -0
- package/styles/osiris.css +339 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What is still to be predicted, in the order it will be.
|
|
3
|
+
*
|
|
4
|
+
* Arrival order by default, because that is the order the reader read the file
|
|
5
|
+
* in. On top of it sits a short list of keys to answer first — the rows
|
|
6
|
+
* actually on screen — which is re-laid every time the reader scrolls or
|
|
7
|
+
* focuses a row. A key named as wanted that has since been answered or removed
|
|
8
|
+
* is skipped rather than looked up again.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A queue of molecules to predict.
|
|
12
|
+
* @returns The queue, empty.
|
|
13
|
+
*/
|
|
14
|
+
export function createPredictionQueue() {
|
|
15
|
+
const waiting = new Map();
|
|
16
|
+
let wanted = [];
|
|
17
|
+
let cursor = 0;
|
|
18
|
+
return {
|
|
19
|
+
get size() {
|
|
20
|
+
return waiting.size;
|
|
21
|
+
},
|
|
22
|
+
has: (key) => waiting.has(key),
|
|
23
|
+
add(input) {
|
|
24
|
+
if (waiting.has(input.key))
|
|
25
|
+
return false;
|
|
26
|
+
waiting.set(input.key, input);
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
take() {
|
|
30
|
+
while (cursor < wanted.length) {
|
|
31
|
+
const key = wanted[cursor];
|
|
32
|
+
cursor += 1;
|
|
33
|
+
const next = waiting.get(key);
|
|
34
|
+
if (next !== undefined) {
|
|
35
|
+
waiting.delete(key);
|
|
36
|
+
return next;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const first = waiting.keys().next();
|
|
40
|
+
if (first.done === true)
|
|
41
|
+
return undefined;
|
|
42
|
+
const next = waiting.get(first.value);
|
|
43
|
+
waiting.delete(first.value);
|
|
44
|
+
return next;
|
|
45
|
+
},
|
|
46
|
+
prioritize(keys) {
|
|
47
|
+
wanted = [...keys];
|
|
48
|
+
cursor = 0;
|
|
49
|
+
},
|
|
50
|
+
clear() {
|
|
51
|
+
waiting.clear();
|
|
52
|
+
wanted = [];
|
|
53
|
+
cursor = 0;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=predictionQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predictionQueue.js","sourceRoot":"","sources":["../../../src/osiris/core/predictionQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmCH;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;IACnD,IAAI,MAAM,GAAsB,EAAE,CAAC;IACnC,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,OAAO;QACL,IAAI,IAAI;YACN,OAAO,OAAO,CAAC,IAAI,CAAC;QACtB,CAAC;QACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;QAC9B,GAAG,CAAC,KAAK;YACP,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI;YACF,OAAO,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC9B,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAW,CAAC;gBACrC,MAAM,IAAI,CAAC,CAAC;gBACZ,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC9B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBACpB,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YACD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;YACpC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,SAAS,CAAC;YAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAoB,CAAC;YACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,UAAU,CAAC,IAAI;YACb,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YACnB,MAAM,GAAG,CAAC,CAAC;QACb,CAAC;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,GAAG,EAAE,CAAC;YACZ,MAAM,GAAG,CAAC,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenChemLib, loaded once and proved to be working before anything is
|
|
3
|
+
* predicted with it.
|
|
4
|
+
*
|
|
5
|
+
* Both predictors throw `static resources must be registered first` until
|
|
6
|
+
* `Resources.register*` has run — but only when *nothing* was registered. If
|
|
7
|
+
* something else was, `new ToxicityPredictor()` constructs happily, prints to
|
|
8
|
+
* the console, and answers every `assessRisk` with `RISK_UNKNOWN`, on which
|
|
9
|
+
* `DrugScoreCalculator` applies no penalty at all. The failure therefore reads
|
|
10
|
+
* on screen as four clean molecules and a healthy score. So the tables are
|
|
11
|
+
* proved here, at start-up, against a molecule whose answer is known: a
|
|
12
|
+
* fragment match that must come back high, and a drug-likeness that must be a
|
|
13
|
+
* real number. Between them the two families of resource file are both covered.
|
|
14
|
+
*
|
|
15
|
+
* The check costs about 160 ms once per worker, most of which is warm-up the
|
|
16
|
+
* first real molecule would have paid anyway — measured, a first prediction is
|
|
17
|
+
* 320 ms cold against 191 ms warm.
|
|
18
|
+
*/
|
|
19
|
+
import type * as OCL from 'openchemlib';
|
|
20
|
+
/**
|
|
21
|
+
* Where the resource tables come from: the URL of the site's own
|
|
22
|
+
* `openchemlib-resources.json`, or the parsed file itself.
|
|
23
|
+
*
|
|
24
|
+
* A URL must be absolute. `registerFromUrl` resolves a relative one against
|
|
25
|
+
* `import.meta.url`, which after a build is a hashed chunk under `assets/`, so
|
|
26
|
+
* it answers 404 and every prediction quietly becomes unknown.
|
|
27
|
+
*/
|
|
28
|
+
export type ResourceSource = string | Readonly<Record<string, string>>;
|
|
29
|
+
/** OpenChemLib, registered, checked and ready to predict with. */
|
|
30
|
+
export interface OsirisPredictors {
|
|
31
|
+
/** Reads an idCode or a SMILES into a molecule. */
|
|
32
|
+
Molecule: typeof OCL.Molecule;
|
|
33
|
+
/** cLogP, solubility, TPSA and the four counts. */
|
|
34
|
+
MoleculeProperties: typeof OCL.MoleculeProperties;
|
|
35
|
+
/** Finds a toxicophore on a molecule, in the predictor's own match mode. */
|
|
36
|
+
SSSearcher: typeof OCL.SSSearcher;
|
|
37
|
+
/** The four spline terms and the four risk factors. */
|
|
38
|
+
DrugScoreCalculator: typeof OCL.DrugScoreCalculator;
|
|
39
|
+
/** The four risk assessments and their explanations. */
|
|
40
|
+
toxicity: OCL.ToxicityPredictor;
|
|
41
|
+
/** The 5294-fragment drug-likeness table. */
|
|
42
|
+
druglikeness: OCL.DruglikenessPredictor;
|
|
43
|
+
}
|
|
44
|
+
/** The tables did not load, so nothing may be predicted. */
|
|
45
|
+
export declare class PredictorsUnavailableError extends Error {
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* OpenChemLib with its resources registered and checked.
|
|
50
|
+
*
|
|
51
|
+
* Loaded lazily — the library is 340 kB gzipped and does not tree-shake — and
|
|
52
|
+
* kept, because `Resources.register` replaces the whole map rather than merging
|
|
53
|
+
* into it, so registering twice with different keys silently unregisters the
|
|
54
|
+
* first set.
|
|
55
|
+
* @param source - The resources URL, or the parsed resources themselves.
|
|
56
|
+
* @returns The predictors, proved to answer.
|
|
57
|
+
* @throws {PredictorsUnavailableError} When the resources did not load, or loaded and answer nothing.
|
|
58
|
+
*/
|
|
59
|
+
export declare function loadPredictors(source: ResourceSource): Promise<OsirisPredictors>;
|
|
60
|
+
/** Forget the loaded predictors, so the next call registers again. */
|
|
61
|
+
export declare function resetPredictors(): void;
|
|
62
|
+
//# sourceMappingURL=predictors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predictors.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/predictors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,aAAa,CAAC;AAQxC;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvE,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,QAAQ,EAAE,OAAO,GAAG,CAAC,QAAQ,CAAC;IAC9B,mDAAmD;IACnD,kBAAkB,EAAE,OAAO,GAAG,CAAC,kBAAkB,CAAC;IAClD,4EAA4E;IAC5E,UAAU,EAAE,OAAO,GAAG,CAAC,UAAU,CAAC;IAClC,uDAAuD;IACvD,mBAAmB,EAAE,OAAO,GAAG,CAAC,mBAAmB,CAAC;IACpD,wDAAwD;IACxD,QAAQ,EAAE,GAAG,CAAC,iBAAiB,CAAC;IAChC,6CAA6C;IAC7C,YAAY,EAAE,GAAG,CAAC,qBAAqB,CAAC;CACzC;AAED,4DAA4D;AAC5D,qBAAa,0BAA2B,SAAQ,KAAK;IAC1C,IAAI,SAAgC;CAC9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAG3B;AAED,sEAAsE;AACtE,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenChemLib, loaded once and proved to be working before anything is
|
|
3
|
+
* predicted with it.
|
|
4
|
+
*
|
|
5
|
+
* Both predictors throw `static resources must be registered first` until
|
|
6
|
+
* `Resources.register*` has run — but only when *nothing* was registered. If
|
|
7
|
+
* something else was, `new ToxicityPredictor()` constructs happily, prints to
|
|
8
|
+
* the console, and answers every `assessRisk` with `RISK_UNKNOWN`, on which
|
|
9
|
+
* `DrugScoreCalculator` applies no penalty at all. The failure therefore reads
|
|
10
|
+
* on screen as four clean molecules and a healthy score. So the tables are
|
|
11
|
+
* proved here, at start-up, against a molecule whose answer is known: a
|
|
12
|
+
* fragment match that must come back high, and a drug-likeness that must be a
|
|
13
|
+
* real number. Between them the two families of resource file are both covered.
|
|
14
|
+
*
|
|
15
|
+
* The check costs about 160 ms once per worker, most of which is warm-up the
|
|
16
|
+
* first real molecule would have paid anyway — measured, a first prediction is
|
|
17
|
+
* 320 ms cold against 191 ms warm.
|
|
18
|
+
*/
|
|
19
|
+
import { NO_FRAGMENT_MATCHED, RISK_TYPE_CODES, UNKNOWN_NUMBER, } from "./constants.js";
|
|
20
|
+
/** The tables did not load, so nothing may be predicted. */
|
|
21
|
+
export class PredictorsUnavailableError extends Error {
|
|
22
|
+
name = 'PredictorsUnavailableError';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* OpenChemLib with its resources registered and checked.
|
|
26
|
+
*
|
|
27
|
+
* Loaded lazily — the library is 340 kB gzipped and does not tree-shake — and
|
|
28
|
+
* kept, because `Resources.register` replaces the whole map rather than merging
|
|
29
|
+
* into it, so registering twice with different keys silently unregisters the
|
|
30
|
+
* first set.
|
|
31
|
+
* @param source - The resources URL, or the parsed resources themselves.
|
|
32
|
+
* @returns The predictors, proved to answer.
|
|
33
|
+
* @throws {PredictorsUnavailableError} When the resources did not load, or loaded and answer nothing.
|
|
34
|
+
*/
|
|
35
|
+
export function loadPredictors(source) {
|
|
36
|
+
if (loaded === null)
|
|
37
|
+
loaded = start(source);
|
|
38
|
+
return loaded;
|
|
39
|
+
}
|
|
40
|
+
/** Forget the loaded predictors, so the next call registers again. */
|
|
41
|
+
export function resetPredictors() {
|
|
42
|
+
loaded = null;
|
|
43
|
+
}
|
|
44
|
+
let loaded = null;
|
|
45
|
+
/**
|
|
46
|
+
* A failed load is not kept: a fetch that failed once may well answer on the
|
|
47
|
+
* next try, and a cached rejection would turn one lost packet into a page that
|
|
48
|
+
* stays broken until it is reloaded.
|
|
49
|
+
* @param source - The resources URL, or the parsed resources themselves.
|
|
50
|
+
* @returns The predictors, proved to answer.
|
|
51
|
+
*/
|
|
52
|
+
function start(source) {
|
|
53
|
+
const pending = build(source);
|
|
54
|
+
void pending.catch(() => {
|
|
55
|
+
if (loaded === pending)
|
|
56
|
+
loaded = null;
|
|
57
|
+
});
|
|
58
|
+
return pending;
|
|
59
|
+
}
|
|
60
|
+
/** Benzidine — its mutagenicity comes from a fragment match, not from a list. */
|
|
61
|
+
const PROBE_ID_CODE = 'dg}@@@mIe]e^ftx@H@H@@';
|
|
62
|
+
const UNAVAILABLE = 'The prediction tables did not load, so no risk or drug-likeness can be computed. Reload the page.';
|
|
63
|
+
async function build(source) {
|
|
64
|
+
const ocl = await import('openchemlib');
|
|
65
|
+
try {
|
|
66
|
+
if (typeof source === 'string')
|
|
67
|
+
await ocl.Resources.registerFromUrl(source);
|
|
68
|
+
else
|
|
69
|
+
ocl.Resources.register({ ...source });
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
throw new PredictorsUnavailableError(UNAVAILABLE);
|
|
73
|
+
}
|
|
74
|
+
let toxicity;
|
|
75
|
+
let druglikeness;
|
|
76
|
+
try {
|
|
77
|
+
toxicity = new ocl.ToxicityPredictor();
|
|
78
|
+
druglikeness = new ocl.DruglikenessPredictor();
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
throw new PredictorsUnavailableError(UNAVAILABLE);
|
|
82
|
+
}
|
|
83
|
+
const probe = ocl.Molecule.fromIDCode(PROBE_ID_CODE);
|
|
84
|
+
const risk = toxicity.assessRisk(probe, RISK_TYPE_CODES.mutagenic);
|
|
85
|
+
const likeness = druglikeness.assessDruglikeness(probe);
|
|
86
|
+
if (risk !== 3 ||
|
|
87
|
+
likeness === UNKNOWN_NUMBER ||
|
|
88
|
+
likeness === NO_FRAGMENT_MATCHED) {
|
|
89
|
+
throw new PredictorsUnavailableError(UNAVAILABLE);
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
Molecule: ocl.Molecule,
|
|
93
|
+
MoleculeProperties: ocl.MoleculeProperties,
|
|
94
|
+
SSSearcher: ocl.SSSearcher,
|
|
95
|
+
DrugScoreCalculator: ocl.DrugScoreCalculator,
|
|
96
|
+
toxicity,
|
|
97
|
+
druglikeness,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=predictors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predictors.js","sourceRoot":"","sources":["../../../src/osiris/core/predictors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,cAAc,GACf,MAAM,gBAAgB,CAAC;AA4BxB,4DAA4D;AAC5D,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC1C,IAAI,GAAG,4BAA4B,CAAC;CAC9C;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAsB;IAEtB,IAAI,MAAM,KAAK,IAAI;QAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,eAAe;IAC7B,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC;AAED,IAAI,MAAM,GAAqC,IAAI,CAAC;AAEpD;;;;;;GAMG;AACH,SAAS,KAAK,CAAC,MAAsB;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;QACtB,IAAI,MAAM,KAAK,OAAO;YAAE,MAAM,GAAG,IAAI,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iFAAiF;AACjF,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAE9C,MAAM,WAAW,GACf,mGAAmG,CAAC;AAEtG,KAAK,UAAU,KAAK,CAAC,MAAsB;IACzC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;IACxC,IAAI,CAAC;QACH,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,MAAM,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;;YACvE,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,QAA+B,CAAC;IACpC,IAAI,YAAuC,CAAC;IAC5C,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACvC,YAAY,GAAG,IAAI,GAAG,CAAC,qBAAqB,EAAE,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,YAAY,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACxD,IACE,IAAI,KAAK,CAAC;QACV,QAAQ,KAAK,cAAc;QAC3B,QAAQ,KAAK,mBAAmB,EAChC,CAAC;QACD,MAAM,IAAI,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;QAC1C,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,mBAAmB,EAAE,GAAG,CAAC,mBAAmB;QAC5C,QAAQ;QACR,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of a molecule's predicted numbers the tool shows, and in which order.
|
|
3
|
+
*
|
|
4
|
+
* The order is the legacy panel's, top to bottom, and it is the same order the
|
|
5
|
+
* comparison table's columns and the plot's default axes take: a reader who
|
|
6
|
+
* learned the panel reads the table without relearning it. The keys are the
|
|
7
|
+
* field names of {@link OsirisProperties}, so an address carrying
|
|
8
|
+
* `axes=logP,logS` names the same things the panel does.
|
|
9
|
+
*/
|
|
10
|
+
import type { OsirisProperties } from './types.ts';
|
|
11
|
+
/** The ten numbers the tool shows, in the order it shows them. */
|
|
12
|
+
export declare const PROPERTY_KEYS: readonly ["logP", "logS", "molecularWeight", "polarSurfaceArea", "druglikeness", "acceptorCount", "donorCount", "stereoCenterCount", "rotatableBondCount", "drugScore"];
|
|
13
|
+
/** One of the ten displayed properties. */
|
|
14
|
+
export type PropertyKey = (typeof PROPERTY_KEYS)[number];
|
|
15
|
+
/**
|
|
16
|
+
* Whether a string names a displayed property, so an address that carries
|
|
17
|
+
* something else is ignored rather than plotted as a blank axis.
|
|
18
|
+
* @param value - Whatever the address or the reader supplied.
|
|
19
|
+
* @returns True when it is one of the ten.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isPropertyKey(value: string): value is PropertyKey;
|
|
22
|
+
/**
|
|
23
|
+
* One property of one molecule.
|
|
24
|
+
*
|
|
25
|
+
* `null` means the predictor could not answer — never zero, and never the
|
|
26
|
+
* library's own sentinel, both of which plot and sort as real values.
|
|
27
|
+
* @param properties - What was predicted for the molecule.
|
|
28
|
+
* @param key - Which of the ten to read.
|
|
29
|
+
* @returns The number, or `null` when it is unknown.
|
|
30
|
+
*/
|
|
31
|
+
export declare function propertyValue(properties: OsirisProperties, key: PropertyKey): number | null;
|
|
32
|
+
//# sourceMappingURL=propertyKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyKeys.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/propertyKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,kEAAkE;AAClE,eAAO,MAAM,aAAa,yKAWhB,CAAC;AAEX,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAEjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,gBAAgB,EAC5B,GAAG,EAAE,WAAW,GACf,MAAM,GAAG,IAAI,CAEf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of a molecule's predicted numbers the tool shows, and in which order.
|
|
3
|
+
*
|
|
4
|
+
* The order is the legacy panel's, top to bottom, and it is the same order the
|
|
5
|
+
* comparison table's columns and the plot's default axes take: a reader who
|
|
6
|
+
* learned the panel reads the table without relearning it. The keys are the
|
|
7
|
+
* field names of {@link OsirisProperties}, so an address carrying
|
|
8
|
+
* `axes=logP,logS` names the same things the panel does.
|
|
9
|
+
*/
|
|
10
|
+
/** The ten numbers the tool shows, in the order it shows them. */
|
|
11
|
+
export const PROPERTY_KEYS = [
|
|
12
|
+
'logP',
|
|
13
|
+
'logS',
|
|
14
|
+
'molecularWeight',
|
|
15
|
+
'polarSurfaceArea',
|
|
16
|
+
'druglikeness',
|
|
17
|
+
'acceptorCount',
|
|
18
|
+
'donorCount',
|
|
19
|
+
'stereoCenterCount',
|
|
20
|
+
'rotatableBondCount',
|
|
21
|
+
'drugScore',
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Whether a string names a displayed property, so an address that carries
|
|
25
|
+
* something else is ignored rather than plotted as a blank axis.
|
|
26
|
+
* @param value - Whatever the address or the reader supplied.
|
|
27
|
+
* @returns True when it is one of the ten.
|
|
28
|
+
*/
|
|
29
|
+
export function isPropertyKey(value) {
|
|
30
|
+
return PROPERTY_KEYS.includes(value);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* One property of one molecule.
|
|
34
|
+
*
|
|
35
|
+
* `null` means the predictor could not answer — never zero, and never the
|
|
36
|
+
* library's own sentinel, both of which plot and sort as real values.
|
|
37
|
+
* @param properties - What was predicted for the molecule.
|
|
38
|
+
* @param key - Which of the ten to read.
|
|
39
|
+
* @returns The number, or `null` when it is unknown.
|
|
40
|
+
*/
|
|
41
|
+
export function propertyValue(properties, key) {
|
|
42
|
+
return properties[key];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=propertyKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyKeys.js","sourceRoot":"","sources":["../../../src/osiris/core/propertyKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,kEAAkE;AAClE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM;IACN,MAAM;IACN,iBAAiB;IACjB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,YAAY;IACZ,mBAAmB;IACnB,oBAAoB;IACpB,WAAW;CACH,CAAC;AAKX;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,UAA4B,EAC5B,GAAgB;IAEhB,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How one risk reads on screen: the word for it, and the tone its square takes.
|
|
3
|
+
*
|
|
4
|
+
* Three levels, and they are exactly the three `DrugScoreCalculator` multiplies
|
|
5
|
+
* by — no risk ×1, medium ×0.8, high ×0.6 — so the colours say what the score
|
|
6
|
+
* already counted. A fourth tone exists for the state the library calls
|
|
7
|
+
* `RISK_UNKNOWN`, which means its tables did not load: it is grey, never green,
|
|
8
|
+
* because "nothing was assessed" and "nothing was found" are different answers
|
|
9
|
+
* and showing them alike is the one mistake that makes the panel dishonest.
|
|
10
|
+
*
|
|
11
|
+
* A fifth, `pending`, is ours: the prediction costs a fifth of a second and the
|
|
12
|
+
* square is on screen before it comes back.
|
|
13
|
+
*/
|
|
14
|
+
import type { RiskLevel } from './types.ts';
|
|
15
|
+
/** What a square is painted with, before the stylesheet turns it into a colour. */
|
|
16
|
+
export type RiskTone = 'pending' | 'unknown' | 'none' | 'low' | 'high';
|
|
17
|
+
/** How one risk is shown. */
|
|
18
|
+
export interface RiskAppearance {
|
|
19
|
+
/** The stylesheet's `data-level`, which picks the square's colour. */
|
|
20
|
+
tone: RiskTone;
|
|
21
|
+
/** What the square says next to the risk's name, e.g. `High risk`. */
|
|
22
|
+
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the level is worth opening: an explanation exists for an assessed
|
|
25
|
+
* risk and for nothing else.
|
|
26
|
+
*/
|
|
27
|
+
explainable: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** What a square says while its molecule is still being predicted. */
|
|
30
|
+
export declare const PENDING_RISK_LABEL = "Predicting\u2026";
|
|
31
|
+
/**
|
|
32
|
+
* What a square says when there is no molecule to predict.
|
|
33
|
+
*
|
|
34
|
+
* The comparison page draws the panel before a row is picked, and a square that
|
|
35
|
+
* said `Predicting…` there would claim work nobody asked for — under a heading
|
|
36
|
+
* inviting the reader to pick a row, which is a plain contradiction.
|
|
37
|
+
*/
|
|
38
|
+
export declare const IDLE_RISK_LABEL = "Not predicted yet";
|
|
39
|
+
/**
|
|
40
|
+
* What the predictor's own page says about its alerts, word for word.
|
|
41
|
+
*
|
|
42
|
+
* Quoted rather than paraphrased: it is the sentence that stops a red square
|
|
43
|
+
* being read as a verdict, and rewriting it would put our words over his.
|
|
44
|
+
*/
|
|
45
|
+
export declare const RISK_CAVEAT = "Toxicity risk alerts are by no means meant to be a fully reliable toxicity prediction. Nor should be concluded from the absence of risk alerts that a particular substance is completely free of any toxic effect.";
|
|
46
|
+
/**
|
|
47
|
+
* What is said in place of a highlight when the compound's own idCode is on one
|
|
48
|
+
* of the RTECS-derived lists. There is no fragment to point at, and painting the
|
|
49
|
+
* whole molecule would call the compound its own toxicophore.
|
|
50
|
+
*/
|
|
51
|
+
export declare const KNOWN_MOLECULE_NOTE = "This exact compound is on the list, so there is no fragment to point at.";
|
|
52
|
+
/**
|
|
53
|
+
* The tone and the word for one risk.
|
|
54
|
+
* @param level - How the risk came back, or `undefined` when there is none yet.
|
|
55
|
+
* @param pending - Whether a prediction is actually running for this molecule.
|
|
56
|
+
* @default false
|
|
57
|
+
* @returns See {@link RiskAppearance}.
|
|
58
|
+
*/
|
|
59
|
+
export declare function riskAppearance(level: RiskLevel | undefined, pending?: boolean): RiskAppearance;
|
|
60
|
+
//# sourceMappingURL=riskAppearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riskAppearance.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/riskAppearance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,mFAAmF;AACnF,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvE,6BAA6B;AAC7B,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,IAAI,EAAE,QAAQ,CAAC;IACf,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,qBAAgB,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uNAC8L,CAAC;AAEvN;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,6EAC4C,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,GAAG,SAAS,EAC5B,OAAO,UAAQ,GACd,cAAc,CAahB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How one risk reads on screen: the word for it, and the tone its square takes.
|
|
3
|
+
*
|
|
4
|
+
* Three levels, and they are exactly the three `DrugScoreCalculator` multiplies
|
|
5
|
+
* by — no risk ×1, medium ×0.8, high ×0.6 — so the colours say what the score
|
|
6
|
+
* already counted. A fourth tone exists for the state the library calls
|
|
7
|
+
* `RISK_UNKNOWN`, which means its tables did not load: it is grey, never green,
|
|
8
|
+
* because "nothing was assessed" and "nothing was found" are different answers
|
|
9
|
+
* and showing them alike is the one mistake that makes the panel dishonest.
|
|
10
|
+
*
|
|
11
|
+
* A fifth, `pending`, is ours: the prediction costs a fifth of a second and the
|
|
12
|
+
* square is on screen before it comes back.
|
|
13
|
+
*/
|
|
14
|
+
import { RISK_LEVEL_LABELS } from "./constants.js";
|
|
15
|
+
/** What a square says while its molecule is still being predicted. */
|
|
16
|
+
export const PENDING_RISK_LABEL = 'Predicting…';
|
|
17
|
+
/**
|
|
18
|
+
* What a square says when there is no molecule to predict.
|
|
19
|
+
*
|
|
20
|
+
* The comparison page draws the panel before a row is picked, and a square that
|
|
21
|
+
* said `Predicting…` there would claim work nobody asked for — under a heading
|
|
22
|
+
* inviting the reader to pick a row, which is a plain contradiction.
|
|
23
|
+
*/
|
|
24
|
+
export const IDLE_RISK_LABEL = 'Not predicted yet';
|
|
25
|
+
/**
|
|
26
|
+
* What the predictor's own page says about its alerts, word for word.
|
|
27
|
+
*
|
|
28
|
+
* Quoted rather than paraphrased: it is the sentence that stops a red square
|
|
29
|
+
* being read as a verdict, and rewriting it would put our words over his.
|
|
30
|
+
*/
|
|
31
|
+
export const RISK_CAVEAT = 'Toxicity risk alerts are by no means meant to be a fully reliable toxicity prediction. Nor should be concluded from the absence of risk alerts that a particular substance is completely free of any toxic effect.';
|
|
32
|
+
/**
|
|
33
|
+
* What is said in place of a highlight when the compound's own idCode is on one
|
|
34
|
+
* of the RTECS-derived lists. There is no fragment to point at, and painting the
|
|
35
|
+
* whole molecule would call the compound its own toxicophore.
|
|
36
|
+
*/
|
|
37
|
+
export const KNOWN_MOLECULE_NOTE = 'This exact compound is on the list, so there is no fragment to point at.';
|
|
38
|
+
/**
|
|
39
|
+
* The tone and the word for one risk.
|
|
40
|
+
* @param level - How the risk came back, or `undefined` when there is none yet.
|
|
41
|
+
* @param pending - Whether a prediction is actually running for this molecule.
|
|
42
|
+
* @default false
|
|
43
|
+
* @returns See {@link RiskAppearance}.
|
|
44
|
+
*/
|
|
45
|
+
export function riskAppearance(level, pending = false) {
|
|
46
|
+
if (level === undefined) {
|
|
47
|
+
return {
|
|
48
|
+
tone: 'pending',
|
|
49
|
+
label: pending ? PENDING_RISK_LABEL : IDLE_RISK_LABEL,
|
|
50
|
+
explainable: false,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
tone: level,
|
|
55
|
+
label: RISK_LEVEL_LABELS[level],
|
|
56
|
+
explainable: level !== 'unknown',
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=riskAppearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riskAppearance.js","sourceRoot":"","sources":["../../../src/osiris/core/riskAppearance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAmBnD,sEAAsE;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GACtB,oNAAoN,CAAC;AAEvN;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,0EAA0E,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,KAA4B,EAC5B,OAAO,GAAG,KAAK;IAEf,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe;YACrD,WAAW,EAAE,KAAK;SACnB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC;QAC/B,WAAW,EAAE,KAAK,KAAK,SAAS;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why one risk came back as it did, with the offending substructure located on
|
|
3
|
+
* the molecule.
|
|
4
|
+
*
|
|
5
|
+
* The match runs in the predictor's own mode —
|
|
6
|
+
* `new SSSearcher({ matchAtomCharge: true, matchAromDBondToDelocalized: false })`,
|
|
7
|
+
* which is OpenChemLib's mode 1. The JavaScript default is mode 8, and it can
|
|
8
|
+
* disagree with what `assessRisk` actually found, which would leave a risk
|
|
9
|
+
* reported with nothing highlighted and no way to tell why.
|
|
10
|
+
*/
|
|
11
|
+
import type * as OCL from 'openchemlib';
|
|
12
|
+
import type { OsirisPredictors } from './predictors.ts';
|
|
13
|
+
import type { RiskDetail, RiskType } from './types.ts';
|
|
14
|
+
/**
|
|
15
|
+
* What the predictor found, and where on the molecule it found it.
|
|
16
|
+
* @param molecule - The molecule the risk was assessed on. It is copied before being searched.
|
|
17
|
+
* @param risk - Which of the four risks to explain.
|
|
18
|
+
* @param predictors - OpenChemLib with its resources registered and checked.
|
|
19
|
+
* @returns One finding per sentence the predictor printed, and one per matched fragment.
|
|
20
|
+
*/
|
|
21
|
+
export declare function riskDetail(molecule: OCL.Molecule, risk: RiskType, predictors: OsirisPredictors): RiskDetail;
|
|
22
|
+
//# sourceMappingURL=riskDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riskDetail.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/riskDetail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,aAAa,CAAC;AAGxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAEV,UAAU,EAEV,QAAQ,EACT,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ,EACtB,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,gBAAgB,GAC3B,UAAU,CAgBZ"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why one risk came back as it did, with the offending substructure located on
|
|
3
|
+
* the molecule.
|
|
4
|
+
*
|
|
5
|
+
* The match runs in the predictor's own mode —
|
|
6
|
+
* `new SSSearcher({ matchAtomCharge: true, matchAromDBondToDelocalized: false })`,
|
|
7
|
+
* which is OpenChemLib's mode 1. The JavaScript default is mode 8, and it can
|
|
8
|
+
* disagree with what `assessRisk` actually found, which would leave a risk
|
|
9
|
+
* reported with nothing highlighted and no way to tell why.
|
|
10
|
+
*/
|
|
11
|
+
import { RISK_TYPE_CODES } from "./constants.js";
|
|
12
|
+
import { parseRiskFindings } from "./riskFindings.js";
|
|
13
|
+
/**
|
|
14
|
+
* What the predictor found, and where on the molecule it found it.
|
|
15
|
+
* @param molecule - The molecule the risk was assessed on. It is copied before being searched.
|
|
16
|
+
* @param risk - Which of the four risks to explain.
|
|
17
|
+
* @param predictors - OpenChemLib with its resources registered and checked.
|
|
18
|
+
* @returns One finding per sentence the predictor printed, and one per matched fragment.
|
|
19
|
+
*/
|
|
20
|
+
export function riskDetail(molecule, risk, predictors) {
|
|
21
|
+
const working = molecule.getCompactCopy();
|
|
22
|
+
const entries = predictors.toxicity.getDetail(working, RISK_TYPE_CODES[risk]);
|
|
23
|
+
const findings = [];
|
|
24
|
+
for (const finding of parseRiskFindings(entries)) {
|
|
25
|
+
findings.push(finding.idCode === null
|
|
26
|
+
? finding
|
|
27
|
+
: { ...finding, ...locate(working, finding.idCode, predictors) });
|
|
28
|
+
}
|
|
29
|
+
return { risk, findings };
|
|
30
|
+
}
|
|
31
|
+
function locate(molecule, fragmentIdCode, predictors) {
|
|
32
|
+
let fragment;
|
|
33
|
+
try {
|
|
34
|
+
fragment = predictors.Molecule.fromIDCode(fragmentIdCode);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return { atoms: [], bonds: [] };
|
|
38
|
+
}
|
|
39
|
+
const searcher = new predictors.SSSearcher({
|
|
40
|
+
matchAtomCharge: true,
|
|
41
|
+
matchAromDBondToDelocalized: false,
|
|
42
|
+
});
|
|
43
|
+
searcher.setMol(fragment, molecule);
|
|
44
|
+
if (!searcher.isFragmentInMolecule())
|
|
45
|
+
return { atoms: [], bonds: [] };
|
|
46
|
+
searcher.findFragmentInMolecule({ countMode: 'overlapping' });
|
|
47
|
+
const atoms = new Set();
|
|
48
|
+
const bonds = new Set();
|
|
49
|
+
for (const match of searcher.getMatchList()) {
|
|
50
|
+
collect(molecule, fragment, match, atoms, bonds);
|
|
51
|
+
}
|
|
52
|
+
return { atoms: sorted(atoms), bonds: sorted(bonds) };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Add one match's atoms and bonds to the running sets.
|
|
56
|
+
*
|
|
57
|
+
* A fragment atom the query marked as an exclude group maps to -1, and a bond
|
|
58
|
+
* between two matched atoms may not exist in the molecule when the fragment
|
|
59
|
+
* matched through a bridge, so both are checked rather than assumed.
|
|
60
|
+
* @param molecule - The molecule searched.
|
|
61
|
+
* @param fragment - The fragment that matched.
|
|
62
|
+
* @param map - The molecule's atom for each of the fragment's, -1 for none.
|
|
63
|
+
* @param atoms - The matched atoms so far, added to.
|
|
64
|
+
* @param bonds - The matched bonds so far, added to.
|
|
65
|
+
*/
|
|
66
|
+
function collect(molecule, fragment, map, atoms, bonds) {
|
|
67
|
+
for (const atom of map) {
|
|
68
|
+
if (atom >= 0)
|
|
69
|
+
atoms.add(atom);
|
|
70
|
+
}
|
|
71
|
+
for (let bond = 0; bond < fragment.getAllBonds(); bond++) {
|
|
72
|
+
const first = map[fragment.getBondAtom(0, bond)];
|
|
73
|
+
const second = map[fragment.getBondAtom(1, bond)];
|
|
74
|
+
if (first === undefined || second === undefined)
|
|
75
|
+
continue;
|
|
76
|
+
if (first < 0 || second < 0)
|
|
77
|
+
continue;
|
|
78
|
+
const found = molecule.getBond(first, second);
|
|
79
|
+
if (found !== -1)
|
|
80
|
+
bonds.add(found);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function sorted(values) {
|
|
84
|
+
return Array.from(values).toSorted((a, b) => a - b);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=riskDetail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riskDetail.js","sourceRoot":"","sources":["../../../src/osiris/core/riskDetail.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asking a worker why one risk came back as it did, and asking again when the
|
|
3
|
+
* set's cancel took the question with it.
|
|
4
|
+
*
|
|
5
|
+
* An explanation travels on a properties channel, and `cancel` drops every
|
|
6
|
+
* request on every channel — the reader's click included, which then reads as
|
|
7
|
+
* the channel's own words in place of the findings. It is not part of the set
|
|
8
|
+
* being abandoned, so it is simply asked for again.
|
|
9
|
+
*
|
|
10
|
+
* A channel of its own would be the other way, and is worse here: a channel
|
|
11
|
+
* makes its worker on the first request, so the first click would wait for
|
|
12
|
+
* OpenChemLib and the 398 kB of resource tables to load in a cold worker,
|
|
13
|
+
* where the shared one is already warm. The retry costs one more message on a
|
|
14
|
+
* worker that is running anyway.
|
|
15
|
+
*/
|
|
16
|
+
import type { WorkerChannel } from '../../worker/core/workerChannelTypes.ts';
|
|
17
|
+
import type { PredictRequest, PredictResponse, RiskDetailRequest } from './predictProtocol.ts';
|
|
18
|
+
type Channel = WorkerChannel<PredictRequest, PredictResponse>;
|
|
19
|
+
/** What the reader is told when the second ask was dropped as well. */
|
|
20
|
+
export declare const RISK_DETAIL_DROPPED = "That explanation was dropped when the run stopped. Close the risk square and open it again.";
|
|
21
|
+
/**
|
|
22
|
+
* Ask a worker to explain one risk, once more if a cancel dropped the ask.
|
|
23
|
+
* @param channelOf - Picks the channel to ask on, called again for the retry so it lands on whichever worker is least busy by then.
|
|
24
|
+
* @param request - The explanation to ask for.
|
|
25
|
+
* @param mayRetry - Whether asking again can still be answered: false once the pool is terminated, or once its resources are known not to have loaded.
|
|
26
|
+
* @returns Whatever the worker answered, including its `unavailable`.
|
|
27
|
+
* @throws {Error} When the ask was dropped and cannot be made again.
|
|
28
|
+
*/
|
|
29
|
+
export declare function requestRiskDetail(channelOf: () => Channel, request: RiskDetailRequest, mayRetry: () => boolean): Promise<PredictResponse>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=riskDetailRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"riskDetailRequest.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/riskDetailRequest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,KAAK,OAAO,GAAG,aAAa,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;AAE9D,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,gGAC+D,CAAC;AAEhG;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,OAAO,EACxB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,MAAM,OAAO,GACtB,OAAO,CAAC,eAAe,CAAC,CAQ1B"}
|