cheminfo / multiplet-analysis

Analyse multiplet
https://cheminfo.github.io/multiplet-analysis/docs/
MIT License
1 stars 1 forks source link

speed #25

Open lpatiny opened 4 years ago

lpatiny commented 4 years ago

There seems to be 2 limiting steps:

In node to get profiling you can do:

node -r esm --inspect-brk examples/ddd.js

And the in the browser enter the url chrome://inspect to profile the code.

targos commented 3 years ago

measureSymShift is extremely slow.

Example with the first peak of the "1H spectrum test" data in NMRium:

image image

lpatiny commented 2 years ago

Here is a testcase that is too slow:

https://github.com/cheminfo/multiplet-analysis/commit/72a117f217db412efa576b966b97dec8b374a4c3

djeanner commented 2 years ago

It is slow because a lot of empty space is taken at both sides of the mutliplets - when intepolating it requires very large arrey.

The multiplet could go through a checkof the quality of the cut of the multiplet. It would chop off the sides with no signals.

Algorithm: The integral of the region could be calculated (sum of all points or sum of abs of all points), and then and scaled to 100%. Then, keep only the part of the spectrum where (say) 98% of the integral is found, plus a margin of (say) 5 Hz. More implementationally: run from the sides and discard until the cumulated integral reach 1%, then go back (say) 10 Hz (to avoid chopping the lineshape... which is bad for deconvolution).