| |
- CosyToInadequate()
- shearing operation that transform a "cosy" symmetry type experiment to a "Inadequate" one
- CosyToSecsy()
- shearing operation that transform a "cosy" symmetry type experiment to a "secsy" one
- InadequateToCosy()
- shearing operation that transform a "Inadequate" symmetry type experiment to a "cosy" one
- JResTilt()
- tilt operation that transform a JRes experiment to a symmetric one
- NPKtempfile(ext='.npktmp')
- Standard tempfile module is VERY buggy in jython, the secure mkstemp is missing, and the basic system call needed to implement it are lacking.
This is an attempt to make a "slightly" better tempfile than the jython built-in one.
This seems to be enough to change it from really annoying to bearly noticiable...
- SecsyToCosy()
- shearing operation that transform a "secsy" symmetry type experiment to a "cosy" one
- Symmetrize2D(type='Cosy', algorithm='mean')
- realize the symmetrization of the current 2D
available types are : Inadequate,Cosy, JRes
available algorithm are : mean (X+Y)/2 , smallest value min(X,Y),
and continuous (XY^2+YX^2)/(X^2 + Y^2) (not for JRes)
- SymmetrizeCosy(algorithm='mean')
- realize the symmetrization of COSY 2D
available algorithm are : mean (X+Y)/2 , smallest value min(X,Y), continuous (XY^2+YX^2)/(X^2 + Y^2)
- SymmetrizeInadequate(algorithm='mean')
- realize the symmetrization of INADEQUATE 2D
available algorithm are : mean (X+Y)/2 , smallest value min(X,Y), continuous (XY^2+YX^2)/(X^2 + Y^2)
- SymmetrizeJRes(algorithm='mean')
- realize the symmetrization of JRes 2D
available algorithm are : mean (X+Y)/2 , smallest value min(X,Y)
- add_files(list_of_files, list_of_coefficients=[])
- add a list of files weighted by the given coefficients
if coefficients are lacking, no weighting is made
- ap2d(apfunc, axis='F2')
- a 2D automatic phaser
axis is : F1, F2 or F12
will peak pick the 2D, and apply the chose algo on sums of rows and columns
MAD nov 2006
- aparm()
- computes phase correction form a reconstruction of the beginning of the FID
- apmin()
- automatic 1D phase correction
phase by minimizing the negative wing of the spectrum
MAD, oct 2006
- apmin2d(axis='F2')
- a 2D version of apmin()
axis is : F1, F2 or F12
will peak pick the 2D, and apply apmin on sums of rows and columns
see also : apsl()
MAD-VC july 2005
- apodise(apod, axis='F1')
- apod is the function to be applied,
it is a python callable sequence which realise the apodisation
e.g. "sin(0)" "expbroad(10)" "sqsin(0);expbroad(3)" etc...
(note the ; to separate several simple apodisations)
- apodise_f(apod, axis='F1')
- apod is the function to be applied,
it is a python callable sequence which realise the apodisation
e.g. "sin(0)" "expbroad(10)" "sqsin(0),expbroad(3)" etc...
(note the , to separate several simple apodisations)
M-A D. march 2006
- apodise_p(apod, axis='F1')
- #---------------------------------------------------------------------------
- apsl()
- APSL method
A.Heuer J.Magn.Reson. 91 p241 (1991)
uses the data buffer
you may want to adapt :
s_wdth : ration of line width to spectral width used for computing phases
p_wdth : ration of line width to spectral width used for broadening for peak picking
npk : minimum number of peaks needed for phasing
nfrst : the number of peaks used for first approx
see also : apsl2d() apsl_cp()
MAD-VC, july 2005
- apsl2d(axis='F2')
- a 2D version of apsl()
axis is : F1, F2 or F12
will peak pick the 2D, and apply apsl on sums of rows and columns
see also : apsl()
MAD-VC july 2005
- apsl_cp(pki, sz)
- computes the phase of the peak centered on i, using +/-sz points
the phase of the peak is returned between -180 and 180
i has to be odd !
used by apsl to compute an automatic phase correction of a 1D spectrum
see also : apsl()
MAD-VC, july 2005
- auditinitial(auditfilename='audit_trail.html', title='NPK Processing', append=1)
- initialize the audit trail file
auditfilename is the name of the audit file
if the file does not exist it is created and initialized,
if append ==1 and if the file exists, content will be added to it, this is the default behaviour
- audittrail(auditfile, phtx, *argl)
- management of the audit trail.
first argument determines action : open close phase text
arguments depends on the action
audittrail(open, "title in audit file")
opens the audit trail - use the argument as title
audittrail(close)
closes the audit trail
audittrail(phase, "title of phase")
start a new phase, creates a new heading in the audit trail
audittrail(text, "text to write in audit trail", parameter_name, parameter_value, ...)
writes in the audit trail
if text is available on several arguments, several lines are displayed,
in this case, the first arguments is the text/title, and the following arguments are
by pair, with parameter_name parameter_value
if phase mode <P> lines are added
if text mode a <li> list is built
- autocalib(mode='IUPAC')
- on a 2D experiment, assuming the F2 axis is 1H
try to detect spin nature from frequency, and apply the unified scale as proposed by IUPAC-2001
Harris et al. NMR Nomenclature: Nuclear Spin Properties and Conventions for Chemical Shifts—IUPAC Recommendations. Journal of Magnetic Resonance (2002) vol. 156 (2) pp. 323-326
WARNING, a different setting for biomolecules was proposed in a IUPAC/IUB recommendation in 1998
Markley et al. Recommendations for the presentation of NMR structures of proteins and nucleic acids. Journal of Molecular Biology (1998) vol. 280 (5) pp. 933-952
This previous recommendation was only mentionning 2D 13C, 15N and 31P, but was using different references
Usage is to use 1998 recommendation for proteins and nucleic acids.
these are enforced when mode = "IUB" or "biomolecule"
this makes +2.6645 ppm shift in 13C.
this makes a +380.4434 ppm shift in 15N.
Returns the name of the defined nucleus in F1, "15N" "13C" "31P" or "None" if nothing was done
- autocalib_old()
- on a 2D experiment, assuming the F2 axis is 1H
try to detect spin nature from frequency, and apply the unified scale as proposed by IUPAC-2001
WARNING, proteins tend to use DSS reference, where IUPAC imposes TMS
this makes +2.66 ppm shift in 13C.
IDEM, for 15N proteins tend to use NH3 reference, where IUPAC imposes MeNO3
this makes a +385.50 ppm shift in 15N.
- bcorr_offset(spec_n=30, axis='F1')
- correct for an offset of the spectrum, computed from an empty region of the spectrum
spec_n is the argument to spec_noise()
axis is the axis to process when in nD
- bcorr_quest(p=4, axis='F1')
- apply the QUEST baseline correction, based on the Linear Prediction reconstruction on the beginning of the FID.
p is the number of point to reconstruct
axis is the axis to process when in nD
works on complex as well as real datasets.
from
MAGMA. 2004 May;16(6):284-96. 2004
Time-domain quantitation of 1H short echo-time signals: background accommodation.
Ratiney H, Coenradie Y, Cavassila S, van Ormondt D, Graveron-Demilly D.
- bucket(start=0.5, end=9.5, bsize=0.040000000000000001, file='bucket.cvs')
- This tool permits to realize a bucket integration from the current 1D data-set.
You will have to determine (all spectral values are in ppm)
- start, end : the starting and ending points of the integration zone in the spectrum
- bsize : the size of the bucket
- file :the filename to which the result is written
the "set to current window" button defines the starting and ending points of the integration zone from the current zoom window
the "record" button permits to memorize the current parameters, which will be reused for the bucket integration.
the "details" button displays the number and the size of the buckets currently defined.
a non-integer size means that the integration will be performed on a varying number of data points
in order to insure a constant integration width in ppm.
However, the integration intensity is not modified by the integration width.
For a better bucket integration, you should be careful that :
- the bucket size is not too small, size is better than number !
- the baseline correction has been carefully done
- the spectral window is correctly determined to encompass the meaningfull spectral zone.
%programer%
see also : int1d integrate.g
%author% MA Delsuc
%version% 5.2005
- build_dict(default_list, p_in_arg={})
- build the default parameter dictionary
used in standard actions,
returns a dictionary built from the default parmaters (see do_default.py and Param/*)
and the additional parameters defined in the optionnal p_in_arg overwrite the default values
wrapper around the NPKParam class
- burg2d(axis='F1', nsz=None)
- apply burg extension to all columns (or rows) of current 2D
axis is either "F1" or "F2"
nsz is extended size, default (None) implies doubling of the size
- burg2d_back(axis, nsz)
- #---------------------------------------------------------------------------
# burg2d -- ??
#---------------------------------------------------------------------------
- burg2d_mirror(axis, n, bsz)
- #---------------------------------------------------------------------------
# burg2d_mirror -- ??
#---------------------------------------------------------------------------
- burg_back(nsz)
- #---------------------------------------------------------------------------
# burg_back -- ??
#---------------------------------------------------------------------------
- burg_mirror(n, bsz)
- #---------------------------------------------------------------------------
# burg_mirror -- ??
#---------------------------------------------------------------------------
- causal_corr(delay)
- remove the effect of a time shift on the spectrum due to digital filtering (Bruker)
- causalize(delay)
- remove the effect of a time shift on the FID due to digital filtering (Bruker)
brings back the beginning of the FID at the first data point
shorten the FID length respectively
- change_key_dict(patternOut, patternIn, p_in_arg)
- goes though the given dictionnay (which remains unchanged)
and changes in keys the pattern "patternIn" to "patternOut"
and returns the modified dictionnary
typically used in 3D processing :
change_key_dict('f2', 'f3', change_key_dict('f1', 'f2', p_in)) # in THAT order !
substitutes F2 (of the 3D) by F1 (of the 2D plane)
substitutes F3 (of the 3D) by F2 (of the 2D plane)
- conv_n_p()
- realizes the preparation of 2D FID acquired in n+p mode (echo / anti echo
- dc_offset(zone)
- corrects each FID of a dataset for constant offset, estimated on the last % of the fid
zone has a value between 0 and 1; 1 means the whole data set, 0.1 means the last 10%
- derivative(n, sm)
- @sig public void derivative( int n, int sm )
- dict_dump(dict, fname)
- dump the content of a dictionary as a property list file
one entry per line with the following syntax :
entry=value
- dict_load(fname)
- load a property list file as a dictionary
one entry per line with the following syntax :
entry=value
keys are set to lowercase
- dict_out(dict, title='')
- dump the content of a dictionary as a property list file
one entry per line with the following syntax :
entry=value
- expbroad(lb, axis='F1')
- apply a lb exponential broadening along given axis
- filec_status()
- dumps the detailled header of a joined cache file
used mostly for debugging
- flat_solvent(param, delay=0.0)
- reduces the solvent signal supposed to be at the carrier frequency
to be applied on the time domain, before Fourier transform
actually performs a "baseline" fit type of processing on the FID, real and imaginary parts are handled independantly
param is either
polynomial
moving_average
polynomial+moving_average
moving_average+polynomial
and determines the fitting algo used.
delays is the timezeo delay offset (not implemented yet)
- ft_n_p(axis='F1')
- F1-Fourier transform for N+P (echo/antiecho) 2D
- ft_phase_modu(axis='F1')
- F1-Fourier transform for phase-modulated 2D
- ft_seq()
- performs the fourier transform of a data-set acquired on a Bruker in
simultaneous mode
Processing is performed only along the F2 (F3) axis if in 2D (3D)
(Bruker QSIM mode)
see also : ft_seq() ft_sh() ft_tppi() ft_sh_tppi() ft_phase_modu() ft_n_p()
MAD-VC July 2005
- ft_sh(axis='F1')
- States-Haberkorn F1 Fourier transform
- ft_sh_tppi(axis='F1')
- States-Haberkorn / TPPI F1 Fourier Transform
- ft_sim()
- performs the fourier transform of a data-set acquired on a Bruker in
simultaneous mode
Processing is performed only along the F2 (F3) axis if in 2D (3D)
(Bruker QSIM mode)
see also : ft_seq() ft_sh() ft_tppi() ft_sh_tppi() ft_phase_modu() ft_n_p()
MAD-VC July 2005
- ft_tppi(axis='F1')
- TPPI F1 Fourier transform
- gaussbroad(lb, axis='F1')
- apply a lb gaussian broadening along given axis
- gaussenh(gg, ll, axis='F1')
- apply a lb gaussian enhancement along given axis
- get_itype(dim=0)
- analyze the complex state of the data buffer
dim is either 0 (current dim); 1 2 or 3
returns either (t) (t1,t2) (t1,t2,t3)
where tx is 0 if real and 1 if complex
- get_npk_path()
- get_saved_state(dd)
- recover saved current working data-buffer
- hanning(axis='F1')
- hanning apodisation
- hilbert(axis='F1')
- convert a real data set to a complex dataset by using the Hilbert transform
the number of data point is doubled, thus hilbert();real() is (nearly) a null operation
axis can be F1 F2 or F12
in dim(1) no axis is needed
does not work in dim(3) yet
minimal error checking, done mostly by the FT operations.
Note that a small apodisation is done on the Fourier transform to reduce truncation artifacts
you might want to remove this in certain cases, for instance if you plan to have several hilbert()
applied to the same data in sequence.
see also : tocomplex() invhilbert()
- invhilbert(axis='F1')
- convert a complex data set to a real dataset by using the Hilbert transform
the number of data point is unchanged,
thus the final real dataset is zerofilled once compared to the initial
invhilbert() is nearly equivalent to having zerofillied once before FT, but processing time is faster.
despite the name, not quite the inverse of hilbert() !
axis can be F1 F2 or F12
in dim(1) no axis is needed
does not work in dim(3) yet
minimal error checking, done mostly by the FT operations.
see also : tocomplex() hilbert()
- key_is_not_false(dict, key)
- used to check keys in processing parameter files
will return true if dict[key] exists and is true or doest not exist
will return false if dict[key] is defined false
- key_is_true(dict, key)
- used to check keys in processing parameter files
will return true if dict[key] exists and is true
will return false otherwise (does not exist or is false)
- left_shift(shift_size, axis='F1')
- shifts the FID to the left by dropping data points
MAD-VC January 2007
- load(filename)
- load in 1D memory a simple 1D series
skip # and ; comments
- local_proj(axis='F1', algo='M', f1_left=0, f2_left=0, f1_right=0, f2_right=0)
- realize a local projection of the 2D data-set
axis : "F1" - "F2" : the axis along which the projection is performed
algo : "M" - "S" ; Mean or Skyline
f1_left, f2_left, f1_right, f2_right : the coordinates of the local projection
O (default) means that the complete data-set will be used, thus:
f1_left=1 f2_left=1 f1_right=get_si1_2D(), f2_right=get_si2_2D()
thus : local_proj("F1","M") is equivalent to proj("F1","M")
WARNING - local_proj("F1") will create a F2 1D.
- local_proj_3d(axis='F1', algo='M', f1_left=0, f2_left=0, f3_left=0, f1_right=0, f2_right=0, f3_right=0)
- realize a local projection of the 3D data-set
axis : "F1" - "F2" - "F3": the axis along which the projection is performed
algo : "M" - "S" ; Mean or Skyline
f1_left, f2_left, f3_lest, f1_right, f2_right, f3_left : the coordinates of the local projection
O (default) means that the complete data-set will be used, thus:
f1_left=1 f2_left=1 f3_left=1 f1_right=get_si1_3D(), f2_right=get_si2_3D() f3_right=get_si3_3D()
- neg_wing()
- measure negative wing power
- peak1d_integ(index, factor=0.10000000000000001, thresh=0, slope=0.001)
- compute the integration zone around a given 1D peak
returns (left,right) as the integration zones
left and right are determined as the points were either
value gets below thresh (default value 0)
determines an absolute stop point
value gets below top_of_peak*factor (default value 0.1 = 10%)
determines a relative stop point
value > lower_point_so_far and abs(value-previous)>top_of_peak*slope (default value 0.001 = 0.1%)
allows going up as much as slope*top
warning, definitions are different from the integ kernel command
- phase_pivot(p0, p1, pivot=0.5)
- three parameter phasing routine
pivot = 0 is on left side
pivot = 1 is on right side
all intermidoate values are possible
returns actual (P0, P1)
- pkfilter(mode='add', tol=10)
- peak filtering
first try...
- pksym_p(mode='add', tol=10)
- peak symmetrisation algorithm
first try...
- pkwrite_p(filepeak)
- write the content of the peak table in the kernel to a peak file
the file is formated as a property list
coordinates are in index, widths are in Hz, phases in degrees.
format is not fully compatible with the format used in Gifa 5, as the coordinates are ouput in index
it will write the 1D, 2D or 3D peak table, depending on get_dim()
- plane_size(axis='F1')
- returns (si1,si2) the size of the plane orthogonal to axis from the joined dataset
- proc3d(sourcefile, destinationfile, plane_to_process, commands, context)
- this macro processes a 3D file using the cache system (join, getc, putc)
it permits to handle very large files, which would not fit into memory.
sourcefile : is the initial data-set
destinationfile : is the result of the process
plane_to_process : either F1, F2 or F3 (NOT F12 or F123)
F1 means : planes perpendicular to F1, thus the planes containing the F2 and F3 axes.
commands : a string holding the commands to be applied to each plane in 2D notation
context : a dictionary containing the variables needed to execute commands,
i.e. exec(commands,context) will actually be used
usually built from globals() and locals()
the commands are the regular commands you would used to process a 2D data-set.
when called without parameters, 'commands' can be several line long, as typed
when proc3d is called with parameters on the line, then 'commands' should be a single
command line within quotes.
e.g.
proc3(ser_file, F1_proc, "F1", 'sin(0.2,"f12"); ft_sim(); phase(30,-40,f2); real("f12"); ft_tppi()')
# process axes f3 and f2 as 2D
proc3(F1_proc, full_proc, "F2", 'sin(0.2,"f1"); ft_tppi(); real("f1"); bcorr(3,"f1")')
# process axis f1
would process a whole 3D in 2 steps.
- right_shift(shift_size, axis='F1')
- shifts the FID to the right by adding null data points at the begining of the FID
MAD-VC January 2007
- save_state(dd)
- save current working data-buffer
kind of wrapper over put("data")
save on temp file if necessary
*** NOT FINISHED yet, do no use ***
- set_itype(type)
- set the complex state of the data buffer
dim is either 1 2 or 3
type is either (t) (t1,t2) (t1,t2,t3)
where tx is 0 if real and 1 if complex
- shear(slope, pivot)
- shearing of a given NMR 2D experiment
realized by a frequency shift of all the F1 spectra
pivot is the position of the invariant column (0 is left, 1 is right)
- signal_noise(left=1, right=1, n=10)
- estimate the signal to noise of a given 1D data-set
It does this by find the most intense peak and dividing it by the noise level
left , right define the zone in which the signal/noise is to be computed
both value default to 1, right=1 means the right most point.
n is the number of pieces on which the noise is computed.
- spec_noise(n=10)
- estimate of noise in the data-set
estimates the noise in the data set by choping into n parts, and keeping the smallest one
in the same time evaluates the offset on the dataset on the same part used for noise determination
sets the value in get_noise and get_shift
- spectral_zone(left, right, axis='F1', left_unit='ppm', right_unit='ppm')
- extract one spectral zone of the spectrum
left float
the left border of the extract zone, in unit
left_unit enum ppm hz index
the unit in which spec_zone_left is given
right float
the right border of the extract zone, in unit
right_unit enum ppm hz index
the unit in which spec_zone_right is given
axis enum F1 F2 F3
if in 2D or 3D, the axis along the extract is to be done,
ignored if in 1D
returns [left,right]
the left and right coordinates of the extracted spectral zone in index
- tilt(slope, pivot)
- tilt of a 2D experiment
realized by a frequency shift of all the F2 spectra
pivot is the position of the invariant row (0 is bottom, 1 is top)
- tocomplex(axis='F1')
- tocomplex -- make dataset complex
- toreal(axis='F1')
- toreal -- make dataset real
- writet(filename)
- writes the 1D memory as a simple 1D series
skip # and ; comments
|