nmrium 0.35.1-pre.1683284050 → 0.36.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/ApodizationLine.d.ts +1 -2
- package/lib/component/1d/Chart1D.d.ts +1 -2
- package/lib/component/1d/ExclusionZonesAnnotations.d.ts +1 -2
- package/lib/component/1d/Line.d.ts +1 -1
- package/lib/component/1d/LinesSeries.d.ts +1 -2
- package/lib/component/1d/SpectraLegends.d.ts +1 -2
- package/lib/component/1d/Viewer1D.d.ts +1 -1
- package/lib/component/1d/database/DatabaseElements.d.ts +1 -2
- package/lib/component/1d/database/DatabaseSpectrum.d.ts +1 -2
- package/lib/component/1d/database/ResurrectedDatabaseRanges.d.ts +1 -2
- package/lib/component/1d/integral/Integral.d.ts +1 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +1 -2
- package/lib/component/1d/integral/IntegralsSeries.d.ts +1 -2
- package/lib/component/1d/jCouplingGraph/JGraph.d.ts +1 -2
- package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.d.ts +1 -2
- package/lib/component/1d/jCouplingGraph/JsCoupling.d.ts +1 -2
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.d.ts +1 -2
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -2
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.d.ts +1 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -2
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +2 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.d.ts +1 -2
- package/lib/component/1d/peaks/PeaksShapes.d.ts +1 -2
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -2
- package/lib/component/1d/ranges/RangeIntegral.d.ts +1 -2
- package/lib/component/1d/ranges/Ranges.d.ts +1 -2
- package/lib/component/1d/tool/PeakPointer.d.ts +1 -2
- package/lib/component/1d/tool/VerticalIndicator.d.ts +1 -2
- package/lib/component/1d/tool/XLabelPointer.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/ActionsButton.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -3
- package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts +1 -2
- package/lib/component/1d-2d/tools/BrushX.d.ts +1 -2
- package/lib/component/1d-2d/tools/BrushXY.d.ts +1 -2
- package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +1 -2
- package/lib/component/2d/1d-tracer/HorizontalSliceChart.d.ts +1 -1
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +1 -1
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.d.ts +1 -1
- package/lib/component/2d/Chart2D.d.ts +1 -2
- package/lib/component/2d/SlicingView.d.ts +1 -2
- package/lib/component/2d/Viewer2D.d.ts +1 -1
- package/lib/component/2d/fid/FidCanvas.d.ts +1 -2
- package/lib/component/2d/fid/FidContainer.d.ts +1 -2
- package/lib/component/2d/ft/Contours.d.ts +1 -2
- package/lib/component/2d/ft/FTContainer.d.ts +1 -2
- package/lib/component/2d/tools/XYLabelPointer.d.ts +1 -2
- package/lib/component/2d/zones/Zones.d.ts +1 -2
- package/lib/component/ErrorOverlay.d.ts +1 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -1
- package/lib/component/EventsTrackers/MouseTracker.d.ts +1 -1
- package/lib/component/SplitPaneWrapper.d.ts +1 -2
- package/lib/component/assignment/index.d.ts +1 -2
- package/lib/component/context/LoggerContext.d.ts +1 -1
- package/lib/component/elements/ActionButtons.d.ts +1 -1
- package/lib/component/elements/ButtonToolTip.d.ts +1 -1
- package/lib/component/elements/CheckBoxCell.d.ts +1 -2
- package/lib/component/elements/CloseButton.d.ts +1 -1
- package/lib/component/elements/ColumnWrapper.d.ts +1 -1
- package/lib/component/elements/DeleteButton.d.ts +1 -2
- package/lib/component/elements/GroupPane.d.ts +1 -1
- package/lib/component/elements/IsotopesViewer.d.ts +1 -1
- package/lib/component/elements/Logo.d.ts +1 -2
- package/lib/component/elements/Message.d.ts +1 -1
- package/lib/component/elements/ReactTable/Elements/EmptyDataRow.d.ts +1 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts +1 -1
- package/lib/component/elements/SVGGroup.d.ts +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -1
- package/lib/component/elements/Table/TableBody.d.ts +1 -1
- package/lib/component/elements/Table/TableCell.d.ts +1 -1
- package/lib/component/elements/Table/TableHead.d.ts +1 -1
- package/lib/component/elements/Table/TableRow.d.ts +1 -1
- package/lib/component/elements/ToolTip/ToolTip.d.ts +1 -1
- package/lib/component/elements/accordion/Accordion.d.ts +1 -1
- package/lib/component/elements/accordion/AccordionItem.d.ts +1 -1
- package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
- package/lib/component/elements/formik/ErrorMessage.d.ts +1 -1
- package/lib/component/elements/formik/FormikCheckBox.d.ts +1 -1
- package/lib/component/elements/formik/FormikColorInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +1 -1
- package/lib/component/elements/formik/FormikErrorsSummary.d.ts +1 -1
- package/lib/component/elements/formik/FormikInput.d.ts +1 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -2
- package/lib/component/elements/formik/FormikSelect.d.ts +1 -2
- package/lib/component/elements/formik/FormikSlider.d.ts +1 -2
- package/lib/component/elements/formik/FormikTextarea.d.ts +1 -1
- package/lib/component/elements/formik/Input.d.ts +1 -2
- package/lib/component/elements/linearAxis/LinearVerticalAxis.d.ts +1 -2
- package/lib/component/elements/popup/Alert/Provider.d.ts +1 -1
- package/lib/component/elements/popup/Modal/Modal.d.ts +1 -1
- package/lib/component/elements/popup/Transition.d.ts +1 -1
- package/lib/component/elements/popup/Wrapper.d.ts +1 -2
- package/lib/component/elements/resizer/Resizer.d.ts +1 -1
- package/lib/component/elements/toggle/ToggleButton.d.ts +1 -1
- package/lib/component/elements/toggle/ToggleButtonGroup.d.ts +1 -1
- package/lib/component/header/ApodizationOptionsPanel.d.ts +1 -2
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +1 -1
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/HeaderContainer.d.ts +1 -1
- package/lib/component/header/LogsHistory.d.ts +1 -2
- package/lib/component/header/PhaseCorrectionPanel.d.ts +1 -2
- package/lib/component/header/RangesPickingOptionPanel.d.ts +1 -2
- package/lib/component/header/ZeroFillingOptionsPanel.d.ts +1 -2
- package/lib/component/header/Zones2DOptionPanel.d.ts +1 -2
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.d.ts +1 -2
- package/lib/component/loader/NoData.d.ts +1 -1
- package/lib/component/loader/Spinner.d.ts +1 -1
- package/lib/component/loader/SpinnerContext.d.ts +1 -1
- package/lib/component/modal/ExportAsJcampModal.d.ts +1 -2
- package/lib/component/modal/MultipletAnalysisModal.js +6 -1
- package/lib/component/modal/editRange/EditRangeModal.js +3 -2
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -1
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +2 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.d.ts +1 -2
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +1 -2
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
- package/lib/component/modal/editZone/SignalFormTab.d.ts +1 -2
- package/lib/component/modal/setting/WorkspaceItem.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.d.ts +1 -2
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.d.ts +1 -2
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +1 -1
- package/lib/component/panels/InformationPanel.d.ts +1 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.d.ts +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisCell.d.ts +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.d.ts +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.d.ts +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.d.ts +1 -2
- package/lib/component/panels/PanelNoData.d.ts +1 -2
- package/lib/component/panels/Panels.d.ts +1 -2
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.d.ts +1 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +1 -2
- package/lib/component/panels/extra/placeholder/NoTableData.d.ts +1 -2
- package/lib/component/panels/extra/preferences/NucleusGroup.d.ts +1 -1
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +1 -2
- package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +1 -1
- package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +1 -1
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -5
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +3 -29
- package/lib/component/panels/filtersPanel/FiltersTable.d.ts +1 -2
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +1 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -2
- package/lib/component/toolbar/BasicToolBar.d.ts +1 -2
- package/lib/component/toolbar/FunctionToolBar.d.ts +1 -2
- package/lib/component/toolbar/HistoryToolBar.d.ts +1 -1
- package/lib/component/toolbar/ToolBar.d.ts +1 -2
- package/lib/data/constants/Multiplets.js +6 -13
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +41 -18
- package/lib/data/data1d/filter1d/fft.js +5 -7
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +2 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -2
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +12 -0
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -0
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +9 -4
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +2 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +6 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +5 -4
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +2 -1
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +5 -34
- package/lib-cjs/data/constants/Multiplets.js +6 -13
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +40 -17
- package/lib-cjs/data/data1d/filter1d/fft.js +5 -7
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -2
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +12 -0
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +9 -4
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +21 -21
|
@@ -16,7 +16,7 @@ export function apply(spectrum) {
|
|
|
16
16
|
}
|
|
17
17
|
checkSameLength(spectrum);
|
|
18
18
|
let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
19
|
-
const {
|
|
19
|
+
const { info: { aqMod }, } = spectrum;
|
|
20
20
|
if (aqMod === 1) {
|
|
21
21
|
removeDCOffset(spectrum, digitalFilterApplied);
|
|
22
22
|
}
|
|
@@ -24,18 +24,16 @@ export function apply(spectrum) {
|
|
|
24
24
|
padDataToNextPowerOfTwo(spectrum, digitalFilterApplied);
|
|
25
25
|
}
|
|
26
26
|
const { data, info } = spectrum;
|
|
27
|
-
Object.assign(data, reimFFT(
|
|
27
|
+
Object.assign(data, reimFFT({
|
|
28
|
+
re: data.re,
|
|
29
|
+
im: data.im,
|
|
30
|
+
}, { applyZeroShift: true }));
|
|
28
31
|
if (digitalFilterApplied) {
|
|
29
32
|
let { digitalFilter = 0 } = info;
|
|
30
33
|
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
31
34
|
Object.assign(data, reimPhaseCorrection(data, 0, -ph1, { reverse: true }));
|
|
32
35
|
}
|
|
33
36
|
data.x = generateXAxis(spectrum);
|
|
34
|
-
if (info?.reverse?.[0]) {
|
|
35
|
-
data.re.reverse();
|
|
36
|
-
data.im.reverse();
|
|
37
|
-
}
|
|
38
|
-
// Object.assign(datum1D.data, data);
|
|
39
37
|
spectrum.info = { ...info, isFid: false, isFt: true };
|
|
40
38
|
}
|
|
41
39
|
export function isApplicable(spectrum) {
|
|
@@ -5,8 +5,8 @@ export function padDataToNextPowerOfTwo(spectrum, digitalFilterApplied) {
|
|
|
5
5
|
let newRE = new Float64Array(size);
|
|
6
6
|
let newIM = new Float64Array(size);
|
|
7
7
|
const pointsToShift = getPointsToShift(spectrum);
|
|
8
|
-
newRE.set(re.slice(0,
|
|
9
|
-
newIM.set(im.slice(0,
|
|
8
|
+
newRE.set(re.slice(0, size - pointsToShift));
|
|
9
|
+
newIM.set(im.slice(0, size - pointsToShift));
|
|
10
10
|
if (pointsToShift > 0 && digitalFilterApplied) {
|
|
11
11
|
newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
|
|
12
12
|
newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
|
|
@@ -5,9 +5,8 @@ import { get2DColor } from './get2DColor';
|
|
|
5
5
|
import { initiateZones } from './zones/initiateZones';
|
|
6
6
|
const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
7
7
|
export function initiateDatum2D(spectrum, usedColors = {}) {
|
|
8
|
-
const datum = {};
|
|
8
|
+
const datum = { ...spectrum };
|
|
9
9
|
datum.id = spectrum.id || v4();
|
|
10
|
-
datum.selector = spectrum?.selector || {};
|
|
11
10
|
datum.display = {
|
|
12
11
|
isPositiveVisible: true,
|
|
13
12
|
isNegativeVisible: true,
|
|
@@ -12,6 +12,18 @@ import { mapZones } from './mapZones';
|
|
|
12
12
|
* @param {boolean} options.convolutionByFFT
|
|
13
13
|
*/
|
|
14
14
|
export function detectZonesManual(datum, options) {
|
|
15
|
+
const { spectralWidth, originFrequency } = datum.info;
|
|
16
|
+
options.tolerances = spectralWidth.map((sw, i) => sw * originFrequency[i]);
|
|
15
17
|
const zones = getDetectionZones(datum, options);
|
|
18
|
+
let { fromX, fromY, toX, toY } = options.selectedZone;
|
|
19
|
+
if (fromX > toX)
|
|
20
|
+
[fromX, toX] = [toX, fromX];
|
|
21
|
+
if (fromX > toX)
|
|
22
|
+
[fromY, toY] = [toY, fromY];
|
|
23
|
+
zones[0] = {
|
|
24
|
+
...zones[0],
|
|
25
|
+
x: { from: fromX, to: toX },
|
|
26
|
+
y: { from: fromY, to: toY },
|
|
27
|
+
};
|
|
16
28
|
return mapZones(zones, datum);
|
|
17
29
|
}
|
|
@@ -12,20 +12,25 @@ import { xyzAutoZonesPicking } from 'nmr-processing';
|
|
|
12
12
|
*/
|
|
13
13
|
export function getDetectionZones(spectrum, options) {
|
|
14
14
|
let dataMatrix = {};
|
|
15
|
-
|
|
15
|
+
const { selectedZone } = options;
|
|
16
|
+
if (selectedZone) {
|
|
16
17
|
options.enhanceSymmetry = false;
|
|
17
|
-
dataMatrix = getSubMatrix(spectrum,
|
|
18
|
+
dataMatrix = getSubMatrix(spectrum, selectedZone);
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
21
|
dataMatrix = spectrum.data;
|
|
21
22
|
}
|
|
22
|
-
return autoZonesDetection(dataMatrix, {
|
|
23
|
+
return autoZonesDetection(dataMatrix, {
|
|
24
|
+
...options,
|
|
25
|
+
info: spectrum.info,
|
|
26
|
+
});
|
|
23
27
|
}
|
|
24
28
|
function autoZonesDetection(data, options) {
|
|
25
|
-
const {
|
|
29
|
+
const { clean, tolerances, thresholdFactor, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
|
|
26
30
|
const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
|
|
27
31
|
let zones = xyzAutoZonesPicking(data, {
|
|
28
32
|
nuclei,
|
|
33
|
+
tolerances,
|
|
29
34
|
observedFrequencies: originFrequency,
|
|
30
35
|
thresholdFactor,
|
|
31
36
|
realTopDetection: true,
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.36.0' };
|
|
@@ -7,6 +7,7 @@ exports.MultiplicityTree = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
8
|
/** @jsxImportSource @emotion/react */
|
|
9
9
|
const react_1 = require("@emotion/react");
|
|
10
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
10
11
|
const react_2 = require("react");
|
|
11
12
|
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
13
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
@@ -86,7 +87,7 @@ function getTree(range, spectrum, scale) {
|
|
|
86
87
|
const treeResult = [];
|
|
87
88
|
const { signals = [], ...otherRangeProps } = range;
|
|
88
89
|
for (const signal of signals) {
|
|
89
|
-
const isMassive = !(0,
|
|
90
|
+
const isMassive = !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m']);
|
|
90
91
|
const length = signal?.multiplicity?.length || 0;
|
|
91
92
|
let width = 0;
|
|
92
93
|
let height = 0;
|
|
@@ -131,8 +131,13 @@ function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, on
|
|
|
131
131
|
try {
|
|
132
132
|
const result = (0, multiplet_analysis_1.analyseMultiplet)(analysesProps, {
|
|
133
133
|
frequency: info.originFrequency,
|
|
134
|
+
minimalResolution: 0.3,
|
|
135
|
+
maxTestedJ: 17,
|
|
134
136
|
takeBestPartMultiplet: true,
|
|
135
|
-
|
|
137
|
+
correctVerticalOffset: true,
|
|
138
|
+
symmetrizeEachStep: false,
|
|
139
|
+
decreasingJvalues: true,
|
|
140
|
+
makeShortCutForSpeed: true,
|
|
136
141
|
debug: true,
|
|
137
142
|
});
|
|
138
143
|
setCalcFinished(true);
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const uuid_1 = require("@lukeed/uuid");
|
|
10
10
|
const formik_1 = require("formik");
|
|
11
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
11
12
|
const react_2 = require("react");
|
|
12
13
|
const fa_1 = require("react-icons/fa");
|
|
13
14
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
@@ -74,7 +75,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
74
75
|
.map((coupling) => {
|
|
75
76
|
return {
|
|
76
77
|
...coupling,
|
|
77
|
-
multiplicity: (0,
|
|
78
|
+
multiplicity: (0, nmr_processing_1.translateMultiplet)(coupling.multiplicity),
|
|
78
79
|
};
|
|
79
80
|
}), []);
|
|
80
81
|
const getSignals = (0, react_2.useCallback)((signals) => {
|
|
@@ -83,7 +84,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
83
84
|
id: (0, uuid_1.v4)(),
|
|
84
85
|
...signal,
|
|
85
86
|
multiplicity: signal.js
|
|
86
|
-
.map((_coupling) => (0,
|
|
87
|
+
.map((_coupling) => (0, nmr_processing_1.translateMultiplet)(_coupling.multiplicity))
|
|
87
88
|
.join(''),
|
|
88
89
|
js: getCouplings(signal?.js || []),
|
|
89
90
|
};
|
|
@@ -102,7 +103,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
102
103
|
let counterJ = 0;
|
|
103
104
|
const couplings = [];
|
|
104
105
|
if (signal.multiplicity) {
|
|
105
|
-
for (const multiplicity of signal.multiplicity
|
|
106
|
+
for (const multiplicity of (0, nmr_processing_1.splitPatterns)(signal.multiplicity)) {
|
|
106
107
|
let js = {
|
|
107
108
|
multiplicity,
|
|
108
109
|
coupling: '',
|
|
@@ -112,7 +113,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
112
113
|
js.coupling = Number((0, formatNumber_1.formatNumber)(js.coupling, rangesPreferences.coupling.format));
|
|
113
114
|
counterJ++;
|
|
114
115
|
}
|
|
115
|
-
js.multiplicity = (0,
|
|
116
|
+
js.multiplicity = (0, nmr_processing_1.translateMultiplet)(js.multiplicity || '');
|
|
116
117
|
couplings.push(js);
|
|
117
118
|
}
|
|
118
119
|
}
|
|
@@ -30,12 +30,12 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
30
30
|
/** @jsxImportSource @emotion/react */
|
|
31
31
|
const react_1 = require("@emotion/react");
|
|
32
32
|
const formik_1 = require("formik");
|
|
33
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
33
34
|
const react_2 = require("react");
|
|
34
35
|
const fa_1 = require("react-icons/fa");
|
|
35
36
|
const Yup = __importStar(require("yup"));
|
|
36
37
|
const Button_1 = __importDefault(require("../../../../elements/Button"));
|
|
37
38
|
const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
|
|
38
|
-
const MultiplicityUtilities_1 = require("../../../../panels/extra/utilities/MultiplicityUtilities");
|
|
39
39
|
const formatNumber_1 = require("../../../../utility/formatNumber");
|
|
40
40
|
const styles = {
|
|
41
41
|
container: (0, react_1.css) `
|
|
@@ -69,7 +69,7 @@ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
|
|
|
69
69
|
multiplicity: 'm',
|
|
70
70
|
kind: 'signal',
|
|
71
71
|
delta: Number(val.newSignalDelta),
|
|
72
|
-
js: [{ multiplicity: (0,
|
|
72
|
+
js: [{ multiplicity: (0, nmr_processing_1.translateMultiplet)('m'), coupling: '' }],
|
|
73
73
|
};
|
|
74
74
|
const _signals = values.signals.slice().concat(newSignal);
|
|
75
75
|
setFieldValue('signals', _signals);
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const formik_1 = require("formik");
|
|
10
10
|
const get_1 = __importDefault(require("lodash/get"));
|
|
11
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
11
12
|
const react_2 = require("react");
|
|
12
13
|
const fa_1 = require("react-icons/fa");
|
|
13
14
|
const Multiplets_1 = require("../../../../../data/constants/Multiplets");
|
|
@@ -48,7 +49,7 @@ function CouplingsTable({ push, remove, onFocus, onBlur, }) {
|
|
|
48
49
|
}, [setFieldValue]);
|
|
49
50
|
const couplingsList = (0, get_1.default)(values, `signals[${values.activeTab}].js`, []);
|
|
50
51
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(Button_1.default.Done, { fill: "outline", style: { marginBottom: '10px' }, onClick: () => push({
|
|
51
|
-
multiplicity: (0,
|
|
52
|
+
multiplicity: (0, nmr_processing_1.translateMultiplet)('m'),
|
|
52
53
|
coupling: '',
|
|
53
54
|
}), children: [(0, jsx_runtime_1.jsx)(fa_1.FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), (0, jsx_runtime_1.jsx)("table", { css: CouplingsTableStyle, children: (0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "#" }), (0, jsx_runtime_1.jsx)("th", { children: "Multiplicity" }), (0, jsx_runtime_1.jsx)("th", { children: "J (Hz)" }), (0, jsx_runtime_1.jsx)("th", { children: '' })] }), couplingsList.map((_coupling, i) => ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: i + 1 }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { className: "select-box", name: `signals.${values.activeTab}.js.${i}.multiplicity`, items: Multiplets_1.Multiplets, itemValueField: "label", onChange: (value) => {
|
|
54
55
|
multiplicityChangeHandler(value, `signals.${values.activeTab}.js.${i}.coupling`);
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
7
8
|
const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
|
|
8
|
-
const MultiplicityUtilities_1 = require("../../../../panels/extra/utilities/MultiplicityUtilities");
|
|
9
9
|
const style = {
|
|
10
10
|
input: {
|
|
11
11
|
width: '50px',
|
|
@@ -16,7 +16,7 @@ const style = {
|
|
|
16
16
|
};
|
|
17
17
|
function DeltaInput({ signal, index, onFocus }) {
|
|
18
18
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsx)("span", { children: "\uD835\uDEC5: " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `signals.${index}.delta`, type: "number", placeholder: 'J (Hz)', onFocus: onFocus, style: style, checkErrorAfterInputTouched: false }), (0, jsx_runtime_1.jsx)("span", { children: signal.js
|
|
19
|
-
.map((_coupling) => (0,
|
|
19
|
+
.map((_coupling) => (0, nmr_processing_1.translateMultiplet)(_coupling.multiplicity))
|
|
20
20
|
.join('') })] }));
|
|
21
21
|
}
|
|
22
22
|
exports.default = DeltaInput;
|
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
7
8
|
const DispatchContext_1 = require("../../../context/DispatchContext");
|
|
8
9
|
const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
|
|
9
10
|
const Types_1 = require("../../../reducer/types/Types");
|
|
10
11
|
const formatNumber_1 = require("../../../utility/formatNumber");
|
|
11
|
-
const MultiplicityUtilities_1 = require("../../extra/utilities/MultiplicityUtilities");
|
|
12
12
|
function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
|
|
13
13
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
14
14
|
const signal = row.tableMetaInfo.signal;
|
|
@@ -24,6 +24,6 @@ function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
|
|
|
24
24
|
}
|
|
25
25
|
if (!signal)
|
|
26
26
|
return (0, jsx_runtime_1.jsx)("td", { children: '' });
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0,
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m']) ? (`${(0, formatNumber_1.formatNumber)(row.from, format)} - ${(0, formatNumber_1.formatNumber)(row.to, format)}`) : ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } })) }));
|
|
28
28
|
}
|
|
29
29
|
exports.default = SignalDeltaColumn;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
4
5
|
const formatNumber_1 = require("../../../utility/formatNumber");
|
|
5
|
-
const MultiplicityUtilities_1 = require("../../extra/utilities/MultiplicityUtilities");
|
|
6
6
|
function SignalDeltaHzColumn({ row, onHover, format, info, rowSpanTags, }) {
|
|
7
7
|
const signal = row.tableMetaInfo.signal;
|
|
8
8
|
if (!signal)
|
|
9
9
|
return (0, jsx_runtime_1.jsx)("td", { children: '' });
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0,
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m'])
|
|
11
11
|
? `${(0, formatNumber_1.formatNumber)(row.from * info.originFrequency, format)} - ${(0, formatNumber_1.formatNumber)(row.to * info.originFrequency, format)}`
|
|
12
12
|
: info?.originFrequency
|
|
13
13
|
? (0, formatNumber_1.formatNumber)(signal.delta * info.originFrequency, format)
|
|
@@ -1,47 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.hasCouplingConstant = exports.getPascal = exports.getMultiplicityNumber = void 0;
|
|
4
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
5
5
|
function getMultiplicityNumber(string) {
|
|
6
|
-
const multiplet =
|
|
6
|
+
const multiplet = (0, nmr_processing_1.findMultiplet)(string);
|
|
7
7
|
return multiplet ? multiplet.multiplicity : null;
|
|
8
8
|
}
|
|
9
9
|
exports.getMultiplicityNumber = getMultiplicityNumber;
|
|
10
|
-
function checkMultiplet(multiplet, rejected = []) {
|
|
11
|
-
// options to determine whether a massive (m), for example, should be considered as rejected multiplet
|
|
12
|
-
if (multiplet === undefined || multiplet.length === 0) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
const _multiplet = Multiplets_1.Multiplets.find((m) => m.value === multiplet || m.label === multiplet);
|
|
16
|
-
return (_multiplet &&
|
|
17
|
-
!rejected.includes(_multiplet.value) &&
|
|
18
|
-
!rejected.includes(_multiplet.label));
|
|
19
|
-
}
|
|
20
|
-
exports.checkMultiplet = checkMultiplet;
|
|
21
|
-
function checkMultiplicity(multiplicity, rejected = []) {
|
|
22
|
-
// options to determine whether a massive (m), for example, should be considered as rejected multiplicity
|
|
23
|
-
if (multiplicity === undefined || multiplicity.length === 0) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
const isBroad = multiplicity.match(/(?<broad>br s)/);
|
|
27
|
-
return (isBroad ||
|
|
28
|
-
multiplicity
|
|
29
|
-
.split('')
|
|
30
|
-
.every((_multiplet) => checkMultiplet(_multiplet, rejected)));
|
|
31
|
-
}
|
|
32
|
-
exports.checkMultiplicity = checkMultiplicity;
|
|
33
|
-
function translateMultiplet(multiplet) {
|
|
34
|
-
return multiplet.length === 1
|
|
35
|
-
? Multiplets_1.Multiplets.find((_multiplet) => _multiplet.value === multiplet)?.label
|
|
36
|
-
: Multiplets_1.Multiplets.find((_multiplet) => _multiplet.label === multiplet)?.value;
|
|
37
|
-
}
|
|
38
|
-
exports.translateMultiplet = translateMultiplet;
|
|
39
10
|
function hasCouplingConstant(multiplet) {
|
|
40
11
|
if (multiplet.length > 1) {
|
|
41
|
-
multiplet = translateMultiplet(multiplet);
|
|
12
|
+
multiplet = (0, nmr_processing_1.translateMultiplet)(multiplet);
|
|
42
13
|
}
|
|
43
14
|
// with the pre-set rejected ones, we check the given multiplicity for the need of having a coupling constant (massive and singlet do not)
|
|
44
|
-
return checkMultiplicity(multiplet, ['m', 's']);
|
|
15
|
+
return (0, nmr_processing_1.checkMultiplicity)(multiplet, ['m', 's']);
|
|
45
16
|
}
|
|
46
17
|
exports.hasCouplingConstant = hasCouplingConstant;
|
|
47
18
|
function getPascal(n, spin) {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Multiplets = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{ label: 'quartet (q)', value: 'q', multiplicity: 4 },
|
|
11
|
-
{ label: 'quintet (i)', value: 'i', multiplicity: 5 },
|
|
12
|
-
{ label: 'sextet (x)', value: 'x', multiplicity: 6 },
|
|
13
|
-
{ label: 'septet (p)', value: 'p', multiplicity: 7 },
|
|
14
|
-
{ label: 'octet (o)', value: 'o', multiplicity: 8 },
|
|
15
|
-
{ label: 'nonet (n)', value: 'n', multiplicity: 9 },
|
|
16
|
-
];
|
|
4
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
5
|
+
exports.Multiplets = nmr_processing_1.MultiplicityPatterns.map(({ label, value, acs, multiplicity }) => ({
|
|
6
|
+
label: `${label}`,
|
|
7
|
+
value: acs || value,
|
|
8
|
+
multiplicity,
|
|
9
|
+
}));
|
|
@@ -34,7 +34,7 @@ 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 spectrumObj = {};
|
|
37
|
+
const spectrumObj = { ...spectrum };
|
|
38
38
|
spectrumObj.id = spectrum.id || (0, uuid_1.v4)();
|
|
39
39
|
spectrumObj.display = {
|
|
40
40
|
isVisible: true,
|
|
@@ -14,37 +14,60 @@ function detectSignal(data, options) {
|
|
|
14
14
|
});
|
|
15
15
|
if (!checkMaxLength ||
|
|
16
16
|
(checkMaxLength && toIndex - fromIndex <= exports.MAX_LENGTH)) {
|
|
17
|
-
const
|
|
17
|
+
const dataRoi = {
|
|
18
18
|
x: x.slice(fromIndex, toIndex),
|
|
19
19
|
y: re.slice(fromIndex, toIndex),
|
|
20
20
|
};
|
|
21
|
-
const result = (0, multiplet_analysis_1.analyseMultiplet)(
|
|
21
|
+
const result = (0, multiplet_analysis_1.analyseMultiplet)(dataRoi, {
|
|
22
22
|
frequency,
|
|
23
|
+
minimalResolution: 0.3,
|
|
24
|
+
maxTestedJ: 17,
|
|
25
|
+
checkSymmetryFirst: true,
|
|
23
26
|
takeBestPartMultiplet: true,
|
|
24
|
-
|
|
27
|
+
correctVerticalOffset: true,
|
|
28
|
+
symmetrizeEachStep: false,
|
|
29
|
+
decreasingJvalues: true,
|
|
30
|
+
makeShortCutForSpeed: true,
|
|
25
31
|
});
|
|
26
32
|
if (result && result.chemShift === undefined)
|
|
27
33
|
return;
|
|
28
|
-
const
|
|
29
|
-
|
|
34
|
+
const { delta, js } = joinCouplings(result);
|
|
35
|
+
let cs = 0;
|
|
36
|
+
let area = 0;
|
|
37
|
+
for (let i = 0; i < dataRoi.x.length; i++) {
|
|
38
|
+
cs += dataRoi.x[i] * dataRoi.y[i];
|
|
39
|
+
area += dataRoi.y[i];
|
|
40
|
+
}
|
|
41
|
+
cs /= area;
|
|
42
|
+
const peakList = js.length === 0 ? (0, nmr_processing_1.xyAutoPeaksPicking)(dataRoi, { frequency }) : [];
|
|
43
|
+
return {
|
|
44
|
+
multiplicity: js.length > 0
|
|
45
|
+
? js.map((j) => j.multiplicity).join('')
|
|
46
|
+
: Math.abs(cs - delta) / cs < 1e-3
|
|
47
|
+
? peakList.length === 1
|
|
48
|
+
? 's'
|
|
49
|
+
: 'm'
|
|
50
|
+
: 'm',
|
|
30
51
|
kind: 'signal',
|
|
31
|
-
delta:
|
|
32
|
-
js
|
|
52
|
+
delta: cs,
|
|
53
|
+
js,
|
|
33
54
|
diaIDs: [],
|
|
34
55
|
};
|
|
35
|
-
if (result.js.length === 0) {
|
|
36
|
-
const { x: xData } = data;
|
|
37
|
-
const { chemShift: delta } = result;
|
|
38
|
-
const peakList = (0, nmr_processing_1.xyAutoPeaksPicking)(data, { frequency });
|
|
39
|
-
const deltaX = xData[0] - xData[1];
|
|
40
|
-
const peaks = peakList.filter((peak) => peak.x < delta - deltaX && peak.x > delta + deltaX);
|
|
41
|
-
if (peaks.length === 1)
|
|
42
|
-
signal.multiplicity = 's';
|
|
43
|
-
}
|
|
44
|
-
return signal;
|
|
45
56
|
}
|
|
46
57
|
else {
|
|
47
58
|
throw new Error(`length of signal should not exceed ${exports.MAX_LENGTH} points`);
|
|
48
59
|
}
|
|
49
60
|
}
|
|
50
61
|
exports.default = detectSignal;
|
|
62
|
+
function joinCouplings(result) {
|
|
63
|
+
const { chemShift: delta, js } = result;
|
|
64
|
+
return {
|
|
65
|
+
delta,
|
|
66
|
+
js: js.length > 1
|
|
67
|
+
? (0, nmr_processing_1.signalJoinCouplings)({
|
|
68
|
+
delta,
|
|
69
|
+
js,
|
|
70
|
+
}, { tolerance: 0.6, ignoreDiaIDs: true }).js
|
|
71
|
+
: js,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -19,7 +19,7 @@ function apply(spectrum) {
|
|
|
19
19
|
}
|
|
20
20
|
checkSameLength(spectrum);
|
|
21
21
|
let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
22
|
-
const {
|
|
22
|
+
const { info: { aqMod }, } = spectrum;
|
|
23
23
|
if (aqMod === 1) {
|
|
24
24
|
removeDCOffset(spectrum, digitalFilterApplied);
|
|
25
25
|
}
|
|
@@ -27,18 +27,16 @@ function apply(spectrum) {
|
|
|
27
27
|
(0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(spectrum, digitalFilterApplied);
|
|
28
28
|
}
|
|
29
29
|
const { data, info } = spectrum;
|
|
30
|
-
Object.assign(data, (0, ml_spectra_processing_1.reimFFT)(
|
|
30
|
+
Object.assign(data, (0, ml_spectra_processing_1.reimFFT)({
|
|
31
|
+
re: data.re,
|
|
32
|
+
im: data.im,
|
|
33
|
+
}, { applyZeroShift: true }));
|
|
31
34
|
if (digitalFilterApplied) {
|
|
32
35
|
let { digitalFilter = 0 } = info;
|
|
33
36
|
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
34
37
|
Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, -ph1, { reverse: true }));
|
|
35
38
|
}
|
|
36
39
|
data.x = generateXAxis(spectrum);
|
|
37
|
-
if (info?.reverse?.[0]) {
|
|
38
|
-
data.re.reverse();
|
|
39
|
-
data.im.reverse();
|
|
40
|
-
}
|
|
41
|
-
// Object.assign(datum1D.data, data);
|
|
42
40
|
spectrum.info = { ...info, isFid: false, isFt: true };
|
|
43
41
|
}
|
|
44
42
|
exports.apply = apply;
|
|
@@ -8,8 +8,8 @@ function padDataToNextPowerOfTwo(spectrum, digitalFilterApplied) {
|
|
|
8
8
|
let newRE = new Float64Array(size);
|
|
9
9
|
let newIM = new Float64Array(size);
|
|
10
10
|
const pointsToShift = getPointsToShift(spectrum);
|
|
11
|
-
newRE.set(re.slice(0,
|
|
12
|
-
newIM.set(im.slice(0,
|
|
11
|
+
newRE.set(re.slice(0, size - pointsToShift));
|
|
12
|
+
newIM.set(im.slice(0, size - pointsToShift));
|
|
13
13
|
if (pointsToShift > 0 && digitalFilterApplied) {
|
|
14
14
|
newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
|
|
15
15
|
newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
|
|
@@ -31,9 +31,8 @@ const get2DColor_1 = require("./get2DColor");
|
|
|
31
31
|
const initiateZones_1 = require("./zones/initiateZones");
|
|
32
32
|
const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
33
33
|
function initiateDatum2D(spectrum, usedColors = {}) {
|
|
34
|
-
const datum = {};
|
|
34
|
+
const datum = { ...spectrum };
|
|
35
35
|
datum.id = spectrum.id || (0, uuid_1.v4)();
|
|
36
|
-
datum.selector = spectrum?.selector || {};
|
|
37
36
|
datum.display = {
|
|
38
37
|
isPositiveVisible: true,
|
|
39
38
|
isNegativeVisible: true,
|
|
@@ -15,7 +15,19 @@ const mapZones_1 = require("./mapZones");
|
|
|
15
15
|
* @param {boolean} options.convolutionByFFT
|
|
16
16
|
*/
|
|
17
17
|
function detectZonesManual(datum, options) {
|
|
18
|
+
const { spectralWidth, originFrequency } = datum.info;
|
|
19
|
+
options.tolerances = spectralWidth.map((sw, i) => sw * originFrequency[i]);
|
|
18
20
|
const zones = (0, getDetectionZones_1.getDetectionZones)(datum, options);
|
|
21
|
+
let { fromX, fromY, toX, toY } = options.selectedZone;
|
|
22
|
+
if (fromX > toX)
|
|
23
|
+
[fromX, toX] = [toX, fromX];
|
|
24
|
+
if (fromX > toX)
|
|
25
|
+
[fromY, toY] = [toY, fromY];
|
|
26
|
+
zones[0] = {
|
|
27
|
+
...zones[0],
|
|
28
|
+
x: { from: fromX, to: toX },
|
|
29
|
+
y: { from: fromY, to: toY },
|
|
30
|
+
};
|
|
19
31
|
return (0, mapZones_1.mapZones)(zones, datum);
|
|
20
32
|
}
|
|
21
33
|
exports.detectZonesManual = detectZonesManual;
|
|
@@ -15,21 +15,26 @@ const nmr_processing_1 = require("nmr-processing");
|
|
|
15
15
|
*/
|
|
16
16
|
function getDetectionZones(spectrum, options) {
|
|
17
17
|
let dataMatrix = {};
|
|
18
|
-
|
|
18
|
+
const { selectedZone } = options;
|
|
19
|
+
if (selectedZone) {
|
|
19
20
|
options.enhanceSymmetry = false;
|
|
20
|
-
dataMatrix = getSubMatrix(spectrum,
|
|
21
|
+
dataMatrix = getSubMatrix(spectrum, selectedZone);
|
|
21
22
|
}
|
|
22
23
|
else {
|
|
23
24
|
dataMatrix = spectrum.data;
|
|
24
25
|
}
|
|
25
|
-
return autoZonesDetection(dataMatrix, {
|
|
26
|
+
return autoZonesDetection(dataMatrix, {
|
|
27
|
+
...options,
|
|
28
|
+
info: spectrum.info,
|
|
29
|
+
});
|
|
26
30
|
}
|
|
27
31
|
exports.getDetectionZones = getDetectionZones;
|
|
28
32
|
function autoZonesDetection(data, options) {
|
|
29
|
-
const {
|
|
33
|
+
const { clean, tolerances, thresholdFactor, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
|
|
30
34
|
const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
|
|
31
35
|
let zones = (0, nmr_processing_1.xyzAutoZonesPicking)(data, {
|
|
32
36
|
nuclei,
|
|
37
|
+
tolerances,
|
|
33
38
|
observedFrequencies: originFrequency,
|
|
34
39
|
thresholdFactor,
|
|
35
40
|
realTopDetection: true,
|
package/lib-cjs/versionInfo.js
CHANGED