nmrium 0.34.0 → 0.35.0-pre.1683280699
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/LinesSeries.js +4 -5
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +5 -7
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +142 -160
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +4 -4
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +11 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +11 -0
- package/lib/component/1d/ranges/Range.d.ts +3 -10
- package/lib/component/1d/ranges/Range.js +32 -45
- package/lib/component/1d/ranges/Ranges.js +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -2
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +2 -2
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +2 -2
- package/lib/component/2d/Chart2D.d.ts +2 -2
- package/lib/component/2d/ft/Contours.js +13 -13
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib/component/2d/zones/Zone.d.ts +2 -2
- package/lib/component/NMRium.d.ts +2 -5
- package/lib/component/NMRium.js +10 -2
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -2
- package/lib/component/assignment/actions/removeAssignment.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +10 -21
- package/lib/component/context/PreferencesContext.js +4 -7
- package/lib/component/elements/Button.d.ts +4 -2
- package/lib/component/elements/Button.js +26 -15
- package/lib/component/elements/Input.js +38 -46
- package/lib/component/elements/NumberInput.d.ts +4 -12
- package/lib/component/elements/NumberInput.js +10 -40
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -4
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +7 -6
- package/lib/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib/component/elements/ReactTable/Style.js +0 -8
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib/component/header/ApodizationOptionsPanel.js +2 -12
- package/lib/component/header/AutoPeakPickingOptionPanel.js +11 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -12
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/PhaseCorrectionPanel.d.ts +2 -0
- package/lib/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +23 -22
- package/lib/component/header/RangesPickingOptionPanel.js +17 -28
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -2
- package/lib/component/header/Zones2DOptionPanel.js +16 -23
- package/lib/component/highlight/index.d.ts +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +2 -3
- package/lib/component/hooks/useFilter.d.ts +1 -1
- package/lib/component/hooks/useSpectraPerNucleus.d.ts +2 -3
- package/lib/component/hooks/useSpectrum.d.ts +2 -3
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/ExportAsJcampModal.d.ts +8 -0
- package/lib/component/modal/ExportAsJcampModal.js +62 -0
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +2 -3
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/PanelNoData.d.ts +6 -0
- package/lib/component/panels/PanelNoData.js +24 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +4 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -4
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +6 -5
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +37 -33
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +8 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +65 -17
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +2 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -13
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +77 -7
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +17 -9
- package/lib/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +0 -1
- package/lib/component/reducer/Reducer.d.ts +4 -960
- package/lib/component/reducer/Reducer.js +3 -7
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +5 -6
- package/lib/component/reducer/actions/DomainActions.js +17 -11
- package/lib/component/reducer/actions/FiltersActions.d.ts +14 -19
- package/lib/component/reducer/actions/FiltersActions.js +257 -152
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -3
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +6 -2
- package/lib/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +19 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +15 -13
- package/lib/component/reducer/actions/ToolsActions.d.ts +6 -2
- package/lib/component/reducer/actions/ToolsActions.js +41 -38
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +7 -3
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -4843
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib/component/reducer/types/Types.d.ts +0 -2
- package/lib/component/reducer/types/Types.js +0 -2
- package/lib/component/toolbar/BasicToolBar.js +3 -3
- package/lib/component/toolbar/FunctionToolBar.js +2 -2
- package/lib/component/toolbar/ToolTypes.d.ts +1 -2
- package/lib/component/toolbar/ToolTypes.js +13 -13
- package/lib/component/utility/getSpectraByNucleus.d.ts +2 -3
- package/lib/component/utility/getSpectraObjectPaths.d.ts +2 -3
- package/lib/component/workspaces/Workspace.d.ts +1 -0
- package/lib/component/workspaces/assignment.js +1 -1
- package/lib/component/workspaces/basic.js +1 -1
- package/lib/component/workspaces/embedded.js +1 -1
- package/lib/component/workspaces/exercise.js +1 -1
- package/lib/component/workspaces/prediction.js +1 -1
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +0 -4
- package/lib/data/Filters.js +0 -4
- package/lib/data/FiltersManager.d.ts +17 -5
- package/lib/data/FiltersManager.js +21 -14
- package/lib/data/PredictionManager.d.ts +2 -3
- package/lib/data/SpectraManager.d.ts +11 -0
- package/lib/data/SpectraManager.js +47 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +3 -4
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +10 -0
- package/lib/data/data1d/Spectrum1D/isSpectrum1D.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +8 -9
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +10 -9
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib/data/data1d/filter1d/apodization.d.ts +8 -6
- package/lib/data/data1d/filter1d/apodization.js +4 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +6 -4
- package/lib/data/data1d/filter1d/baselineCorrection.js +4 -0
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +7 -6
- package/lib/data/data1d/filter1d/digitalFilter.js +15 -11
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +5 -5
- package/lib/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +7 -5
- package/lib/data/data1d/filter1d/exclusionZones.js +13 -9
- package/lib/data/data1d/filter1d/fft.d.ts +6 -4
- package/lib/data/data1d/filter1d/fft.js +27 -23
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +6 -5
- package/lib/data/data1d/filter1d/phaseCorrection.js +22 -17
- package/lib/data/data1d/filter1d/shiftX.d.ts +5 -3
- package/lib/data/data1d/filter1d/shiftX.js +7 -3
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +7 -5
- package/lib/data/data1d/filter1d/signalProcessing.js +15 -11
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +7 -6
- package/lib/data/data1d/filter1d/zeroFilling.js +15 -11
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +4 -5
- package/lib/data/data2d/Spectrum2D/contours.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/getShift.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +4 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +4 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib/data/data2d/Spectrum2D/zones/updateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib/data/data2d/filter2d/shiftX.d.ts +6 -4
- package/lib/data/data2d/filter2d/shiftX.js +10 -6
- package/lib/data/data2d/filter2d/shiftY.d.ts +5 -3
- package/lib/data/data2d/filter2d/shiftY.js +5 -1
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +2 -2
- package/lib/data/parseMeta/linkMetaWithSpectra.d.ts +2 -3
- package/lib/data/types/common/Info.d.ts +1 -0
- package/lib/data/types/data1d/ComplexData1D.d.ts +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/types/data1d/index.d.ts +0 -11
- package/lib/data/types/data2d/index.d.ts +0 -7
- package/lib/data/utilities/FindUtilities.d.ts +7 -9
- package/lib/data/utilities/RangeUtilities.d.ts +7 -2
- package/lib/data/utilities/RangeUtilities.js +9 -16
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.js +6 -6
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -3
- package/lib/data/utilities/convertSpectraListToObject.d.ts +2 -3
- package/lib/data/utilities/generateColor.d.ts +1 -1
- package/lib/types/NMRiumDataReturn.d.ts +2 -3
- package/lib/types/NMRiumToolBarPreferences.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +4 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +144 -160
- package/lib-cjs/component/1d/ranges/AssignmentActionsButtons.js +18 -0
- package/lib-cjs/component/1d/ranges/Range.js +31 -44
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +13 -13
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib-cjs/component/NMRium.js +10 -2
- package/lib-cjs/component/assignment/actions/removeAssignment.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +4 -7
- package/lib-cjs/component/elements/Button.js +26 -15
- package/lib-cjs/component/elements/Input.js +37 -45
- package/lib-cjs/component/elements/NumberInput.js +8 -38
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib-cjs/component/elements/ReactTable/Style.js +0 -8
- package/lib-cjs/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +1 -11
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +33 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +1 -11
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +24 -23
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +38 -26
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +0 -1
- package/lib-cjs/component/header/Zones2DOptionPanel.js +37 -21
- package/lib-cjs/component/modal/ExportAsJcampModal.js +67 -0
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/PanelNoData.js +28 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +15 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +36 -32
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +12 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +63 -15
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -12
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +76 -6
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +15 -7
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
- package/lib-cjs/component/reducer/Reducer.js +3 -7
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +17 -11
- package/lib-cjs/component/reducer/actions/FiltersActions.js +257 -153
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/PeaksActions.js +6 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib-cjs/component/reducer/actions/RangesActions.js +19 -11
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +13 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +38 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +7 -3
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib-cjs/component/reducer/types/Types.js +2 -4
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -3
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +13 -13
- package/lib-cjs/component/workspaces/assignment.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +1 -1
- package/lib-cjs/component/workspaces/embedded.js +1 -1
- package/lib-cjs/component/workspaces/exercise.js +1 -1
- package/lib-cjs/component/workspaces/prediction.js +1 -1
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +1 -5
- package/lib-cjs/data/FiltersManager.js +22 -14
- package/lib-cjs/data/SpectraManager.js +48 -5
- package/lib-cjs/data/data1d/Spectrum1D/get1DDataXY.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/isRangeAssigned.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/filter1d/apodization.js +5 -1
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +5 -1
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +16 -12
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +14 -10
- package/lib-cjs/data/data1d/filter1d/fft.js +27 -23
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +23 -18
- package/lib-cjs/data/data1d/filter1d/shiftX.js +8 -4
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +16 -12
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +16 -12
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib-cjs/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib-cjs/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib-cjs/data/data2d/filter2d/shiftX.js +11 -7
- package/lib-cjs/data/data2d/filter2d/shiftY.js +6 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +2 -2
- package/lib-cjs/data/utilities/RangeUtilities.js +9 -16
- package/lib-cjs/data/utilities/ZoneUtilities.js +6 -6
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +37 -36
- package/lib/component/header/ManualPhaseCorrectionPanel.d.ts +0 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +0 -13
- package/lib/data/data1d/filter1d/centerMean.js +0 -37
- package/lib/data/data1d/filter1d/fromTo.d.ts +0 -13
- package/lib/data/data1d/filter1d/fromTo.js +0 -31
- package/lib/data/data1d/filter1d/pareto.d.ts +0 -13
- package/lib/data/data1d/filter1d/pareto.js +0 -29
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +0 -13
- package/lib/data/data1d/filter1d/standardDeviation.js +0 -37
- package/lib/data/types/data1d/Data1D.d.ts +0 -5
- package/lib/data/types/data1d/Data1D.js +0 -1
- package/lib/data/types/data1d/Datum1D.d.ts +0 -23
- package/lib/data/types/data1d/Datum1D.js +0 -1
- package/lib/data/types/data1d/Display1D.d.ts +0 -5
- package/lib/data/types/data1d/Display1D.js +0 -1
- package/lib/data/types/data1d/Info1D.d.ts +0 -8
- package/lib/data/types/data1d/Info1D.js +0 -1
- package/lib/data/types/data1d/Integral.d.ts +0 -10
- package/lib/data/types/data1d/Integral.js +0 -1
- package/lib/data/types/data1d/Integrals.d.ts +0 -6
- package/lib/data/types/data1d/Integrals.js +0 -1
- package/lib/data/types/data1d/Peak.d.ts +0 -5
- package/lib/data/types/data1d/Peak.js +0 -1
- package/lib/data/types/data1d/Peaks.d.ts +0 -5
- package/lib/data/types/data1d/Peaks.js +0 -1
- package/lib/data/types/data1d/Range.d.ts +0 -11
- package/lib/data/types/data1d/Range.js +0 -1
- package/lib/data/types/data1d/Ranges.d.ts +0 -6
- package/lib/data/types/data1d/Ranges.js +0 -1
- package/lib/data/types/data1d/Signal1D.d.ts +0 -5
- package/lib/data/types/data1d/Signal1D.js +0 -1
- package/lib/data/types/data1d/SumOptions.d.ts +0 -7
- package/lib/data/types/data1d/SumOptions.js +0 -1
- package/lib/data/types/data2d/Data2D.d.ts +0 -20
- package/lib/data/types/data2d/Data2D.js +0 -1
- package/lib/data/types/data2d/Datum2D.d.ts +0 -19
- package/lib/data/types/data2d/Datum2D.js +0 -1
- package/lib/data/types/data2d/Display2D.d.ts +0 -11
- package/lib/data/types/data2d/Display2D.js +0 -1
- package/lib/data/types/data2d/Info2D.d.ts +0 -5
- package/lib/data/types/data2d/Info2D.js +0 -1
- package/lib/data/types/data2d/Signal2D.d.ts +0 -7
- package/lib/data/types/data2d/Signal2D.js +0 -1
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +0 -4
- package/lib/data/types/data2d/Signal2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zone.d.ts +0 -9
- package/lib/data/types/data2d/Zone.js +0 -1
- package/lib/data/types/data2d/Zone2DAxisData.d.ts +0 -6
- package/lib/data/types/data2d/Zone2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zones.d.ts +0 -7
- package/lib/data/types/data2d/Zones.js +0 -1
- package/lib-cjs/data/data1d/filter1d/centerMean.js +0 -43
- package/lib-cjs/data/data1d/filter1d/fromTo.js +0 -37
- package/lib-cjs/data/data1d/filter1d/pareto.js +0 -35
- package/lib-cjs/data/data1d/filter1d/standardDeviation.js +0 -43
- package/lib-cjs/data/types/data1d/Data1D.js +0 -2
- package/lib-cjs/data/types/data1d/Datum1D.js +0 -2
- package/lib-cjs/data/types/data1d/Display1D.js +0 -2
- package/lib-cjs/data/types/data1d/Info1D.js +0 -2
- package/lib-cjs/data/types/data1d/Integral.js +0 -2
- package/lib-cjs/data/types/data1d/Integrals.js +0 -2
- package/lib-cjs/data/types/data1d/Peak.js +0 -2
- package/lib-cjs/data/types/data1d/Peaks.js +0 -2
- package/lib-cjs/data/types/data1d/Range.js +0 -2
- package/lib-cjs/data/types/data1d/Ranges.js +0 -2
- package/lib-cjs/data/types/data1d/Signal1D.js +0 -2
- package/lib-cjs/data/types/data1d/SumOptions.js +0 -2
- package/lib-cjs/data/types/data2d/Data2D.js +0 -2
- package/lib-cjs/data/types/data2d/Datum2D.js +0 -2
- package/lib-cjs/data/types/data2d/Display2D.js +0 -2
- package/lib-cjs/data/types/data2d/Info2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zone.js +0 -2
- package/lib-cjs/data/types/data2d/Zone2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zones.js +0 -2
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.deleteFilter = exports.addFilter = exports.enableFilter = exports.reapplyFilters = exports.applyFilter = void 0;
|
|
26
|
+
exports.lookupForFilter = exports.deleteFilter = exports.addFilter = exports.enableFilter = exports.reapplyFilters = exports.applyFilter = void 0;
|
|
27
27
|
/* eslint-disable import/namespace */
|
|
28
28
|
const uuid_1 = require("@lukeed/uuid");
|
|
29
29
|
const Filters = __importStar(require("./Filters"));
|
|
@@ -51,7 +51,8 @@ function updateData(datum) {
|
|
|
51
51
|
(0, updateZones_1.updateZones)(datum);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function applyFilter(datum, filters = [],
|
|
54
|
+
function applyFilter(datum, filters = [], options = {}) {
|
|
55
|
+
const { forceReapply = false, filterIndex } = options;
|
|
55
56
|
let isReduced = false;
|
|
56
57
|
for (let filter of filters) {
|
|
57
58
|
const filterOption = {
|
|
@@ -60,6 +61,7 @@ function applyFilter(datum, filters = [], forceReapply = false) {
|
|
|
60
61
|
value: filter.value,
|
|
61
62
|
};
|
|
62
63
|
const previousFilter = lookupForFilter(datum, filter.name);
|
|
64
|
+
const isDeleteAllow = 'isDeleteAllow' in filter ? filter.isDeleteAllow : true;
|
|
63
65
|
if (previousFilter) {
|
|
64
66
|
// eslint-disable-next-line unicorn/no-array-reduce
|
|
65
67
|
const reduceResult = Filters[filter.name].reduce(previousFilter.value, filterOption.value);
|
|
@@ -72,15 +74,11 @@ function applyFilter(datum, filters = [], forceReapply = false) {
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
else {
|
|
75
|
-
addFilter(datum, filterOption,
|
|
76
|
-
? filter.isDeleteAllow
|
|
77
|
-
: true);
|
|
77
|
+
addFilter(datum, filterOption, { isDeleteAllow, filterIndex });
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
addFilter(datum, filterOption,
|
|
82
|
-
? filter.isDeleteAllow
|
|
83
|
-
: true);
|
|
81
|
+
addFilter(datum, filterOption, { isDeleteAllow, filterIndex });
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
if (forceReapply) {
|
|
@@ -112,6 +110,7 @@ function isLastFilter(datum, id) {
|
|
|
112
110
|
function lookupForFilter(datum, filterName) {
|
|
113
111
|
return datum.filters.find((f) => f.name === filterName);
|
|
114
112
|
}
|
|
113
|
+
exports.lookupForFilter = lookupForFilter;
|
|
115
114
|
function reapplyFilters(datum, filters = null) {
|
|
116
115
|
const _filters = filters || datum.filters;
|
|
117
116
|
enableFilter(datum, null, null, _filters);
|
|
@@ -175,16 +174,25 @@ function deleteFilter(datum, id) {
|
|
|
175
174
|
updateData(datum);
|
|
176
175
|
}
|
|
177
176
|
exports.deleteFilter = deleteFilter;
|
|
178
|
-
function addFilter(datum,
|
|
177
|
+
function addFilter(datum, filterOptions, options = {}) {
|
|
178
|
+
const { filterIndex, isDeleteAllow = true } = options;
|
|
179
179
|
const id = (0, uuid_1.v4)();
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
datum.filters.push({
|
|
183
|
-
...filter,
|
|
180
|
+
const filter = {
|
|
181
|
+
...filterOptions,
|
|
184
182
|
id,
|
|
185
183
|
flag: true,
|
|
186
184
|
isDeleteAllow,
|
|
187
|
-
}
|
|
185
|
+
};
|
|
186
|
+
if (typeof filterIndex === 'number' && filterIndex !== -1) {
|
|
187
|
+
datum.filters = [
|
|
188
|
+
...datum.filters.slice(0, filterIndex + 1),
|
|
189
|
+
filter,
|
|
190
|
+
...datum.filters.slice(filterIndex + 1),
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
datum.filters.push(filter);
|
|
195
|
+
}
|
|
188
196
|
}
|
|
189
197
|
exports.addFilter = addFilter;
|
|
190
198
|
function replaceFilter(datum, filterID, value) {
|
|
@@ -23,10 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.toJSON = exports.addJcamp = exports.DataExportOptions = void 0;
|
|
26
|
+
exports.exportAsJcamp = exports.DataExportStage = exports.toJSON = exports.addJcamp = exports.DataExportOptions = void 0;
|
|
27
|
+
const file_saver_1 = require("file-saver");
|
|
27
28
|
const nmr_load_save_1 = require("nmr-load-save");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
29
|
+
const Spectrum1D_1 = require("./data1d/Spectrum1D");
|
|
30
|
+
const Spectrum2D_1 = require("./data2d/Spectrum2D");
|
|
30
31
|
const Molecule = __importStar(require("./molecules/Molecule"));
|
|
31
32
|
var DataExportOptions;
|
|
32
33
|
(function (DataExportOptions) {
|
|
@@ -37,10 +38,10 @@ var DataExportOptions;
|
|
|
37
38
|
function getData(datum, usedColors) {
|
|
38
39
|
const dimension = datum.info.dimension;
|
|
39
40
|
if (dimension === 1) {
|
|
40
|
-
return
|
|
41
|
+
return (0, Spectrum1D_1.initiateDatum1D)(datum, { usedColors });
|
|
41
42
|
}
|
|
42
43
|
else if (dimension === 2) {
|
|
43
|
-
return
|
|
44
|
+
return (0, Spectrum2D_1.initiateDatum2D)(datum, { usedColors });
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
function addJcamp(output, jcamp, options, usedColors) {
|
|
@@ -102,3 +103,45 @@ function toJSON(state, preferencesState, options = {}) {
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
exports.toJSON = toJSON;
|
|
106
|
+
exports.DataExportStage = {
|
|
107
|
+
Original: 'ORIGINAL',
|
|
108
|
+
Processed: 'PROCESSED',
|
|
109
|
+
};
|
|
110
|
+
function exportAsJcamp(spectrum, options = {}) {
|
|
111
|
+
let jcamp = null;
|
|
112
|
+
if ((0, Spectrum1D_1.isSpectrum1D)(spectrum)) {
|
|
113
|
+
const { dataExportStage = 'PROCESSED', onlyReal } = options;
|
|
114
|
+
const { originalData, originalInfo, data, info, filters } = spectrum;
|
|
115
|
+
if (onlyReal && info.isFid) {
|
|
116
|
+
throw new Error('FID data should be complex');
|
|
117
|
+
}
|
|
118
|
+
if (!originalData || !originalInfo) {
|
|
119
|
+
throw new Error('original data should exists');
|
|
120
|
+
}
|
|
121
|
+
if (dataExportStage === 'PROCESSED') {
|
|
122
|
+
jcamp = (0, nmr_load_save_1.spectrum1DToJcamp)({
|
|
123
|
+
...spectrum,
|
|
124
|
+
data,
|
|
125
|
+
info,
|
|
126
|
+
filters,
|
|
127
|
+
}, { onlyReal });
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
jcamp = (0, nmr_load_save_1.spectrum1DToJcamp)({
|
|
131
|
+
...spectrum,
|
|
132
|
+
data: originalData,
|
|
133
|
+
info: originalInfo,
|
|
134
|
+
filters: [],
|
|
135
|
+
}, { onlyReal });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
throw new Error('convert 2D spectrum to JCAMP is not supported');
|
|
140
|
+
}
|
|
141
|
+
if (!jcamp) {
|
|
142
|
+
throw new Error('convert spectrum to JCAMP failed');
|
|
143
|
+
}
|
|
144
|
+
const blob = new Blob([jcamp], { type: 'text/plain' });
|
|
145
|
+
(0, file_saver_1.saveAs)(blob, `${spectrum.info.name}.jdx`);
|
|
146
|
+
}
|
|
147
|
+
exports.exportAsJcamp = exportAsJcamp;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get1DDataXY = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @typedef {Object} datum
|
|
6
4
|
* @property {number[]} x - The X points series
|
|
7
5
|
* @property {number[]} y - The Y points series
|
|
8
6
|
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.get1DDataXY = void 0;
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* @param spectrum 1d spectrum
|
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.getShiftX = void 0;
|
|
27
27
|
const FiltersTypes = __importStar(require("../../Filters"));
|
|
28
|
-
function getShiftX(
|
|
29
|
-
const filter =
|
|
30
|
-
|
|
28
|
+
function getShiftX(spectrum) {
|
|
29
|
+
const filter = spectrum?.filters &&
|
|
30
|
+
spectrum?.filters.find((filter) => filter.name === FiltersTypes.shiftX.id);
|
|
31
31
|
return filter?.flag ? filter.value.shift : 0;
|
|
32
32
|
}
|
|
33
33
|
exports.getShiftX = getShiftX;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSpectrumErrorValue = void 0;
|
|
4
|
-
function getSpectrumErrorValue(
|
|
5
|
-
const { x } =
|
|
4
|
+
function getSpectrumErrorValue(spectrum) {
|
|
5
|
+
const { x } = spectrum.data;
|
|
6
6
|
return (x[x.length - 1] - x[0]) / 10000;
|
|
7
7
|
}
|
|
8
8
|
exports.getSpectrumErrorValue = getSpectrumErrorValue;
|
|
@@ -34,38 +34,37 @@ const initiatePeaks_1 = require("./peaks/initiatePeaks");
|
|
|
34
34
|
const initiateRanges_1 = require("./ranges/initiateRanges");
|
|
35
35
|
function initiateDatum1D(spectrum, options = {}) {
|
|
36
36
|
const { usedColors = {}, filters = [] } = options;
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
datum.display = {
|
|
37
|
+
const spectrumObj = {};
|
|
38
|
+
spectrumObj.id = spectrum.id || (0, uuid_1.v4)();
|
|
39
|
+
spectrumObj.display = {
|
|
41
40
|
isVisible: true,
|
|
42
41
|
isRealSpectrumVisible: true,
|
|
43
42
|
...spectrum.display,
|
|
44
43
|
...(0, get1DColor_1.get1DColor)(spectrum, usedColors),
|
|
45
44
|
};
|
|
46
|
-
|
|
45
|
+
spectrumObj.info = {
|
|
47
46
|
nucleus: '1H',
|
|
48
47
|
isFid: false,
|
|
49
48
|
isComplex: false,
|
|
50
49
|
dimension: 1,
|
|
51
50
|
...spectrum.info,
|
|
52
51
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
spectrumObj.originalInfo = spectrumObj.info;
|
|
53
|
+
spectrumObj.meta = { ...spectrum.meta };
|
|
54
|
+
spectrumObj.metaInfo = { ...spectrum.metaInfo };
|
|
55
|
+
spectrumObj.data = (0, convertDataToFloat64Array_1.convertDataToFloat64Array)(spectrum.data);
|
|
56
|
+
spectrumObj.originalData = spectrumObj.data;
|
|
57
|
+
spectrumObj.filters = Object.assign([], spectrum.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
58
|
+
spectrumObj.peaks = (0, initiatePeaks_1.initiatePeaks)(spectrum, spectrumObj);
|
|
60
59
|
// array of object {index: xIndex, xShift}
|
|
61
60
|
// in case the peak does not exactly correspond to the point value
|
|
62
61
|
// we can think about a second attributed `xShift`
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
spectrumObj.integrals = (0, initiateIntegrals_1.initiateIntegrals)(spectrum, spectrumObj); // array of object (from: xIndex, to: xIndex)
|
|
63
|
+
spectrumObj.ranges = (0, initiateRanges_1.initiateRanges)(spectrum, spectrumObj);
|
|
65
64
|
//reapply filters after load the original data
|
|
66
|
-
FiltersManager.reapplyFilters(
|
|
67
|
-
preprocessing(
|
|
68
|
-
return
|
|
65
|
+
FiltersManager.reapplyFilters(spectrumObj);
|
|
66
|
+
preprocessing(spectrumObj, filters);
|
|
67
|
+
return spectrumObj;
|
|
69
68
|
}
|
|
70
69
|
exports.initiateDatum1D = initiateDatum1D;
|
|
71
70
|
function preprocessing(datum, onLoadFilters = []) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.changeIntegralsRelative = void 0;
|
|
4
|
-
function changeIntegralsRelative(
|
|
5
|
-
const index =
|
|
4
|
+
function changeIntegralsRelative(spectrum, newIntegral) {
|
|
5
|
+
const index = spectrum.integrals.values.findIndex((integral) => integral.id === newIntegral.id);
|
|
6
6
|
if (index !== -1) {
|
|
7
|
-
const ratio =
|
|
7
|
+
const ratio = spectrum.integrals.values[index].absolute / newIntegral.value;
|
|
8
8
|
const result = { values: [], sum: 0 };
|
|
9
|
-
for (const [index, integral] of
|
|
9
|
+
for (const [index, integral] of spectrum.integrals.values.entries()) {
|
|
10
10
|
const newIntegralValue = integral.absolute / ratio;
|
|
11
11
|
result.sum += newIntegralValue;
|
|
12
12
|
result.values[index] = {
|
|
@@ -15,9 +15,9 @@ function changeIntegralsRelative(datum, newIntegral) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
const { values, sum } = result;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...
|
|
18
|
+
spectrum.integrals.values = values;
|
|
19
|
+
spectrum.integrals.options = {
|
|
20
|
+
...spectrum.integrals.options,
|
|
21
21
|
mf: undefined,
|
|
22
22
|
moleculeId: undefined,
|
|
23
23
|
sumAuto: false,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.initiateIntegrals = void 0;
|
|
7
7
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
8
|
const mapIntegrals_1 = require("./mapIntegrals");
|
|
9
|
-
function initiateIntegrals(options,
|
|
9
|
+
function initiateIntegrals(options, spectrum) {
|
|
10
10
|
return (0, merge_1.default)({
|
|
11
11
|
values: [],
|
|
12
12
|
options: {
|
|
@@ -15,7 +15,7 @@ function initiateIntegrals(options, datum) {
|
|
|
15
15
|
sumAuto: true,
|
|
16
16
|
},
|
|
17
17
|
}, options.integrals, {
|
|
18
|
-
values: (0, mapIntegrals_1.mapIntegrals)(options?.integrals?.values || [],
|
|
18
|
+
values: (0, mapIntegrals_1.mapIntegrals)(options?.integrals?.values || [], spectrum),
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
exports.initiateIntegrals = initiateIntegrals;
|
|
@@ -23,9 +23,9 @@ function getRange(integral, shiftTarget, shift) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function mapIntegrals(integrals,
|
|
27
|
-
const { x, re } =
|
|
28
|
-
const shiftX = (0, getShiftX_1.getShiftX)(
|
|
26
|
+
function mapIntegrals(integrals, spectrum, shiftTarget = 'origin') {
|
|
27
|
+
const { x, re } = spectrum.data;
|
|
28
|
+
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
29
29
|
return integrals.map((integral) => {
|
|
30
30
|
const integralBoundary = getRange(integral, shiftTarget, shiftX);
|
|
31
31
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: integralBoundary.from, to: integralBoundary.to, reverse: true });
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateIntegrals = void 0;
|
|
4
4
|
const mapIntegrals_1 = require("./mapIntegrals");
|
|
5
5
|
const updateIntegralsRelativeValues_1 = require("./updateIntegralsRelativeValues");
|
|
6
|
-
function updateIntegrals(
|
|
7
|
-
|
|
8
|
-
(0, updateIntegralsRelativeValues_1.updateIntegralsRelativeValues)(
|
|
6
|
+
function updateIntegrals(spectrum) {
|
|
7
|
+
spectrum.integrals.values = (0, mapIntegrals_1.mapIntegrals)(spectrum.integrals.values, spectrum, 'current');
|
|
8
|
+
(0, updateIntegralsRelativeValues_1.updateIntegralsRelativeValues)(spectrum, true);
|
|
9
9
|
}
|
|
10
10
|
exports.updateIntegrals = updateIntegrals;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateIntegralsRelativeValues = void 0;
|
|
4
4
|
const checkIntegralKind_1 = require("./checkIntegralKind");
|
|
5
5
|
const updateRelatives_1 = require("./updateRelatives");
|
|
6
|
-
function updateIntegralsRelativeValues(
|
|
7
|
-
(0, updateRelatives_1.updateRelatives)(
|
|
6
|
+
function updateIntegralsRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
7
|
+
(0, updateRelatives_1.updateRelatives)(spectrum.integrals, 'integral', checkIntegralKind_1.checkIntegralKind, forceCalculateIntegral);
|
|
8
8
|
}
|
|
9
9
|
exports.updateIntegralsRelativeValues = updateIntegralsRelativeValues;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRangeAssigned = void 0;
|
|
4
|
+
function isAssigned(object) {
|
|
5
|
+
return ((object?.nbAtoms && object.nbAtoms > 0) ||
|
|
6
|
+
(object?.diaIDs && object.diaIDs.length > 0));
|
|
7
|
+
}
|
|
8
|
+
function isRangeAssigned(range) {
|
|
9
|
+
if (isAssigned(range)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return range?.signals.some((signal) => isAssigned(signal));
|
|
13
|
+
}
|
|
14
|
+
exports.isRangeAssigned = isRangeAssigned;
|
|
@@ -7,12 +7,12 @@ exports.autoPeakPicking = void 0;
|
|
|
7
7
|
const ml_array_median_1 = __importDefault(require("ml-array-median"));
|
|
8
8
|
const nmr_processing_1 = require("nmr-processing");
|
|
9
9
|
const mapPeaks_1 = require("./mapPeaks");
|
|
10
|
-
function autoPeakPicking(
|
|
10
|
+
function autoPeakPicking(spectrum, options) {
|
|
11
11
|
const { minMaxRatio, maxNumberOfPeaks, noiseFactor, direction, windowFromIndex, windowToIndex, } = options;
|
|
12
12
|
// we calculate the noise but this could be improved
|
|
13
|
-
const noise = (0, ml_array_median_1.default)(
|
|
14
|
-
let { re, x } =
|
|
15
|
-
const { originFrequency: frequency } =
|
|
13
|
+
const noise = (0, ml_array_median_1.default)(spectrum.data.re.map((y) => Math.abs(y)));
|
|
14
|
+
let { re, x } = spectrum.data;
|
|
15
|
+
const { originFrequency: frequency } = spectrum.info;
|
|
16
16
|
if (windowFromIndex !== undefined && windowToIndex !== undefined) {
|
|
17
17
|
x = x.slice(windowFromIndex, windowToIndex);
|
|
18
18
|
re = re.slice(windowFromIndex, windowToIndex);
|
|
@@ -29,6 +29,6 @@ function autoPeakPicking(datum1D, options) {
|
|
|
29
29
|
peaks.sort((a, b) => b.y - a.y);
|
|
30
30
|
if (maxNumberOfPeaks < peaks.length)
|
|
31
31
|
peaks = peaks.slice(0, maxNumberOfPeaks);
|
|
32
|
-
return (0, mapPeaks_1.mapPeaks)(peaks,
|
|
32
|
+
return (0, mapPeaks_1.mapPeaks)(peaks, spectrum);
|
|
33
33
|
}
|
|
34
34
|
exports.autoPeakPicking = autoPeakPicking;
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.initiatePeaks = void 0;
|
|
7
7
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
8
|
const mapPeaks_1 = require("./mapPeaks");
|
|
9
|
-
function initiatePeaks(options,
|
|
9
|
+
function initiatePeaks(options, spectrum) {
|
|
10
10
|
return (0, merge_1.default)({ values: [], options: {} }, options.peaks, {
|
|
11
|
-
values: (0, mapPeaks_1.mapPeaks)(options?.peaks?.values || [],
|
|
11
|
+
values: (0, mapPeaks_1.mapPeaks)(options?.peaks?.values || [], spectrum),
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
exports.initiatePeaks = initiatePeaks;
|
|
@@ -4,9 +4,9 @@ exports.mapPeaks = void 0;
|
|
|
4
4
|
const uuid_1 = require("@lukeed/uuid");
|
|
5
5
|
const getShiftX_1 = require("../getShiftX");
|
|
6
6
|
const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
|
|
7
|
-
function isExists(peak,
|
|
7
|
+
function isExists(peak, spectrum, error) {
|
|
8
8
|
// check if the Peak is already exists
|
|
9
|
-
for (const { x } of
|
|
9
|
+
for (const { x } of spectrum.peaks?.values || []) {
|
|
10
10
|
if (Math.abs(peak.x - x) < error) {
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
@@ -14,7 +14,7 @@ function isExists(peak, datum, error) {
|
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
function getPeakDelta(peak, shiftTarget, shift) {
|
|
17
|
-
const { originalX, x } = peak;
|
|
17
|
+
const { originalX = 0, x } = peak;
|
|
18
18
|
if (shiftTarget === 'origin') {
|
|
19
19
|
return {
|
|
20
20
|
originalX: x - shift,
|
|
@@ -28,15 +28,15 @@ function getPeakDelta(peak, shiftTarget, shift) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function mapPeaks(peaks,
|
|
31
|
+
function mapPeaks(peaks, spectrum, options = {}) {
|
|
32
32
|
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
33
|
-
const shiftX = (0, getShiftX_1.getShiftX)(
|
|
34
|
-
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(
|
|
33
|
+
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
34
|
+
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
|
|
35
35
|
let newPeaks = [];
|
|
36
36
|
for (const peak of peaks) {
|
|
37
37
|
const peakDelta = getPeakDelta(peak, shiftTarget, shiftX);
|
|
38
38
|
if (!checkIsExisting ||
|
|
39
|
-
(checkIsExisting && !isExists(peak,
|
|
39
|
+
(checkIsExisting && !isExists(peak, spectrum, error))) {
|
|
40
40
|
newPeaks.push({
|
|
41
41
|
...peak,
|
|
42
42
|
id: peak?.id || (0, uuid_1.v4)(),
|
|
@@ -4,10 +4,10 @@ exports.optimizePeaks = void 0;
|
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
5
|
const nmr_processing_1 = require("nmr-processing");
|
|
6
6
|
const mapPeaks_1 = require("./mapPeaks");
|
|
7
|
-
function optimizePeaks(
|
|
7
|
+
function optimizePeaks(spectrum, options) {
|
|
8
8
|
const { from, to, peaks } = options;
|
|
9
|
-
const { originFrequency: frequency } =
|
|
10
|
-
let { re, x } =
|
|
9
|
+
const { originFrequency: frequency } = spectrum.info;
|
|
10
|
+
let { re, x } = spectrum.data;
|
|
11
11
|
const fromIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(x, from);
|
|
12
12
|
const ToIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(x, to);
|
|
13
13
|
// create deleted peaks object where the key is the id of the peaks that we need to remove
|
|
@@ -16,14 +16,14 @@ function optimizePeaks(datum1D, options) {
|
|
|
16
16
|
ids[peak.id] = peak;
|
|
17
17
|
}
|
|
18
18
|
//remove peaks before start the optimization from the original list
|
|
19
|
-
|
|
19
|
+
spectrum.peaks.values = spectrum.peaks.values.filter((peak) => !ids[peak.id]);
|
|
20
20
|
x = x.subarray(fromIndex, ToIndex);
|
|
21
21
|
re = re.subarray(fromIndex, ToIndex);
|
|
22
22
|
const newPeaks = (0, nmr_processing_1.xyPeaksOptimization)({ x, y: re }, peaks, {
|
|
23
23
|
frequency,
|
|
24
24
|
groupingFactor: 3,
|
|
25
25
|
});
|
|
26
|
-
return (0, mapPeaks_1.mapPeaks)(
|
|
26
|
+
return (0, mapPeaks_1.mapPeaks)(spectrum.peaks.values.concat(newPeaks), spectrum, {
|
|
27
27
|
checkIsExisting: false,
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updatePeaks = void 0;
|
|
4
4
|
const mapPeaks_1 = require("./mapPeaks");
|
|
5
|
-
function updatePeaks(
|
|
6
|
-
|
|
5
|
+
function updatePeaks(spectrum) {
|
|
6
|
+
spectrum.peaks.values = (0, mapPeaks_1.mapPeaks)(spectrum.peaks.values, spectrum, {
|
|
7
7
|
checkIsExisting: false,
|
|
8
8
|
shiftTarget: 'current',
|
|
9
9
|
});
|
|
@@ -23,15 +23,15 @@ function createRangeObj({ from, to, absolute, id, signal, }) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
exports.createRangeObj = createRangeObj;
|
|
26
|
-
function addRange(
|
|
26
|
+
function addRange(spectrum, options) {
|
|
27
27
|
const { from, to, id, molecules, nucleus } = options;
|
|
28
|
-
const { x, re } =
|
|
28
|
+
const { x, re } = spectrum.data;
|
|
29
29
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
|
|
30
30
|
// detectSignal use the advance multiplet-analysis that can crash if too many points
|
|
31
31
|
const signal = (0, detectSignal_1.default)({ x, re }, {
|
|
32
32
|
from,
|
|
33
33
|
to,
|
|
34
|
-
frequency:
|
|
34
|
+
frequency: spectrum.info.originFrequency,
|
|
35
35
|
});
|
|
36
36
|
let range;
|
|
37
37
|
if (!signal) {
|
|
@@ -41,7 +41,13 @@ function addRange(datum, options) {
|
|
|
41
41
|
to,
|
|
42
42
|
id,
|
|
43
43
|
absolute,
|
|
44
|
-
signal: {
|
|
44
|
+
signal: {
|
|
45
|
+
multiplicity: '',
|
|
46
|
+
kind: 'signal',
|
|
47
|
+
delta: 0,
|
|
48
|
+
js: [],
|
|
49
|
+
diaIDs: [],
|
|
50
|
+
},
|
|
45
51
|
});
|
|
46
52
|
}
|
|
47
53
|
}
|
|
@@ -56,12 +62,12 @@ function addRange(datum, options) {
|
|
|
56
62
|
}
|
|
57
63
|
try {
|
|
58
64
|
if (range) {
|
|
59
|
-
|
|
65
|
+
spectrum.ranges.options = (0, SumManager_1.initSumOptions)(spectrum.ranges.options, {
|
|
60
66
|
molecules,
|
|
61
67
|
nucleus,
|
|
62
68
|
});
|
|
63
|
-
|
|
64
|
-
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(
|
|
69
|
+
spectrum.ranges.values = spectrum.ranges.values.concat((0, mapRanges_1.mapRanges)([range], spectrum));
|
|
70
|
+
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
catch (error) {
|
|
@@ -12,10 +12,10 @@ const defaultPeakPickingOptions = {
|
|
|
12
12
|
clean: true,
|
|
13
13
|
sgOptions: { windowSize: 7, polynomial: 3 },
|
|
14
14
|
};
|
|
15
|
-
function autoRangesDetection(
|
|
15
|
+
function autoRangesDetection(spectrum, options = {}) {
|
|
16
16
|
// we calculate the noise but this could be improved
|
|
17
|
-
let { re, x } =
|
|
18
|
-
const { originFrequency, nucleus } =
|
|
17
|
+
let { re, x } = spectrum.data;
|
|
18
|
+
const { originFrequency, nucleus } = spectrum.info;
|
|
19
19
|
const { windowFromIndex, windowToIndex, peakPicking } = options;
|
|
20
20
|
const peakPickingOptions = {
|
|
21
21
|
...defaultPeakPickingOptions,
|
|
@@ -8,15 +8,20 @@ const uuid_1 = require("@lukeed/uuid");
|
|
|
8
8
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
9
9
|
const detectSignal_1 = __importDefault(require("./detectSignal"));
|
|
10
10
|
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
11
|
-
function changeRange(
|
|
11
|
+
function changeRange(spectrum, range) {
|
|
12
12
|
const { from, to, id } = range;
|
|
13
|
-
const { x, re } =
|
|
14
|
-
const index =
|
|
13
|
+
const { x, re } = spectrum.data;
|
|
14
|
+
const index = spectrum.ranges.values.findIndex((i) => i.id === id);
|
|
15
15
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
|
|
16
|
-
const signal = (0, detectSignal_1.default)({ x, re }, {
|
|
16
|
+
const signal = (0, detectSignal_1.default)({ x, re }, {
|
|
17
|
+
from,
|
|
18
|
+
to,
|
|
19
|
+
frequency: spectrum.info.originFrequency,
|
|
20
|
+
checkMaxLength: false,
|
|
21
|
+
});
|
|
17
22
|
if (index !== -1) {
|
|
18
|
-
|
|
19
|
-
...
|
|
23
|
+
spectrum.ranges.values[index] = {
|
|
24
|
+
...spectrum.ranges.values[index],
|
|
20
25
|
originFrom: from,
|
|
21
26
|
originTo: to,
|
|
22
27
|
...range,
|
|
@@ -29,11 +34,12 @@ function changeRange(datum, range) {
|
|
|
29
34
|
kind: 'signal',
|
|
30
35
|
delta: 0,
|
|
31
36
|
js: [],
|
|
37
|
+
diaIDs: [],
|
|
32
38
|
}),
|
|
33
39
|
},
|
|
34
40
|
],
|
|
35
41
|
};
|
|
36
|
-
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(
|
|
42
|
+
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum);
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
exports.changeRange = changeRange;
|
|
@@ -3,23 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.changeRangeRelativeValue = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Change Range relative value and re-calculate the relative values for the other ranges
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {Spectrum1D} spectrum spectrum 1d
|
|
7
7
|
* @param {RangeProps} newRange
|
|
8
8
|
*/
|
|
9
|
-
function changeRangeRelativeValue(
|
|
10
|
-
const index =
|
|
11
|
-
if (index !== -1 &&
|
|
12
|
-
const { absolute, integration } =
|
|
9
|
+
function changeRangeRelativeValue(spectrum, newRange) {
|
|
10
|
+
const index = spectrum.ranges.values.findIndex((range) => range.id === newRange.id);
|
|
11
|
+
if (index !== -1 && spectrum.ranges.options.sum) {
|
|
12
|
+
const { absolute, integration } = spectrum.ranges.values[index];
|
|
13
13
|
const ratio = absolute / newRange.value;
|
|
14
|
-
const sum = (newRange.value / integration) *
|
|
15
|
-
|
|
16
|
-
...
|
|
14
|
+
const sum = (newRange.value / integration) * spectrum.ranges.options.sum;
|
|
15
|
+
spectrum.ranges.options = {
|
|
16
|
+
...spectrum.ranges.options,
|
|
17
17
|
mf: undefined,
|
|
18
18
|
moleculeId: undefined,
|
|
19
19
|
sumAuto: false,
|
|
20
20
|
sum,
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
spectrum.ranges.values = spectrum.ranges.values.map((range) => {
|
|
23
23
|
return {
|
|
24
24
|
...range,
|
|
25
25
|
integration: range.absolute / ratio,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.changeRangeSignal = void 0;
|
|
4
|
-
function changeRangeSignal(
|
|
4
|
+
function changeRangeSignal(spectrum, options) {
|
|
5
5
|
const { rangeID, signalID, newSignalValue } = options;
|
|
6
6
|
let shiftValue = 0;
|
|
7
|
-
const rangeIndex =
|
|
7
|
+
const rangeIndex = spectrum.ranges.values.findIndex((range) => range.id === rangeID);
|
|
8
8
|
if (rangeIndex !== -1) {
|
|
9
|
-
const signalIndex =
|
|
9
|
+
const signalIndex = spectrum.ranges.values[rangeIndex].signals.findIndex((signal) => signal.id === signalID);
|
|
10
10
|
shiftValue =
|
|
11
11
|
newSignalValue -
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
spectrum.ranges.values[rangeIndex].signals[signalIndex].delta;
|
|
13
|
+
spectrum.ranges.values[rangeIndex].signals[signalIndex].delta =
|
|
14
|
+
newSignalValue;
|
|
14
15
|
}
|
|
15
16
|
return shiftValue;
|
|
16
17
|
}
|