cheminfo-js / spectra-data

Library to deal with spectra (IR, UV, ...), 1D NMR as well as 2D NMR
https://cheminfo-js.github.io/spectra-data
MIT License
4 stars 0 forks source link

Peak detection can fail sometimes #45

Closed targos closed 7 years ago

targos commented 7 years ago

I get this error:

2016-11-28-13:05:59 0|rest-on- | Mon, 28 Nov 2016 13:05:59 GMT couch:error (import) import /nmr-mount/NMRjcamp/to_process/NMR2_2016_11_24.180002.jdx failure: LU matrix is singular, Error: LU matrix is singular
2016-11-28-13:05:59 0|rest-on- |     at LuDecomposition.solve (/rest-on-couch/node_modules/ml-curve-fitting/node_modules/ml-matrix/src/dc/lu.js:141:19)
2016-11-28-13:05:59 0|rest-on- |     at solve (/rest-on-couch/node_modules/ml-curve-fitting/node_modules/ml-matrix/src/decompositions.js:20:72)
2016-11-28-13:05:59 0|rest-on- |     at Array.Matrix.solve (/rest-on-couch/node_modules/ml-curve-fitting/node_modules/ml-matrix/src/decompositions.js:24:12)
2016-11-28-13:05:59 0|rest-on- |     at Object.solve (/rest-on-couch/node_modules/ml-curve-fitting/src/algebra.js:222:14)
2016-11-28-13:05:59 0|rest-on- |     at Object.optimize (/rest-on-couch/node_modules/ml-curve-fitting/src/LM.js:191:30)
2016-11-28-13:05:59 0|rest-on- |     at Object.optimizeSingleLorentzian (/rest-on-couch/node_modules/ml-optimize-lorentzian/src/index.js:112:20)
2016-11-28-13:05:59 0|rest-on- |     at Object.joinBroadPeaks (/rest-on-couch/node_modules/ml-gsd/src/optimize.js:198:35)
2016-11-28-13:05:59 0|rest-on- |     at module.exports (/rest-on-couch/node_modules/spectra-data/src/PeakPicking.js:49:29)
2016-11-28-13:05:59 0|rest-on- |     at NMR.nmrPeakDetection (/rest-on-couch/node_modules/spectra-data/src/NMR.js:339:16)
2016-11-28-13:05:59 0|rest-on- |     at Object.exports.parseJcamp (/rest-on-couch/node_modules/nmr-metadata/src/index.js:102:33)
andcastillo commented 7 years ago

Can you give me NMR2_2016_11_24.180002.jdx?

lpatiny commented 7 years ago

This problem is relatively common. We have around 10% of our spectra. Here is an example

test.jdx.tar.gz

andcastillo commented 7 years ago

This problems arises in the optimization of the peaks. We can set the option 'optimize=false' for now

targos commented 7 years ago

I think it's fixed now