Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deconvolution #5

Open
AdriennR opened this issue Oct 26, 2023 · 3 comments
Open

Deconvolution #5

AdriennR opened this issue Oct 26, 2023 · 3 comments

Comments

@AdriennR
Copy link

Hi,
So I have been trying to deconvolve some 1D spectra and it works nicely, but usually when deconvolution is done, or other types of fittings, you can fix some of your parameters, like the peak position or the integrals or the linewidth. The same is true e.g. in ssnake. How can I do this here, because if I got it right, in the peaks and ranger, also with the frac_gauss I give the initial values for the fitting that are all going to be modified, and this can be a bit problematic in case the peaks are small or when I actually want to follow the change of peak intensities upon the change of some parameters (and sometimes the peaks become very small, so the program will compensate by making them very large.

@jmrohwer
Copy link
Collaborator

The only parameters that can be changed here are the optimization method, the frac_gauss and whether to use multiprocessing or not. See: https://nmrpy.readthedocs.io/en/latest/data_objects.html#nmrpy.data_objects.FidArray.deconv_fids

The peak position is taken from the peak list. The ranges give the range over which the deconvolution optimization is carried out. You could play around with selecting a separate range for every peak or combining them in various ways. See for example the documentation where we've selected two ranges for 4 peaks, with the one range containing 3 peaks, and the other range only 1 peak. For each range, the deconvolution is carried out separately, but if there is more than 1 peak in a range, these peaks are all deconvoluted together. How to do this best depends how close the peaks are and if they overlap.

It is not possible to fix the integrals or the linewidth, these are outputs of the deconvolution process.

You are of course welcome to dig into the source code and adapt this to your own needs 😄

@AdriennR
Copy link
Author

AdriennR commented Nov 2, 2023

Hi,
Do you know if I can get the chemical shift and linewidth values after optimisation?
Thank you.

@jmrohwer
Copy link
Collaborator

jmrohwer commented Nov 2, 2023

From the source:

    fid._deconvoluted_peaks()
        """This is a list of lists of peak parameters with the order [offset, gauss_sigma, lorentz_hwhm, amplitude, frac_gauss]:

            offset: spectral offset

            gauss_sigma: Gaussian sigma

            lorentz_hwhm: Lorentzian half-width-at-half-maximum

            amplitude: height of peak

            frac_gauss: fraction of peak to be Gaussian (Lorentzian fraction is 1-frac_gauss)
         """

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants