nmrium 0.39.0 → 0.41.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/lib/component/1d/FooterBanner.js +5 -4
- package/lib/component/1d/Viewer1D.js +121 -104
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +7 -4
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +1 -3
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib/component/2d/FooterBanner.js +3 -2
- package/lib/component/2d/Viewer2D.js +51 -29
- package/lib/component/2d/XAxis.js +1 -1
- package/lib/component/2d/YAxis.js +1 -1
- package/lib/component/2d/utilities/SliceScale.d.ts +2 -2
- package/lib/component/2d/utilities/scale.d.ts +5 -5
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +4 -1
- package/lib/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib/component/NMRium.d.ts +2 -2
- package/lib/component/NMRium.js +39 -26
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib/component/context/LoggerContext.js +11 -6
- package/lib/component/elements/InputRange.js +1 -1
- package/lib/component/elements/MenuButton.d.ts +1 -1
- package/lib/component/elements/MoleculeSelection.d.ts +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +1 -1
- package/lib/component/elements/Tab/DeleteButton.d.ts +1 -1
- package/lib/component/elements/ToolbarMenu.d.ts +1 -1
- package/lib/component/elements/accordion/Accordion.d.ts +1 -1
- package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
- package/lib/component/elements/draggable/useDraggable.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib/component/elements/formik/SelectBox.d.ts +1 -1
- package/lib/component/elements/popup/Alert/AlertBlock.d.ts +8 -0
- package/lib/component/elements/popup/Alert/AlertBlock.js +30 -0
- package/lib/component/elements/popup/Alert/Context.d.ts +26 -2
- package/lib/component/elements/popup/Alert/Context.js +6 -2
- package/lib/component/elements/popup/Alert/Provider.d.ts +4 -3
- package/lib/component/elements/popup/Alert/Provider.js +5 -23
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +2 -1
- package/lib/component/elements/popup/Modal/Provider.js +3 -1
- package/lib/component/elements/popup/options.d.ts +22 -19
- package/lib/component/elements/resizer/Resizer.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.js +1 -1
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib/component/hooks/useExport.js +2 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/usePanelPreferences.js +2 -2
- package/lib/component/hooks/useXScale.d.ts +1 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/modal/AboutSpectrumSimulationModal.d.ts +2 -0
- package/lib/component/modal/AboutSpectrumSimulationModal.js +49 -0
- package/lib/component/modal/AboutUsModal.js +4 -2
- package/lib/component/modal/AlignSpectraModal.js +11 -1
- package/lib/component/modal/LogsHistoryModal.d.ts +6 -0
- package/lib/component/{header/LogsHistory.js → modal/LogsHistoryModal.js} +6 -4
- package/lib/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib/component/modal/PredictSpectraModal.d.ts +1 -2
- package/lib/component/modal/PredictSpectraModal.js +25 -28
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +28 -27
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +19 -19
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -13
- package/lib/component/panels/Panels.js +13 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +9 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -10
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +8 -11
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -2
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.d.ts +1 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +88 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +11 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +37 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.d.ts +4 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +25 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts +5 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +60 -0
- package/lib/component/reducer/Reducer.d.ts +13 -12
- package/lib/component/reducer/Reducer.js +251 -239
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +30 -1
- package/lib/component/reducer/actions/FiltersActions.js +4 -4
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -0
- package/lib/component/reducer/actions/MoleculeActions.js +51 -2
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +43 -4
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ZonesActions.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +4 -6
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +4 -4
- package/lib/component/utility/export.d.ts +5 -4
- package/lib/component/utility/export.js +33 -61
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/component/utility/getUniqueNuclei.js +1 -1
- package/lib/component/utility/jpathToArray.js +1 -1
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -0
- package/lib/component/workspaces/simulation.d.ts +2 -0
- package/lib/component/workspaces/simulation.js +68 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/PredictionManager.d.ts +8 -7
- package/lib/data/PredictionManager.js +95 -22
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/constants/DefaultPathLengths.d.ts +1 -3
- package/lib/data/constants/SignalsKinds.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib/data/data1d/database.d.ts +5 -5
- package/lib/data/data1d/database.js +3 -3
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib/data/data1d/spectrumSimulation.d.ts +14 -0
- package/lib/data/data1d/spectrumSimulation.js +53 -0
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -4
- package/lib/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib/data/getDefaultMatrixFilters.d.ts +2 -2
- package/lib/data/matrixGeneration.js +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +7 -7
- package/lib/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib/data/types/data1d/MatrixOptions.d.ts +2 -2
- package/lib/data/utilities/FindUtilities.js +4 -4
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.js +3 -3
- package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib/utils/clipboard/clipboard.d.ts +12 -0
- package/lib/utils/clipboard/clipboard.js +15 -0
- package/lib/utils/clipboard/clipboardComponents.d.ts +45 -0
- package/lib/utils/clipboard/clipboardComponents.js +150 -0
- package/lib/utils/clipboard/clipboardHooks.d.ts +94 -0
- package/lib/utils/clipboard/clipboardHooks.js +142 -0
- package/lib/utils/clipboard/types.d.ts +1 -0
- package/lib/utils/clipboard/types.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +5 -4
- package/lib-cjs/component/1d/Viewer1D.js +120 -103
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib-cjs/component/1d/tool/BaseLineZones.js +6 -3
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +1 -3
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib-cjs/component/2d/FooterBanner.js +3 -2
- package/lib-cjs/component/2d/Viewer2D.js +50 -28
- package/lib-cjs/component/2d/XAxis.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib-cjs/component/NMRium.js +37 -24
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +10 -5
- package/lib-cjs/component/elements/InputRange.js +1 -1
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib-cjs/component/elements/popup/Alert/AlertBlock.js +36 -0
- package/lib-cjs/component/elements/popup/Alert/Context.js +6 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +4 -22
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +2 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -1
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +2 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +1 -1
- package/lib-cjs/component/modal/AboutSpectrumSimulationModal.js +54 -0
- package/lib-cjs/component/modal/AboutUsModal.js +4 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +11 -1
- package/lib-cjs/component/{header/LogsHistory.js → modal/LogsHistoryModal.js} +8 -6
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -27
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +28 -27
- package/lib-cjs/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +18 -18
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -13
- package/lib-cjs/component/panels/Panels.js +13 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +9 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -10
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +8 -11
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +94 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +42 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +31 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpinSystemTable.js +67 -0
- package/lib-cjs/component/reducer/Reducer.js +251 -239
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +31 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +4 -4
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +54 -2
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +43 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ZonesActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib-cjs/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib-cjs/component/utility/export.js +33 -63
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/component/utility/getUniqueNuclei.js +1 -1
- package/lib-cjs/component/utility/jpathToArray.js +1 -1
- package/lib-cjs/component/workspaces/index.js +2 -0
- package/lib-cjs/component/workspaces/simulation.js +71 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib-cjs/data/PredictionManager.js +96 -22
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib-cjs/data/data1d/database.js +3 -3
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib-cjs/data/data1d/spectrumSimulation.js +58 -0
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib-cjs/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib-cjs/data/matrixGeneration.js +1 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +7 -7
- package/lib-cjs/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib-cjs/data/utilities/FindUtilities.js +4 -4
- package/lib-cjs/data/utilities/calculateSanPlot.js +3 -3
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib-cjs/utils/clipboard/clipboard.js +23 -0
- package/lib-cjs/utils/clipboard/clipboardComponents.js +158 -0
- package/lib-cjs/utils/clipboard/clipboardHooks.js +147 -0
- package/lib-cjs/utils/clipboard/types.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/header/LogsHistory.d.ts +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const simulation = {
|
|
2
|
+
version: 1,
|
|
3
|
+
label: 'Simulation',
|
|
4
|
+
general: {
|
|
5
|
+
dimmedSpectraOpacity: 0.5,
|
|
6
|
+
verticalSplitterPosition: '440px',
|
|
7
|
+
verticalSplitterCloseThreshold: 600,
|
|
8
|
+
spectraRendering: 'auto',
|
|
9
|
+
loggingLevel: 'info',
|
|
10
|
+
},
|
|
11
|
+
display: {
|
|
12
|
+
panels: {
|
|
13
|
+
spectraPanel: { display: true },
|
|
14
|
+
simulationPanel: { display: true, open: true },
|
|
15
|
+
},
|
|
16
|
+
toolBarButtons: {
|
|
17
|
+
exportAs: true,
|
|
18
|
+
import: true,
|
|
19
|
+
spectraCenterAlignments: true,
|
|
20
|
+
spectraStackAlignments: true,
|
|
21
|
+
zoomOut: true,
|
|
22
|
+
zoom: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
formatting: {
|
|
26
|
+
nuclei: {},
|
|
27
|
+
panels: {
|
|
28
|
+
spectra: {
|
|
29
|
+
nuclei: {
|
|
30
|
+
'1H': {
|
|
31
|
+
columns: [
|
|
32
|
+
{
|
|
33
|
+
name: 'visible',
|
|
34
|
+
label: '',
|
|
35
|
+
description: 'Show/Hide Spectrum',
|
|
36
|
+
visible: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'name',
|
|
40
|
+
label: 'Spectrum Name',
|
|
41
|
+
description: 'Spectrum Name',
|
|
42
|
+
jpath: ['info', 'name'],
|
|
43
|
+
visible: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Frequency',
|
|
47
|
+
description: 'frequency',
|
|
48
|
+
jpath: ['info', 'originFrequency'],
|
|
49
|
+
visible: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
jpath: ['info', 'nucleus'],
|
|
53
|
+
label: 'Experiment',
|
|
54
|
+
visible: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'color',
|
|
58
|
+
label: '',
|
|
59
|
+
description: 'Spectrum Color',
|
|
60
|
+
visible: true,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -21,6 +21,7 @@ export const workspaceDefaultProperties = {
|
|
|
21
21
|
peaksPanel: { display: false, open: false },
|
|
22
22
|
predictionPanel: { display: false, open: false },
|
|
23
23
|
summaryPanel: { display: false, open: false },
|
|
24
|
+
simulationPanel: { display: false, open: false },
|
|
24
25
|
},
|
|
25
26
|
toolBarButtons: {
|
|
26
27
|
baselineCorrection: false,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Logger } from 'cheminfo-types';
|
|
2
2
|
import { Spectrum } from 'nmr-load-save';
|
|
3
|
-
import { PredictedAll } from 'nmr-processing';
|
|
3
|
+
import { PredictedAll, Prediction1D, Prediction2D } from 'nmr-processing';
|
|
4
4
|
export type Experiment = 'proton' | 'carbon' | 'cosy' | 'hsqc' | 'hmbc';
|
|
5
5
|
export type SpectraPredictionOptions = Record<Experiment, boolean>;
|
|
6
|
-
export type PredictedSpectraResult = Partial<Record<Experiment,
|
|
6
|
+
export type PredictedSpectraResult = Partial<Record<Experiment, Prediction1D | Prediction2D>>;
|
|
7
7
|
export interface PredictionOptions {
|
|
8
8
|
name: string;
|
|
9
9
|
frequency: number;
|
|
@@ -25,13 +25,14 @@ export interface PredictionOptions {
|
|
|
25
25
|
y: number;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
autoExtendRange: boolean;
|
|
28
29
|
spectra: SpectraPredictionOptions;
|
|
29
|
-
logger?:
|
|
30
|
+
logger?: Logger;
|
|
30
31
|
}
|
|
31
|
-
export declare const
|
|
32
|
+
export declare const getDefaultPredictionOptions: () => PredictionOptions;
|
|
32
33
|
export declare const FREQUENCIES: Array<{
|
|
33
34
|
value: number;
|
|
34
35
|
label: string;
|
|
35
36
|
}>;
|
|
36
|
-
export declare function predictSpectra(molfile: string
|
|
37
|
-
export declare function generateSpectra(predictedSpectra: PredictedSpectraResult, inputOptions: PredictionOptions, color: string): Spectrum[];
|
|
37
|
+
export declare function predictSpectra(molfile: string): Promise<PredictedAll>;
|
|
38
|
+
export declare function generateSpectra(predictedSpectra: PredictedSpectraResult, inputOptions: PredictionOptions, color: string, logger: Logger): Spectrum[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
|
-
import {
|
|
2
|
+
import { xMinMaxValues } from 'ml-spectra-processing';
|
|
3
|
+
import { predictAll, signalsToXY, signals2DToZ, getFrequency, signalsToRanges, } from 'nmr-processing';
|
|
3
4
|
import OCL from 'openchemlib/full';
|
|
4
5
|
import { DatumKind } from './constants/SignalsKinds';
|
|
5
6
|
import { initiateDatum1D, mapRanges, updateIntegralsRelativeValues, } from './data1d/Spectrum1D';
|
|
6
7
|
import { initiateDatum2D } from './data2d/Spectrum2D';
|
|
7
8
|
import { adjustAlpha } from './utilities/generateColor';
|
|
8
|
-
export const
|
|
9
|
+
export const getDefaultPredictionOptions = () => ({
|
|
9
10
|
name: '',
|
|
10
11
|
frequency: 400,
|
|
11
12
|
'1d': {
|
|
@@ -24,7 +25,8 @@ export const defaultPredictionOptions = {
|
|
|
24
25
|
hsqc: true,
|
|
25
26
|
hmbc: true,
|
|
26
27
|
},
|
|
27
|
-
|
|
28
|
+
autoExtendRange: true,
|
|
29
|
+
});
|
|
28
30
|
export const FREQUENCIES = [
|
|
29
31
|
{ value: 40, label: '40 MHz' },
|
|
30
32
|
{ value: 60, label: '60 MHz' },
|
|
@@ -41,10 +43,9 @@ export const FREQUENCIES = [
|
|
|
41
43
|
{ value: 1200, label: '1200 MHz' },
|
|
42
44
|
];
|
|
43
45
|
const baseURL = 'https://nmr-prediction.service.zakodium.com';
|
|
44
|
-
export async function predictSpectra(molfile
|
|
46
|
+
export async function predictSpectra(molfile) {
|
|
45
47
|
const molecule = OCL.Molecule.fromMolfile(molfile);
|
|
46
48
|
return predictAll(molecule, {
|
|
47
|
-
logger,
|
|
48
49
|
predictOptions: {
|
|
49
50
|
C: {
|
|
50
51
|
webserviceURL: `${baseURL}/v1/predict/carbon`,
|
|
@@ -59,17 +60,19 @@ function generateName(name, options) {
|
|
|
59
60
|
: `${frequency}MHz`;
|
|
60
61
|
return name || `${experiment.toUpperCase()}_${freq}_${v4()}`;
|
|
61
62
|
}
|
|
62
|
-
export function generateSpectra(predictedSpectra, inputOptions, color) {
|
|
63
|
+
export function generateSpectra(predictedSpectra, inputOptions, color, logger) {
|
|
64
|
+
const options = JSON.parse(JSON.stringify(inputOptions));
|
|
65
|
+
checkFromTo(predictedSpectra, options, logger);
|
|
63
66
|
const spectra = [];
|
|
64
67
|
for (const experiment in predictedSpectra) {
|
|
65
|
-
if (
|
|
68
|
+
if (options.spectra[experiment]) {
|
|
66
69
|
const spectrum = predictedSpectra[experiment];
|
|
67
70
|
switch (experiment) {
|
|
68
71
|
case 'proton':
|
|
69
72
|
case 'carbon': {
|
|
70
73
|
const datum = generated1DSpectrum({
|
|
71
74
|
spectrum,
|
|
72
|
-
|
|
75
|
+
options,
|
|
73
76
|
experiment,
|
|
74
77
|
color,
|
|
75
78
|
});
|
|
@@ -81,7 +84,7 @@ export function generateSpectra(predictedSpectra, inputOptions, color) {
|
|
|
81
84
|
case 'hmbc': {
|
|
82
85
|
const datum = generated2DSpectrum({
|
|
83
86
|
spectrum,
|
|
84
|
-
|
|
87
|
+
options,
|
|
85
88
|
experiment,
|
|
86
89
|
color,
|
|
87
90
|
});
|
|
@@ -95,14 +98,84 @@ export function generateSpectra(predictedSpectra, inputOptions, color) {
|
|
|
95
98
|
}
|
|
96
99
|
return spectra;
|
|
97
100
|
}
|
|
101
|
+
function checkFromTo(predictedSpectra, inputOptions, logger) {
|
|
102
|
+
const setFromTo = (inputOptions, nucleus, fromTo) => {
|
|
103
|
+
inputOptions['1d'][nucleus].to = fromTo.to;
|
|
104
|
+
inputOptions['1d'][nucleus].from = fromTo.from;
|
|
105
|
+
if (fromTo.signalsOutOfRange) {
|
|
106
|
+
signalsOutOfRange[nucleus] = true;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const { autoExtendRange, spectra } = inputOptions;
|
|
110
|
+
const signalsOutOfRange = {};
|
|
111
|
+
for (const experiment in predictedSpectra) {
|
|
112
|
+
if (!spectra[experiment])
|
|
113
|
+
continue;
|
|
114
|
+
if (predictedSpectra[experiment].signals.length === 0)
|
|
115
|
+
continue;
|
|
116
|
+
if (['carbon', 'proton'].includes(experiment)) {
|
|
117
|
+
const spectrum = predictedSpectra[experiment];
|
|
118
|
+
const { signals, nucleus } = spectrum;
|
|
119
|
+
const { from, to } = inputOptions['1d'][nucleus];
|
|
120
|
+
const fromTo = getNewFromTo({
|
|
121
|
+
deltas: signals.map((s) => s.delta),
|
|
122
|
+
from,
|
|
123
|
+
to,
|
|
124
|
+
nucleus,
|
|
125
|
+
autoExtendRange,
|
|
126
|
+
});
|
|
127
|
+
setFromTo(inputOptions, nucleus, fromTo);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const { signals, nuclei } = predictedSpectra[experiment];
|
|
131
|
+
for (const nucleus of nuclei) {
|
|
132
|
+
const axis = nucleus === '1H' ? 'x' : 'y';
|
|
133
|
+
const { from, to } = inputOptions['1d'][nucleus];
|
|
134
|
+
const fromTo = getNewFromTo({
|
|
135
|
+
deltas: signals.map((s) => s[axis].delta),
|
|
136
|
+
from,
|
|
137
|
+
to,
|
|
138
|
+
nucleus,
|
|
139
|
+
autoExtendRange,
|
|
140
|
+
});
|
|
141
|
+
setFromTo(inputOptions, nucleus, fromTo);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
for (const nucleus of ['1H', '13C']) {
|
|
146
|
+
if (signalsOutOfRange[nucleus]) {
|
|
147
|
+
const { from, to } = inputOptions['1d'][nucleus];
|
|
148
|
+
if (autoExtendRange) {
|
|
149
|
+
logger.info(`There are ${nucleus} signals out of the range, it was extended to ${from}-${to}.`);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
logger.warn(`There are ${nucleus} signals out of the range.`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function getNewFromTo(params) {
|
|
158
|
+
const { deltas, nucleus, autoExtendRange } = params;
|
|
159
|
+
let { from, to } = params;
|
|
160
|
+
const { min, max } = xMinMaxValues(deltas);
|
|
161
|
+
const signalsOutOfRange = from > min || to < max;
|
|
162
|
+
if (autoExtendRange && signalsOutOfRange) {
|
|
163
|
+
const spread = nucleus === '1H' ? 0.2 : 2;
|
|
164
|
+
if (from > min)
|
|
165
|
+
from = min - spread;
|
|
166
|
+
if (to < max)
|
|
167
|
+
to = max + spread;
|
|
168
|
+
}
|
|
169
|
+
return { from, to, signalsOutOfRange };
|
|
170
|
+
}
|
|
98
171
|
function generated1DSpectrum(params) {
|
|
99
|
-
const { spectrum,
|
|
100
|
-
const { signals,
|
|
101
|
-
const { name, '1d': { nbPoints }, frequency: freq, } =
|
|
172
|
+
const { spectrum, options, experiment, color } = params;
|
|
173
|
+
const { signals, joinedSignals, nucleus } = spectrum;
|
|
174
|
+
const { name, '1d': { nbPoints }, frequency: freq, } = options;
|
|
102
175
|
const SpectrumName = generateName(name, { frequency: freq, experiment });
|
|
103
176
|
const frequency = calculateFrequency(nucleus, freq);
|
|
104
177
|
const { x, y } = signalsToXY(signals, {
|
|
105
|
-
...
|
|
178
|
+
...options['1d'][nucleus],
|
|
106
179
|
frequency,
|
|
107
180
|
nbPoints,
|
|
108
181
|
});
|
|
@@ -123,7 +196,7 @@ function generated1DSpectrum(params) {
|
|
|
123
196
|
title: SpectrumName,
|
|
124
197
|
},
|
|
125
198
|
}, {});
|
|
126
|
-
datum.ranges.values = mapRanges(
|
|
199
|
+
datum.ranges.values = mapRanges(signalsToRanges(joinedSignals, { frequency: frequency }), datum);
|
|
127
200
|
updateIntegralsRelativeValues(datum);
|
|
128
201
|
return datum;
|
|
129
202
|
}
|
|
@@ -149,27 +222,27 @@ function mapZones(zones) {
|
|
|
149
222
|
});
|
|
150
223
|
}
|
|
151
224
|
function generated2DSpectrum(params) {
|
|
152
|
-
const { spectrum,
|
|
225
|
+
const { spectrum, options, experiment, color } = params;
|
|
153
226
|
const { signals, zones, nuclei } = spectrum;
|
|
154
|
-
const xOption =
|
|
155
|
-
const yOption =
|
|
227
|
+
const xOption = options['1d'][nuclei[0]];
|
|
228
|
+
const yOption = options['1d'][nuclei[1]];
|
|
156
229
|
const width = get2DWidth(nuclei);
|
|
157
|
-
const frequency = calculateFrequency(nuclei,
|
|
230
|
+
const frequency = calculateFrequency(nuclei, options.frequency);
|
|
158
231
|
const minMaxContent = signals2DToZ(signals, {
|
|
159
232
|
from: { x: xOption.from, y: yOption.from },
|
|
160
233
|
to: { x: xOption.to, y: yOption.to },
|
|
161
234
|
nbPoints: {
|
|
162
|
-
x:
|
|
163
|
-
y:
|
|
235
|
+
x: options['2d'].nbPoints.x,
|
|
236
|
+
y: options['2d'].nbPoints.y,
|
|
164
237
|
},
|
|
165
238
|
width,
|
|
166
239
|
factor: 3,
|
|
167
240
|
});
|
|
168
|
-
const SpectrumName = generateName(
|
|
241
|
+
const SpectrumName = generateName(options.name, {
|
|
169
242
|
frequency,
|
|
170
243
|
experiment,
|
|
171
244
|
});
|
|
172
|
-
const spectralWidth = getSpectralWidth(experiment,
|
|
245
|
+
const spectralWidth = getSpectralWidth(experiment, options);
|
|
173
246
|
const datum = initiateDatum2D({
|
|
174
247
|
data: { rr: { ...minMaxContent, noise: 0.01 } },
|
|
175
248
|
display: {
|
|
@@ -31,7 +31,7 @@ export function addJcamp(output, jcamp, options, usedColors) {
|
|
|
31
31
|
if (spectraIn.length === 0)
|
|
32
32
|
return;
|
|
33
33
|
const spectra = [];
|
|
34
|
-
for (
|
|
34
|
+
for (const spectrum of spectraIn) {
|
|
35
35
|
const data = getData(spectrum, usedColors);
|
|
36
36
|
if (!data)
|
|
37
37
|
continue;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { FromTo } from 'cheminfo-types';
|
|
2
|
-
export
|
|
3
|
-
[key: string]: FromTo;
|
|
4
|
-
}
|
|
2
|
+
export type DefaultPathLengthsInterface = Record<string, FromTo>;
|
|
5
3
|
declare const DefaultPathLengths: DefaultPathLengthsInterface;
|
|
6
4
|
export default DefaultPathLengths;
|
|
@@ -2,9 +2,9 @@ import { v4 } from '@lukeed/uuid';
|
|
|
2
2
|
export default function generateJGraphData(ranges, jGraphTolerance) {
|
|
3
3
|
if (!ranges && !Array.isArray(ranges))
|
|
4
4
|
return null;
|
|
5
|
-
|
|
5
|
+
const signals = [];
|
|
6
6
|
let jCouplingMax = 0;
|
|
7
|
-
|
|
7
|
+
const links = createLinks(ranges, jGraphTolerance);
|
|
8
8
|
for (const range of ranges) {
|
|
9
9
|
for (const signal of range.signals) {
|
|
10
10
|
const { id: signalId, ...restSignal } = signal;
|
|
@@ -26,7 +26,7 @@ function getJsCouplingMax(js) {
|
|
|
26
26
|
}
|
|
27
27
|
function getCouplings(ranges) {
|
|
28
28
|
const couplings = [];
|
|
29
|
-
for (
|
|
29
|
+
for (const range of ranges) {
|
|
30
30
|
for (const { delta, js } of range.signals) {
|
|
31
31
|
for (const { coupling } of js || []) {
|
|
32
32
|
couplings.push({ coupling, delta });
|
|
@@ -14,9 +14,10 @@ import { getRange } from '../../constants/References';
|
|
|
14
14
|
* @param {string} [options.reference]
|
|
15
15
|
*/
|
|
16
16
|
export function getReferenceShift(datum1D, options) {
|
|
17
|
-
|
|
17
|
+
const { reference } = options;
|
|
18
|
+
let { from, to, nbPeaks, targetX } = options;
|
|
18
19
|
if (reference) {
|
|
19
|
-
|
|
20
|
+
const data = getRange({ reference, nucleus: datum1D.nucleus });
|
|
20
21
|
from = data.from;
|
|
21
22
|
to = data.to;
|
|
22
23
|
nbPeaks = data.nbPeaks;
|
|
@@ -36,7 +37,7 @@ function xyCalibrate(data, range = {}, options = {}) {
|
|
|
36
37
|
polynomial: 3,
|
|
37
38
|
},
|
|
38
39
|
}, } = options;
|
|
39
|
-
|
|
40
|
+
const { from, to } = range;
|
|
40
41
|
if (from === undefined || to === undefined)
|
|
41
42
|
return 0;
|
|
42
43
|
const fromIndex = xFindClosestIndex(data.x, from);
|
|
@@ -45,7 +46,7 @@ function xyCalibrate(data, range = {}, options = {}) {
|
|
|
45
46
|
x: data.x.slice(fromIndex, toIndex),
|
|
46
47
|
y: data.y.slice(fromIndex, toIndex),
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
const peaks = gsd(sliceddata, gsdOptions)
|
|
49
50
|
.sort((a, b) => b.y - a.y)
|
|
50
51
|
.slice(0, nbPeaks);
|
|
51
52
|
if (peaks.length === 0)
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export function changeIntegralsRelative(spectrum,
|
|
2
|
-
const
|
|
1
|
+
export function changeIntegralsRelative(spectrum, data) {
|
|
2
|
+
const { id, value } = data;
|
|
3
|
+
const index = spectrum.integrals.values.findIndex((integral) => integral.id === id);
|
|
3
4
|
if (index !== -1) {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
5
|
+
const { absolute } = spectrum.integrals.values[index];
|
|
6
|
+
const ratio = absolute / value;
|
|
7
|
+
let sum = 0;
|
|
8
|
+
const integrals = [];
|
|
9
|
+
for (const integralRecord of spectrum.integrals.values) {
|
|
10
|
+
const integral = integralRecord.absolute / ratio;
|
|
11
|
+
sum += integral;
|
|
12
|
+
integrals.push({ ...integralRecord, integral });
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
spectrum.integrals.values = values;
|
|
14
|
+
spectrum.integrals.values = integrals;
|
|
16
15
|
spectrum.integrals.options = {
|
|
17
16
|
...spectrum.integrals.options,
|
|
18
17
|
mf: undefined,
|
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
export function changeRangeRelativeValue(spectrum, data) {
|
|
7
7
|
const { id, value } = data;
|
|
8
8
|
const index = spectrum.ranges.values.findIndex((range) => range.id === id);
|
|
9
|
-
if (index !== -1
|
|
10
|
-
const { absolute
|
|
9
|
+
if (index !== -1) {
|
|
10
|
+
const { absolute } = spectrum.ranges.values[index];
|
|
11
11
|
const ratio = absolute / value;
|
|
12
|
-
const
|
|
12
|
+
const ranges = [];
|
|
13
|
+
let sum = 0;
|
|
14
|
+
for (const range of spectrum.ranges.values) {
|
|
15
|
+
const integration = range.absolute / ratio;
|
|
16
|
+
sum += integration;
|
|
17
|
+
ranges.push({ ...range, integration });
|
|
18
|
+
}
|
|
13
19
|
spectrum.ranges.options = {
|
|
14
20
|
...spectrum.ranges.options,
|
|
15
21
|
mf: undefined,
|
|
@@ -17,11 +23,6 @@ export function changeRangeRelativeValue(spectrum, data) {
|
|
|
17
23
|
sumAuto: false,
|
|
18
24
|
sum,
|
|
19
25
|
};
|
|
20
|
-
spectrum.ranges.values =
|
|
21
|
-
return {
|
|
22
|
-
...range,
|
|
23
|
-
integration: range.absolute / ratio,
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
+
spectrum.ranges.values = ranges;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -16,14 +16,14 @@ export interface DataBaseBasic {
|
|
|
16
16
|
export interface DataBaseRange {
|
|
17
17
|
from: number;
|
|
18
18
|
to: number;
|
|
19
|
-
signals:
|
|
19
|
+
signals: DataBaseSignal[];
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export interface LocalDatabase {
|
|
22
22
|
key: string;
|
|
23
23
|
label: string;
|
|
24
24
|
url?: string;
|
|
25
|
-
value?:
|
|
26
|
-
}
|
|
25
|
+
value?: DatabaseNMREntry[];
|
|
26
|
+
}
|
|
27
27
|
export declare const DATA_BASES: LocalDatabase[];
|
|
28
28
|
interface Coupling {
|
|
29
29
|
multiplicity: string;
|
|
@@ -37,5 +37,5 @@ export interface InitiateDatabaseResult {
|
|
|
37
37
|
searchByStructure: (idCode: string) => DatabaseNMREntry[];
|
|
38
38
|
}
|
|
39
39
|
export declare function initiateDatabase(databases: DatabaseNMREntry[], nucleus: string): InitiateDatabaseResult;
|
|
40
|
-
export declare function prepareData(data:
|
|
40
|
+
export declare function prepareData(data: DatabaseNMREntry[]): PrepareDataResult[];
|
|
41
41
|
export {};
|
|
@@ -43,8 +43,8 @@ function prepareGetSolvents(data) {
|
|
|
43
43
|
// });
|
|
44
44
|
// }
|
|
45
45
|
function prepareMoleculesDB(array) {
|
|
46
|
-
|
|
47
|
-
for (
|
|
46
|
+
const moleculesDB = new MoleculesDB(OCL);
|
|
47
|
+
for (const entry of array) {
|
|
48
48
|
if (entry.ocl) {
|
|
49
49
|
try {
|
|
50
50
|
const molecule = OCL.Molecule.fromIDCode(entry.ocl.idCode, entry.ocl.coordinates);
|
|
@@ -84,7 +84,7 @@ export function prepareData(data) {
|
|
|
84
84
|
const result = [];
|
|
85
85
|
let index = 0;
|
|
86
86
|
for (const item of data) {
|
|
87
|
-
|
|
87
|
+
const ids = [];
|
|
88
88
|
const { ranges, ...restItemKeys } = item;
|
|
89
89
|
if (!ranges) {
|
|
90
90
|
ids.push(v4());
|
|
@@ -18,7 +18,7 @@ export type SpectraAnalysis = Record<string /** where the key is the nucleus*/,
|
|
|
18
18
|
export declare function getColumns(spectraAnalysis: PanelsPreferences['multipleSpectraAnalysis'], nucleus: string): any;
|
|
19
19
|
export declare function getValue(colKey: string, columns: SpectraAnalysisColumns, data: any): any;
|
|
20
20
|
export declare function getSpectraAnalysis(spectra: Spectrum[], options: any): {
|
|
21
|
-
values:
|
|
21
|
+
values: AnalysisRow[];
|
|
22
22
|
sum: number;
|
|
23
23
|
};
|
|
24
24
|
export declare function mapColumns(options: MultipleSpectraAnalysisPreferences['analysisOptions']): {
|
|
@@ -75,7 +75,7 @@ export function analyzeSpectra(spectraAnalysis, options) {
|
|
|
75
75
|
}, columnKey);
|
|
76
76
|
}
|
|
77
77
|
export function generateAnalyzeSpectra(multipleSpectraAnalysis, spectra, nucleus) {
|
|
78
|
-
|
|
78
|
+
const data = {};
|
|
79
79
|
const { sum, columns, code } = multipleSpectraAnalysis.analysisOptions;
|
|
80
80
|
for (const columnKey in columns) {
|
|
81
81
|
const { from, to } = columns[columnKey];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SpinSystemData = Array<Array<number | null>>;
|
|
2
|
+
export interface SpectrumSimulationOptions {
|
|
3
|
+
data: SpinSystemData;
|
|
4
|
+
options: {
|
|
5
|
+
frequency: number;
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
nbPoints: number;
|
|
9
|
+
lineWidth: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultSimulationOptions: SpectrumSimulationOptions;
|
|
13
|
+
export declare function getSpinSystems(): string[];
|
|
14
|
+
export declare function simulateSpectrum(spinSystem: string, options: SpectrumSimulationOptions): import("cheminfo-types").DataXY<import("cheminfo-types").DoubleArray>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { simulate1D } from 'nmr-processing';
|
|
2
|
+
export const defaultSimulationOptions = {
|
|
3
|
+
data: [],
|
|
4
|
+
options: {
|
|
5
|
+
frequency: 200,
|
|
6
|
+
from: -1,
|
|
7
|
+
to: 12,
|
|
8
|
+
nbPoints: 2 ** 16,
|
|
9
|
+
lineWidth: 1,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export function getSpinSystems() {
|
|
13
|
+
const spinSystem = [];
|
|
14
|
+
let temp = 'A';
|
|
15
|
+
for (let i = 66; i <= 72; i++) {
|
|
16
|
+
temp += String.fromCodePoint(i);
|
|
17
|
+
spinSystem.push(temp);
|
|
18
|
+
}
|
|
19
|
+
return spinSystem;
|
|
20
|
+
}
|
|
21
|
+
export function simulateSpectrum(spinSystem, options) {
|
|
22
|
+
const spinsLength = spinSystem.length;
|
|
23
|
+
const chemicalShifts = new Array(spinsLength);
|
|
24
|
+
const multiplicity = new Array(spinsLength);
|
|
25
|
+
const { data: spinsData, options: simulateOptions } = options;
|
|
26
|
+
for (let i = 0; i < spinsLength; i++) {
|
|
27
|
+
chemicalShifts[i] = spinsData[i][0];
|
|
28
|
+
multiplicity[i] = 2;
|
|
29
|
+
}
|
|
30
|
+
const chemicalShiftsLength = chemicalShifts.length;
|
|
31
|
+
const couplingConstants = new Array(chemicalShiftsLength);
|
|
32
|
+
for (let i = 0; i < chemicalShiftsLength; i++) {
|
|
33
|
+
couplingConstants[i] = new Array(chemicalShiftsLength);
|
|
34
|
+
for (let j = 0; j < chemicalShiftsLength; j++) {
|
|
35
|
+
couplingConstants[i][j] = 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (let i = 0; i < spinsData.length; i++) {
|
|
39
|
+
for (let j = 1; j < chemicalShiftsLength; j++) {
|
|
40
|
+
const couplingVal = spinsData[i][j];
|
|
41
|
+
const jIndex = j - 1;
|
|
42
|
+
if (couplingVal !== null) {
|
|
43
|
+
couplingConstants[i][jIndex] = couplingVal;
|
|
44
|
+
couplingConstants[jIndex][i] = couplingVal;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return simulate1D({
|
|
49
|
+
chemicalShifts,
|
|
50
|
+
couplingConstants,
|
|
51
|
+
levels: multiplicity,
|
|
52
|
+
}, simulateOptions);
|
|
53
|
+
}
|
|
@@ -11,9 +11,7 @@ interface ContourOptions {
|
|
|
11
11
|
positive: ContourItem;
|
|
12
12
|
negative: ContourItem;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
[key: string]: Level;
|
|
16
|
-
}
|
|
14
|
+
type ContoursLevels = Record<string, Level>;
|
|
17
15
|
declare const DEFAULT_CONTOURS_OPTIONS: {
|
|
18
16
|
positive: {
|
|
19
17
|
contourLevels: number[];
|
|
@@ -32,6 +30,12 @@ interface ReturnContoursManager {
|
|
|
32
30
|
}
|
|
33
31
|
declare function getDefaultContoursLevel(options: ContourOptions): Level;
|
|
34
32
|
declare function contoursManager(spectrumID: string, state: ContoursLevels, options: ContourOptions): ReturnContoursManager;
|
|
35
|
-
declare function drawContours(level: number, spectrum: Spectrum2D, negative?: boolean, quadrant?: string): import("ml-conrec").DrawContourResult<"basic"
|
|
33
|
+
declare function drawContours(level: number, spectrum: Spectrum2D, negative?: boolean, quadrant?: string): import("ml-conrec").DrawContourResult<"basic"> | {
|
|
34
|
+
contours: {
|
|
35
|
+
zValue: any;
|
|
36
|
+
lines: never[];
|
|
37
|
+
}[];
|
|
38
|
+
timeout: boolean;
|
|
39
|
+
};
|
|
36
40
|
export { drawContours, contoursManager, getDefaultContoursLevel, DEFAULT_CONTOURS_OPTIONS, };
|
|
37
41
|
export type { ContoursLevels, ReturnContoursManager, Level, LevelSign };
|
|
@@ -33,7 +33,7 @@ function contoursManager(spectrumID, state, options) {
|
|
|
33
33
|
return { wheel, getLevel, checkLevel };
|
|
34
34
|
}
|
|
35
35
|
function prepareWheel(value, options) {
|
|
36
|
-
|
|
36
|
+
const { shiftKey, currentLevel, contourOptions } = options;
|
|
37
37
|
const sign = Math.sign(value);
|
|
38
38
|
const positiveBoundary = contourOptions.positive.contourLevels;
|
|
39
39
|
const negativeBoundary = contourOptions.negative.contourLevels;
|
|
@@ -123,6 +123,12 @@ function getContours(zoomLevel, options) {
|
|
|
123
123
|
if (negative) {
|
|
124
124
|
_range = _range.map((value) => -value);
|
|
125
125
|
}
|
|
126
|
+
if (_range.every((r) => r === 0)) {
|
|
127
|
+
return {
|
|
128
|
+
contours: _range.map((r) => ({ zValue: r, lines: [] })),
|
|
129
|
+
timeout: false,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
126
132
|
return conrec.drawContour({
|
|
127
133
|
contourDrawer: 'basic',
|
|
128
134
|
levels: _range,
|