Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve manual range picking n fix simulation of diagonal peaks in COSY prediction #3308

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"ml-tree-similarity": "^2.2.0",
"multiplet-analysis": "^2.1.5",
"nmr-correlation": "^2.3.3",
"nmr-load-save": "^2.2.0",
"nmr-processing": "^14.0.5",
"nmr-load-save": "^2.2.1",
"nmr-processing": "^14.0.6",
"nmredata": "^0.9.11",
"numeral": "^2.0.6",
"openchemlib": "^8.17.0",
Expand Down
281 changes: 281 additions & 0 deletions public/data/brukerFolders/hsqcBrukerFilters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
{
"version": 7,
"data": {
"source": {
"entries": [
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/acqu"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/acqu2"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/acqu2s"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/acqus"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/pdata/1/proc"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/pdata/1/proc2"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/pdata/1/proc2s"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/pdata/1/procs"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/2/ser"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/acqu"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/acqu2"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/acqu2s"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/acqus"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/pdata/1/proc"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/pdata/1/proc2"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/pdata/1/proc2s"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/pdata/1/procs"
},
{
"baseURL": "", "relativePath": "data/brukerFolders/cosyAndHsqcFid/3/ser"
}
]
},
"spectra": [
{
"id": "1349b256-7a33-4d90-9c7f-cc2e43f3be89",
"meta": {},
"filters": [
{
"name": "apodizationDimension1",
"value": {
"exponential": {
"apply": false,
"options": { "lineBroadening": 0.3 }
},
"sineBell": { "apply": false, "options": { "offset": 0.5 } },
"sineSquare": { "apply": true, "options": { "offset": 0.5 } },
"traf": { "apply": false, "options": { "lineBroadening": 0.3 } },
"gaussian": {
"apply": false,
"options": { "lineBroadening": 0.3, "lineBroadeningCenter": 0 }
}
},
"enabled": true,
"id": "b2567a33-4d90-4c7f-8c2e-43f3be893962"
},
{
"name": "zeroFillingDimension1",
"value": { "nbPoints": 1024 },
"enabled": true,
"id": "567a334d-905c-4fcc-ae43-f3be8939623c"
},
{
"name": "fftDimension1",
"value": {},
"enabled": true,
"id": "7a334d90-5c7f-4c2e-83f3-be8939623c3d"
},
{
"name": "apodizationDimension2",
"value": {
"exponential": {
"apply": false,
"options": { "lineBroadening": 0.3 }
},
"sineBell": { "apply": false, "options": { "offset": 0.5 } },
"sineSquare": { "apply": true, "options": { "offset": 0.5 } },
"traf": { "apply": false, "options": { "lineBroadening": 0.3 } },
"gaussian": {
"apply": false,
"options": { "lineBroadening": 0.3, "lineBroadeningCenter": 0 }
}
},
"enabled": true,
"id": "334d905c-7fcc-4e43-b3be-8939623c3d36"
},
{
"name": "zeroFillingDimension2",
"value": { "nbPoints": 1024 },
"enabled": true,
"id": "4d905c7f-cc2e-43f3-be89-39623c3d3670"
},
{
"name": "fftDimension2",
"value": {},
"enabled": true,
"id": "905c7fcc-2e43-43be-8939-623c3d367007"
},
{
"name": "phaseCorrectionTwoDimensions",
"value": {
"horizontal": { "ph0": 33.84521484375, "ph1": -5.625 },
"vertical": { "ph0": -15.28564453125, "ph1": 33.75 }
},
"enabled": true,
"id": "5c7fcc2e-43f3-4e89-b962-3c3d36700728"
}
],
"info": {},
"display": {
"isPositiveVisible": true,
"isNegativeVisible": true,
"isVisible": true,
"contourOptions": {
"positive": { "contourLevels": [47, 100], "numberOfLayers": 10 },
"negative": { "contourLevels": [47, 100], "numberOfLayers": 10 }
},
"dimension": 2,
"negativeColor": "yellow",
"positiveColor": "black"
},
"data": {},
"sourceSelector": {
"files": [
"data/brukerFolders/cosyAndHsqcFid/3/acqu2s",
"data/brukerFolders/cosyAndHsqcFid/3/acqus",
"data/brukerFolders/cosyAndHsqcFid/3/ser",
"data/brukerFolders/cosyAndHsqcFid/3/pdata/1/procs",
"data/brukerFolders/cosyAndHsqcFid/3/pdata/1/proc2s"
]
},
"zones": {
"values": [],
"options": { "isSumConstant": true, "sumAuto": true }
},
"customInfo": {}
},
{
"id": "7b9a1a5f-da6e-4dc9-88f1-18972ad0f7e7",
"meta": {},
"sourceSelector": {
"files": [
"data/brukerFolders/cosyAndHsqcFid/2/acqu2s",
"data/brukerFolders/cosyAndHsqcFid/2/acqus",
"data/brukerFolders/cosyAndHsqcFid/2/ser",
"data/brukerFolders/cosyAndHsqcFid/2/pdata/1/procs",
"data/brukerFolders/cosyAndHsqcFid/2/pdata/1/proc2s"
]
},
"filters": [
{
"name": "apodizationDimension1",
"value": {
"exponential": {
"apply": false,
"options": { "lineBroadening": 0.3 }
},
"sineBell": {
"apply": true,
"options": { "offset": 0, "exponent": 1 }
},
"sineSquare": { "apply": false, "options": { "offset": 0 } },
"traf": { "apply": false, "options": { "lineBroadening": 0.3 } },
"gaussian": {
"apply": false,
"options": { "lineBroadening": 0.3, "lineBroadeningCenter": 0 }
}
},
"enabled": true,
"id": "1a5fda6e-9dc9-48f1-9897-2ad0f7e70197"
},
{
"name": "zeroFillingDimension1",
"value": { "nbPoints": 1024 },
"enabled": true,
"id": "5fda6e9d-c948-4118-972a-d0f7e70197ad"
},
{
"name": "fftDimension1",
"value": {},
"enabled": true,
"id": "da6e9dc9-48f1-4897-aad0-f7e70197ad07"
},
{
"name": "apodizationDimension2",
"value": {
"exponential": {
"apply": false,
"options": { "lineBroadening": 0.3 }
},
"sineBell": {
"apply": true,
"options": { "offset": 0, "exponent": 1 }
},
"sineSquare": { "apply": false, "options": { "offset": 0 } },
"traf": { "apply": false, "options": { "lineBroadening": 0.3 } },
"gaussian": {
"apply": false,
"options": { "lineBroadening": 0.3, "lineBroadeningCenter": 0 }
}
},
"enabled": true,
"id": "6e9dc948-f118-472a-90f7-e70197ad075d"
},
{
"name": "zeroFillingDimension2",
"value": { "nbPoints": 1024 },
"enabled": true,
"id": "9dc948f1-1897-4ad0-b7e7-0197ad075d90"
},
{
"name": "fftDimension2",
"value": {},
"enabled": true,
"id": "c948f118-972a-40f7-a701-97ad075d90f1"
},
{
"name": "phaseCorrectionTwoDimensions",
"value": {},
"enabled": true,
"id": "48f11897-2ad0-47e7-8197-ad075d90f11e",
"error": "Phase correction is not applicable to raw data"
},
{
"name": "symmetrizeCosyLike",
"value": {},
"enabled": false,
"id": "f118972a-d0f7-4701-97ad-075d90f11e9a"
}
],
"info": {},
"display": {
"isPositiveVisible": true,
"isNegativeVisible": true,
"isVisible": true,
"contourOptions": {
"positive": { "contourLevels": [51, 100], "numberOfLayers": 10 },
"negative": { "contourLevels": [51, 100], "numberOfLayers": 10 }
},
"dimension": 2,
"negativeColor": "blue",
"positiveColor": "darkblue"
},
"data": {},
"zones": {
"values": [],
"options": { "isSumConstant": true, "sumAuto": true }
},
"customInfo": {}
}
]
}
}
40 changes: 27 additions & 13 deletions src/component/modal/MultipletAnalysisModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { Dialog, DialogBody } from '@blueprintjs/core';
import { css } from '@emotion/react';
import { xGetFromToIndex, xyToXYObject } from 'ml-spectra-processing';
import { analyseMultiplet } from 'multiplet-analysis';
import type { ActiveSpectrum, Spectrum } from 'nmr-load-save';
import { xreimMultipletAnalysis } from 'nmr-processing';

Check failure on line 6 in src/component/modal/MultipletAnalysisModal.tsx

View workflow job for this annotation

GitHub Actions / nodejs / lint-check-types

Module '"nmr-processing"' has no exported member 'xreimMultipletAnalysis'.
import { useEffect, useState } from 'react';
import { Axis, LineSeries, Plot } from 'react-plot';

Expand Down Expand Up @@ -142,7 +142,7 @@
}

const {
data: { x, re },
data: { x, re, im },
info,
} = spectrum;

Expand All @@ -153,26 +153,40 @@
from,
to,
});

const analysesProps = {
x: x.slice(fromIndex, toIndex),
y: re.slice(fromIndex, toIndex),
re: re.slice(fromIndex, toIndex),
im: im?.slice(fromIndex, toIndex),
};
// console.log(
// 'hola',
// JSON.stringify(analysesProps, (key, value) =>
// ArrayBuffer.isView(value) ? Array.from(value as any) : value,
// ),
// );
try {
const result = analyseMultiplet(analysesProps, {
frequency: info.originFrequency,
minimalResolution: 0.1,
maxTestedJ: 17,
takeBestPartMultiplet: true,
correctVerticalOffset: true,
symmetrizeEachStep: true,
decreasingJvalues: true,
makeShortCutForSpeed: true,
debug: true,
const result = xreimMultipletAnalysis(analysesProps, {
autoPhase: false,
analyzer: {
frequency: info.originFrequency,
minimalResolution: 0.1,
critFoundJ: 0.75,
maxTestedJ: 17,
minTestedJ: 1,
checkSymmetryFirst: false,
takeBestPartMultiplet: true,
correctVerticalOffset: true,
symmetrizeEachStep: false,
decreasingJvalues: true,
makeShortCutForSpeed: true,
debug: true,
},
});
setCalcFinished(true);
setAnalysisData(result);
} catch (error) {
// TODO: handle error

Check warning on line 189 in src/component/modal/MultipletAnalysisModal.tsx

View workflow job for this annotation

GitHub Actions / nodejs / lint-eslint

Unexpected 'todo' comment: 'TODO: handle error'
reportError(error);
}
}
Expand Down
Loading
Loading