cheminfo / cheminfo/nmrium

duplicate properties originalX / x ... originalFrom / from, etc.

Open
#2,661 0 comments 0 reactions 0 assignees View on GitHub
to discuss
Dominant language
TypeScript
Stars
80
Forks
34
Avg merge
2d 9h
Merged PRs (30d)
36

Description

In 1D spectra we can shift the x axis (set the reference)
In 2D spectra we can shift both vertical and horizontal axis.

This is achieved through a filter.

We have annotations on those spectra:
- peaks
- integrals
- ranges
- zones

Currently we keep 2 values. For example in Peak:
- originalX - before shift
- x - after shift
For Integral:
- originalFrom, from
- originalTo, to

When should it be changed?

1. In NMRium we change the reference -> we change the value of the shift filter

We need to deeply recalculate all the values from the corresponding originalXXX.

2. We do a automatic peak picking with nmr-processing

We send x,y to nmr-processing and we receive back an array of peaks {x,y}. We need to recalculate the 'originalX'.

3. We import data not including originalX

We need to check if we have a shift filter and derive the `originalX` from `x`

## Annotations should be attached to point index ?

This is not that obvious because:
- zero filling can change the number of points after FT
- we are doing interpolation to get the 'real' top of the peak so the label is not really attached to an index

At first, we tried this, but it didn't appear to be the correct way.

## We have duplicate information

## It could be calculate on the flight ?

It is very annoying to have both `x` and `originalX` especially when we call other utilities like `global-spectra-deconvolution` that is not aware of this `originalX`

What if don't apply the shift filter ? This means that 'x' is always the original 'x'.

What would be the consequences ?
- displaying 1D: {x: [], y: []} but x will be wrong.
- why do we have the `x` array in fact. The deltaX is always constant ?? What about non-uniform sampling ???
- displaying 2D currently shift only minX, maxX, minY, maxY
- display the values for peaks and other we need display original + shift
- edition of the values should 'revert' the peaks

We can provide an utility that allows to append to the state the real shifted value.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.