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

Simplify prediction #2358

Closed lpatiny closed 1 year ago

lpatiny commented 1 year ago

Prediction can be tested on the following URL

https://dev.nmrium.org/#/SamplesDashboard/wpyv28rik3g/Prediction

It should be intuitive to predict one spectrum but also to be able to superimpose many spectra in order to show the impact of changing the structure, frequency, etc.

  1. In the prediction panel have directly the editor

Nevertheless we should be able to have many structures.

  1. Floating molecules should be active by default

This will be the default behaviour anyway:

  1. After the prediction we will display the 1H and not the cosy. This may be quite confusion for end users that are not used to 2D spectra.

image

  1. We should have 2 buttons if already existing prediction

Labels should change depending if we have or not already predict a spectrum.

If not yet predicted:

If already predicted spectra:

  1. When we predict a spectrum:

In the view state predictions we have an array of objects

predictions: [
{molecule: {id}},
{spectra: [{id}]}
]

If we add a prediction we will add an entry in view.predictions. If we replace a prediction, based on the current molecule.id we can delete all the previous spectra and add the new ones.

  1. Spectra panel should display other columns by default

In the 'prediction' workspace we can remove the solvent but frequency is quite important:

image

Ideally we should also display the Line Width (is it stored in info ???).

hamed-musallam commented 1 year ago

@lpatiny

i think it is better if we change your proposed structure to predictions: Record<moleculeId,string[]> because it is supposed to have one set of predicted spectra

hamed-musallam commented 1 year ago

Ideally we should also display the Line Width (is it stored in info ???).

we are not storing the line width in the info object, we just have it in the view object

lpatiny commented 1 year ago

@jobo322 Would it make sense to add lineWidth in info ? Especially in the case of predicted spectra it is an important property of the spectrum. Actually for the prediction what is the shape of the peaks ? We could also think about the possibility to customize the shape.

jobo322 commented 1 year ago

I think the shape of the peaks should be in ranges, also there should be the FWHM of each peak. What is the idea to have the line width in the info?

I could storage the lineWidth in the info object for each predicted spectra.