cheminfo / nmrium

React component to display and process nuclear magnetic resonance (NMR) spectra.
https://docs.nmrium.org
MIT License
55 stars 25 forks source link

Issue with import from zipped Bruker folder #1781

Closed tomlebl closed 2 years ago

tomlebl commented 2 years ago

Changing contour levels on 2D spectra imported from zipped Bruker folder seems to be broken. 2D spectra imported from zipped Bruker folder get displayed but changing of contour levels does not work. The issue starts in version 0.30.0. The same dataset opens fine in version 0.29.0. The 2D spectra on NMRium demo work fine as well.

I can't see any errors in the console. I have tried to inspect .nmrium files. There seem to be some substantial differences in "meta" object but I am not sure if that helps.

lpatiny commented 2 years ago

Could you zip a problematic file and upload it here ?

tomlebl commented 2 years ago

Here is the link to OneDrive folder with some Bruker data https://universityofstandrews907-my.sharepoint.com/:f:/g/personal/tl12_st-andrews_ac_uk/EjAadcmbmlhLmasN67bhtxwB0yjWr_0b1C8L8yjjlwK0-g?e=6Zybui

Cyclosporine.zip data set was recorded yesterday on AVIII-HD 700 using Topspin 3.6.2 and uploaded on my demo server. It opens fine there in NMRium v0.29.0. I can give you access if you want to check by yourself. If I upgrade to version v0.30.0 and higher it breaks. I thought that the issue was on my side but I get exactly same behavior if I try to open my data in your current demo hosted on https://www.nmrium.org/nmrium using Chrome and Brave browsers.

The other zipped Bruker folder (Problem 4) contains data recorded in 2008 that show exactly same behavior.

lpatiny commented 2 years ago

Cyclosporine.zip

@hamed-musallam Could you have a look at this issue. If it is not obvious please assign Alejandro.

hamed-musallam commented 2 years ago

@lpatiny

the problem because the median value is always zero, there is something wrong with the matrixAbsoluteMedian.

one more thing, this example does not have negative contours, maybe this is the reason why matrixAbsoluteMedian returns 0

https://github.com/cheminfo/nmrium/blob/62b268a45db1e0b119642d8ca4d834f07236d207/src/data/data2d/Processing2D.ts#L44

tomlebl commented 2 years ago

@hamed-musallam 2D spectrum in the dataset is DQF-COSY in magnitude mode therefore it does not have any negative contours.

Cyclosporine-HSQC.zip Here is another file containing phase sensitive HSQC having the same issue.

jobo322 commented 2 years ago

@tomlebl could you test this preview?

https://deploy-preview-1790--nmrium.netlify.app/

tomlebl commented 2 years ago

@jobo322 Looks good. Well done. Thanks.