parameters of universal dictionary in Bruker spectra

142 views
Skip to first unread message

Max

unread,
May 21, 2014, 4:43:22 PM5/21/14
to nmrglue...@googlegroups.com
Hi guys,

I was wondering if there is an easy way in order to create a unit conversion object for Bruker dataset as  for NMRPipe data by using the nmrglue.fileio.pipe.make_uc(dic, data, dim=-1) builtin function.

The nmrglue.fileio.bruker.guess_udic seems not working properly here since it returbs a dictionary of spectral parameters with no sense:


#! /usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm
import nmrglue as ng
import sys

# read in the data from a Bruker dataset from the command line
dic, data = ng.bruker.read(sys.argv[1])

# remove the digital filter
data = ng.bruker.remove_digital_filter(dic, data)

# process the direct dimension
data = ng.proc_base.sp(data, off=0.35, end=0.98, pow=2)
data = ng.proc_base.zf(data)
data = ng.proc_base.fft(data)
data = ng.proc_base.ps(data, p0=-50, p1=-8)
data = ng.proc_base.di(data)

# process the indirect dimension
data = ng.proc_base.tp(data)
data = ng.proc_base.sp(data, off=0.35, end=0.9, pow=2)
data = ng.proc_base.zf(data)
data = ng.proc_base.fft(data)
data = ng.proc_base.ps(data, p0=-77, p1=-21.4)
data = ng.proc_base.di(data)
data = ng.proc_base.tp(data)
uc_f1 = ng.fileio.bruker.guess_udic(dic, data)

then, when I inspect uc_f1 dictionary, I get the following:

uc_f1


Out[34]:
{0: {'car': 999.99,
     'complex': True,
     'encoding': 'states',
     'freq': False,
     'label': 'X',
     'obs': 999.99,
     'size': 256,
     'sw': 999.99,
     'time': True},
 1: {'car': 999.99,
     'complex': True,
     'encoding': 'direct',
     'freq': False,
     'label': 'Y',
     'obs': 999.99,
     'size': 443,
     'sw': 999.99,
     'time': True},
 'ndim': 2}


Any help here?

Thanks a lot,
Max

Jonathan Helmus

unread,
May 23, 2014, 7:12:25 PM5/23/14
to nmrglue...@googlegroups.com
Max,

    The guess_udic functions guess a universal dictionary from the data present, for some NMR data formats not all the information can be determined from the data presented.  In the case of Bruker data only the size parameter is set, the other values are set to default values that should be changed by the user.  This limited information in the universal dictionaries created from Bruker data is a result of 1) Me only having had a limited need to work with Bruker data (most the spectrometer I worked on were Varian/Agilent) and 2) The necessary metadata (carrier frequency, offset, spectral width) seems to be stored in the various acqus files in non-regular positions.  From my experience even NMRPipe's bruker command does not reliability determine these parameters, rather users must choose them from a list of possible choices. 

    There are two nmrglue forks [1], [2] and a open issue [3] which try to determine more of these spectral parameters from the metadata parsed from the acqus files but neither branch seems to get all the parameters correct.  If anyone would like to work on improving this I would welcome a pull request. For the time being universal dictionaries created using nmrglue.bruker.guess_udic must be corrected by hand.

Cheers,

    - Jonathan Helmus

[1] https://github.com/tjragan/nmrglue/tree/improved_bruker_import
[2] https://github.com/kyleabeauchamp/nmrglue/compare/bruker
[3] https://github.com/jjhelmus/nmrglue/issues/13
--
You received this message because you are subscribed to the Google Groups "nmrglue-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nmrglue-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages