NUTS macros

This file contains NUTS macros for automated processing. Note that these macros require that NUTS is operating in the 2-letter command mode.  The new command mode, allowing use of commands longer than 2 letters, requires that all commands be terminated with <ENTER>.  This new command mode provides additional flexibility in creating macros, but NUTS must be in the older 2-letter command mode to run the macros shown here.  This can be done by executing 2N before running these macros.

Macros included below:

  Referencing X-nucleus spectra using the absolute 1H frequency of TMS
Completely automated 1D processing, including integration and inset plots of downfield regions
Example of Looping and Sleep in a macro
Summing slices of a 2D data set
Nice apodization function (from Gerry Pearson)
DEPT processing (from Gerry Pearson)
APT processing (from Gerry Pearson)
Removing quadrature images from magnitude 2D data (from Gerry Pearson)

See also: 

description of macros
Arrayed Mode 2D processing
processing Varian 2D data
processing TPPI data
processing magnitude hetcor data
DEPT editing for Varian data


 (Revised 5/12/09) It is possible to reference a spectrum even if the spectrum doesn't contain a peak of known chemical shift, and without needing an external reference sample.  This is done using the absolute frequency of the 1H peak of TMS for your sample on your spectrometer and a known constant, E, for the X-nucleus which is the frequency of 0 ppm for that nucleus relative to 1H.  See http://www.iupac.org/publications/pac/2001/7311/7311x1795.html for complete explanation and a table of constants for various nuclei.  

The macro below will set the reference for several X-nuclei, and can be edited as needed, by changing the E value for the nucleus of interest.  Note that the macro must first recognize the nucleus, so verify that this is imported correctly for your particular data files, or set it manually.  The "nucleus" is a text string, and varies by spectrometer and model.  For example, it might be 13C, or C13 or Carbon.  The macro works by looking for a match, so you may need to edit the macro to match the text used by your spectrometer.

Start by opening a proton spectrum and verifying that the chemical shift reference is correct.  Run the macro.  It will ask you to open the X-nucleus spectrum to be referenced, and will do all the math and set the offset value.  The O1 (or OF1) value in NUTS is defined as the frequency difference, in Hz, between the center of the spectrum and 0 ppm.   The TMS frequency will be saved in the file header when the file is saved, so you have a record of how the referencing was done.

See also: referencing 

NutsMacro AbsRef
; For reference, see:
; http://www.iupac.org/publications/pac/2001/7311/7311x1795.html

; assumes open spectrum is a correctly referenced 1H spectrum
; uses correctly referenced 1H spectrum to calculate
; chemical shift reference for an X-nucleus
; first, calculate absolute frequency of TMS
set math decplaces 8
do math register 0 of1
do math enter 1000000
do math /
do math register 1 sf1
do math -
; save this value; copy it to memory 3 and set value saved in file header
do math register 0 memory 3
do math tms
; next, use this to calculate X-nucleus absolute frequency at 0 ppm
; E value for 13C
; change this to appropriate value for other nuclei
do math enter 25.145020
do math *
do math enter 100
do math /
QUESTION
Next, open the spectrum 
to be referenced
YES_BUTTON CONTINUE
NO_BUTTON ABORT
CANCEL_BUTTON ABORT
END_QUESTION
; now, open spectrum to be referenced
; use its SF value and the frequency at 0 ppm to calculate
; the correct NUTS offset (OF1) value so spectrum is correctly referenced
ask filea
ga
; set the value of "strcmp" to the nucleus
nu

;THIS SECTION SETS THE NUCLEUS
;ADD NEW NUCLEI AND FREQUENCY RATIO AS NEEDED
if strcmp 13C
GOTO c13
if strcmp 19F
GOTO f19
if strcmp 31p
GOTO p31
if strcmp 29Si
GOTO si29
if strcmp 17O
GOTO o17
if strcmp 11B
GOTO b11
if strcmp 195Pt
GOTO pt195

;END OF NUCLEUS SECTION
;IF THE NUCLEUS NOT FOUND ABORT
GOTO nucleus_not_found

;FOR EACH NUCLEUS IN NUCLEUS SECTION, SET THE FREQUENCY RATIO FOR THE NUCLEUS
:c13
do math enter 25.145020
GOTO set_reference
:f19
do math enter 94.094011
GOTO set_reference
:p31
do math enter 40.480742
GOTO set_reference
:si29
do math enter 19.867187
GOTO set_reference
:o17
do math enter 13.556457
GOTO set_reference
:b11
do math enter 32.083974
GOTO set_reference
:pt195
do math enter 21.496784

;END OF FREQUENCY RATIO SECTION
GOTO set_reference
:nucleus_not_found
QUESTION
NUCLEUS NOT FOUND. CLICK ANY BUTTON TO ABORT
YES_BUTTON ABORT
NO_BUTTON ABORT
CANCEL_BUTTON ABORT
END_QUESTION

;CALCULATE THE ABSOLUTE REFERENCE VALUE, CALCULATE AND SAVE OFFSET
:set_reference
do math enter 100
do math /
do math memory 3 register 1
do math *
do math register 1 SF1
do math -
do math enter 1000000
do math *
do math of1
; last, save the 1H TMS freq 
do math memory 3 register 0
do math tms

end

This macro was created to process a large set of 1H data to create "survey" spectra.  See Help on each command for details.

NUTSMACRO 
;FT, auto-phase and baseline correct
set lb 0.2
; set zoom region 5 to 10->0 ppm, for plotting
set zoom_region 5 10 0

;set zoom region 6 for aromatics (7 to 10 ppm)
set zoom_region 6 10 7

;set zoom_region 7 to downfield region (10 to 15 ppm)
set zoom_region 7 15 10

; first, clear previous integrals and inset plots
; then import, FT and phase 
; the next line must be changed, to set the number of times the loop will be executed 
loop 100 44
pf idc^m isc^m ^f af mf
ff bc ft ap it em ft qb

; initialize size & position for first IS inset
2f
is xsize .55,
is ysize .5,
is xpos 0,
is ypos 0,
2n,

; display aromatics full scale and create inset
z6 ^e mf isa^m

; initialize size & position for downfield IS inset
2f
is xsize .25,
is ysize .1,
is xpos 1,
is ypos 0,
2n,

; increase vertical scale 3x and create inset
set ac 3
ac
z7 ^e isa^m

; display 10->0, adjust scale, PP and enter integration
z5 ^e
set ac 0.1
ac

; set MH for peak picking
set mh 10
pp

; auto-integrate
set mh 1
ai
an

;save processed file
sa

end

To the top


This macro steps through planes of a 3D data set, allowing 1 sec between display of planes.  The Loop command takes 2 parameters: the number of times the loop is repeated, and the number of lines that comprise the loop.  So this macro executes the 2 operations (sleep and ] ) 48 times.

(The "]" command increments to the next plane.  Note that this command is active only in Arrayed 3D Mode.)

NUTSMacro   display planes
; first, set time to sleep, in msec
set sleeptime 1000

; define loop,  execute the next 2 lines, 48 times 
loop 48 2
do sleep
]
end

The command sum requires that NUTS be in the "non-2-letter" command mode.  This is set/unset with the 2F and 2N commands, respectively.   The sum command takes 2 arguments, which are the first and last slices to be included in the sum.   Note that the sum becomes the current data (1D) set.  If in arrayed mode, save the data before performing the sum.  

NUTSmacro sum slices
; request name of 2D data set, and open it
ask filea
ga

; turn off 2-letter command mode
2f  

; sum slices 3 through 10, inclusive
; note that each line in this command mode must be terminated with "," 
sum 3 10,

; return to 2-letter command mode
2n,
end

And another example, illustrating use of the IE (increment file extension) command to perform a series of sums.  This creates 4 1D files (sum.001 thru .004), each of which is the sum of 3 slices from the original 2D data.  

NUTSMACRO sum by 3s
ask filea  
set sl 1
set fileb sum.001
ga
2f
sum 1 3,
sb,
ie b,
ga,
sum 4 6,
sb,
ie b,
ga,
sum 7 9,
sb,
ie b,
ga,
sum 10 12,
sb,
2n,
end

A simple way to apply a very nice apodization function. Yields improved signal-to-noise (~50%!) with no loss of resolution. The function is (.215 + Cosine^2)*Cosine. The first 3 lines are irrelevant for 1D data, but are included to avoid confusion in phasing 2D data.
The function is created by loading the FID into the Add/Subtract buffer, using a multiplier of .215. Then the same FID is multiplied by cosine twice (equal to cosine squared), and then added to the contents of the buffer. The sum is then multiplied by cosine again.
Note that this macro (or any other) can be mapped to a Ctrl-function key by defining it in the nuts.ini file.

NUTSmacro 
; _1D_NARO.MAC fid -> spectrum
; Tuesday, 03 September 1996
; Revised Wednesday, 30 October 1996 so the "ap" routine yields correct 
; phase parameters when phasing a slice of a 2D file which is _not_ the 
; first slice. A NUTS bug ("feature"??) causes AP to yield _zero_ for total 
; PA and PB in this case, unless the slice is not the first one. 
; ROUTINE 1D PROCESSING, WITH MINIMUM-WIDTH LINE
; Gerald A. Pearson, Chem.Dept., Univ.of Iowa, Iowa City, IA 52242, USA
; Apodization envelope: ( 0.215 C + C^3 ) 
; Gives good line shape & good S/N for a typical FID.
; Uses 1 level of zero-filling.

db
set sl 1
bd
set am 0.215
set s# 90
al ms ms as ms zf ft ^f ap
end

To the top


DEPT macro

NUTSMACRO
; _DEPT3.MAC Wednesday, 30 October 1996 G.A.Pearson
; NOTE: Change "bt" to "ct" or "ft" if you're not using Bruker 
; sequential-quad data.
; DEPT spectral editing processing -- assumes 3 dept fid's, either in a 2D 
; file, or in three separate 1D files with extensions .001, .002, and .003. 
; first FID: N scans, 38.33 degree proton mixing angle
; second FID: 2N scans, 90 degree proton mixing angle
; third FID: N scans, 141.67 degree mixing angle
: Process the first FID & phase up the spectrum. Then run this macro, which 
; will produce a matrix with edited spectra in each of the 3 slices. 
; output file: \nuts\data\!_dept3.ed
; slice 3 CH3
; slice 2 CH2
; slice 1 CH

; The optimum angles for maximum S/N ratio are 38.33 degrees, 90 degrees,
; and 141.67 degrees, instead of the standard 45, 90, and 135 degrees. For 
; the standard 45, 90, and 135 deg., the coefficients for the edited spectra 
; are: 
; methines ( 0, 1, 0 )
; methylenes ( 1, 0, -1 )
; methyls ( 1, -0.707107, 1 ) 

; If the flip angles are 38.33, 90, and 141.67 degrees, then
; -.707107 --> -.6201899
; and the relative S/N's of the lines change to
; CH : CH2 : CH3 ==> 1, 0.973, 0.973
; which boosts the S/N ratio of the methyl carbon peaks by 12.3%, 
; at the expense of only a 2.7% loss of S/N ratio for the 
; methylene-carbon peaks. The methyl and methylene carbons will 
; then have the same S/N ratio in the edited spectra.

; ========================================
; Copy the input file(s) into one 2d file.
; ========================================

Ask FileA
set FullFileC \nuts\data\~temp1.2d
set sl 1
ga sc in

; ====================
; Generate raw spectra
; ====================
set FullFileA \nuts\data\~temp1.2d
set FullFileC \nuts\data\~temp2.2d
set sl 1
set am 0.215
set s# 90
; Nice apodization function
ga 21 zi al ms ms as ms db

ga ca zf bt ps sc in
;        ^^ __________ Note use of "BT" for Bruker data!!!

; =========================================================
; Generate edited spectra from linear comb. of raw spectra
; =========================================================
set FullFileA \nuts\data\~temp2.2d

;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; methines 0, 1, 0
set sl 2
ga 
Set FullFileC \nuts\data\~temp3.001
sc cc
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; methylenes 1, 0, -1
set sl 1
ga db
set sl 3
set am -1.0
ga al bd as 
Set FullFileC \nuts\data\~temp3.002
sc cc
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; methyls 1, -0.62, 1
set sl 1
ga db
set sl 2
set am -0.62
ga al bd as al
set sl 3
set am 1.0
ga as
Set FullFileC \nuts\data\~temp3.003
sc cc

;===========================================
; Copy the 1d edited files into a 2D file.
;===========================================
set FullFileA \nuts\data\~temp3.001
set FullFileC \nuts\data\!_dept3.ed
set sl 1
ga sc in
;====================================
; Load the final matrix into memory.
;====================================
set FullFileA \nuts\data\!_dept3.ed
set sl 1
ga ss
end

Bruker pulse program to generate data processed by above macro.

------ FILE: DEPT3 .ACQ 
;Pulse program for Bruker AC, AM, & WM spectrometers, with Aspect 3000 
;computer running DISRxx or DISNxx.
; DEPT3.ACQ 4/10/96 G.A.PEARSON
; Modified 4/17/96 for cpd instead of BB.
; Modified 4/30/96 to add many comments & modify phase cycling.
; AND TO ADD MANY COMMENTS.
; Modified 5/6/96 to use composite carbon pulses. and
; to modify phase cycling.
; HIGHLY-MODIFIED VERSION OF BRUKER PROGRAM DEPT.AUR.
; DEPT POLARIZATION TRANSFER FROM 1H TO X-NUCLEI
; FOR REFOCUSSED DECOUPLED SPECTRA
; ACQUIRES 3 SPECTRA, FOR USE IN GENERATING 3 EDITED
; SPECTRA CONTAINING ONLY CH, CH2, & CH3 RESPECTIVELY
; 1H: D1 - 90 - D2 - 180 - D2 - P0 - D2 - CPD
; X: --------------- 90--------180-------FID
;=======================================================
; PW = RD = 0
; P1, P2, P6, P7 -- PROTON 90, 180, 38.3, AND 141.7
; P3, P4, P5 -- CARBON 90, 180, 270
; D1 RELAXATION DELAY -- BRUKER SAYS 1-5*T1 FOR PROTON
; I RECOMMEND 10 SECONDS FOR MAXIMUM SENSITIVITY
; WITH NORMAL SAMPLES, AND 5 SECONDS FOR A FAST
; EXPERIMENT WITH A LOUD SAMPLE.
; NS 8 MINIMUM -- MUST BE SOME MULTIPLE OF 8
; 16 OR 32 RECOMMENDED FOR LONG-TERM AVERAGING
; DS 0 == NO DUMMY SCANS ARE NEEDED ==
; VC NUMBER OF TIMES TO INTERLEAVE (CYCLE THROUGH THE FID'S).
; 2 FOR ABSOLUTE MINIMUM EXPERIMENT
; 4 OR MORE RECOMMENDED. VC SHOULD BE 
; AN EVEN INTEGER WHEN NS = 8 OR 24, BUT 
; VC CAN BE AN ODD INTEGER WHEN NS = 16 OR 32
; D2 0.5/J(CH) FOR OPTIMUM POLARIZATION. I RECOMMEND
; D2 = 3.4 MILLISECONDS FOR OPTIMUM COMPROMISE
; FOR A RANGE OF SAMPLES WHICH COVER THE ENTIRE RANGES
; OF J(CH) FOR THE VARIOUS MULTIPLICITIES.
; S1 0H FOR MAX. POWER PULSES
; S2 NORMAL POWER FOR CPD DECOUPLING
; P9 90-DEG. PULSE AT S2, FOR SETTING UP CPD
;==========================================================
; TOTAL TIME (IN SECONDS) FOR EXPERIMENT:
; TOT.TIME = VC * ( 18 + 4 * NS * ( AQ + D1 ) )
; ; SOME SETUP RECOMMENDATIONS FOR VARIOUS DESIRED TOTAL TIMES:
; NS ---- D1 ---- SI = TD ----- VC ---- TOTAL TIME
; ---- ---- -------- ---- -------------
; 8 ------ 5 ---- 32K ----------- 4 ---- 14 MINUTES
; 8 ----- 10 ---- 64K ----------- 3 ---- 20 MIN.
; 8 ----- 10 ---- 64K ----------- 4 ---- 26 MIN.
; 8 ----- 10 ---- 64K ----------- 5 ---- 32 MIN.
; 16 ---- 10 ---- 64K ----------- 3 ---- 38 MIN.
; 16 ---- 10 ---- 64K ----------- 4 ---- 50 MIN.
; FOR TIMES LONGER THAN 30 MINUTES, USE NS=16, D1=10, SI=TD=64K,
; AND ADJUST VC TO GIVE DESIRED TOTAL TIME. IN THIS CASE,
; TOTAL TIME = 0.21 * VC HOURS
; ; FOR LONG ACQUISITIONS (MORE THAN 2 HOURS), IT IT EASIEST
; TO SET VC = 100 AND SIMPLY STOP THE EXPERIMENT WITH
; A CONTROL/H AFTER THE DESIRED AMOUNT OF TIME. AT WORST,
; THIS WILL ONLY INTRODUCE A SMALL AMOUNT OF CROSS TALK
; IN THE FINAL EDITED DEPT SPECTRA -- 5% AFTER 2 HOURS,
; 2.5% AFTER 4 HOURS, 1.25% AFTER 8 HOURS, ETC., AND WILL
; HAVE NEGLIGABLE EFFECT ON SENSITIVITY.
;==========================================================
ZE
II
D2 S2
P3 PH6
D2 BB
10 WR #1
IF #1
LO TO 10 TIMES 3
15 RF #1.001
; ------------------- DEPT 38.3
RE #1
II
20 D2 DO
P3 PH6 ; C-13 SATURATION PULSE, TO
; ELIMINATE THE NEED FOR DUMMY SCANS.
D1 S1 ; 1H relaxation, set dec. power for pulsing.
(P1 PH1 D2):D ; 90 DEG 1H PULSE, SHIFTS & J(XH) EFOLVE.
;--- 180 deg 1H pulse to refocus shifts, 
;--- retrgrade 90 deg X pulse for MQ coherence.
(P2 PH2):D (P4 PH5 P5 PH4 D2)
;--- variable pulse for 1H to complete polarization
;--- transfer, WALTZ composite 180 X pulse to refocus
;--- x shifts, set dec. power for CPD.
(P6 PH3):D (P3 PH6 P4 PH7 P5 PH6 D2 S2) 
GO=20 PH9 CPD ;ACQUIRE FID WITH DEC.
WR #1
IF #1
; ----------- DEPT 90 -- NEEDS TWICE AS MANY PULSES
RE #1
25 D2
II
30 D2 DO
P3 PH6
D1 S1
(P1 PH1 D2):D
(P2 PH2):D (P4 PH5 P5 PH4 D2)
(P1 PH3):D (P3 PH6 P4 PH7 P5 PH6 D2 S2)
GO=30 PH9 CPD
LO TO 25 TIMES 2
WR #1
IF #1
; ------------ DEPT 141.7
RE #1
II
40 D2 DO
P3 PH6
D1 S1
(P1 PH1 D2):D
(P2 PH2):D (P4 PH5 P5 PH4 D2)
(P7 PH3):D (P3 PH6 P4 PH7 P5 PH6 D2 S2)
GO=40 PH9 CPD
WR #1
; -------------- INTERLEAVE
IP4
IP5
IP9
IP9
IP9
LO TO 15 TIMES C
D2 DO
EXIT ;EXIT WITH DEC. OFF
;------------------------------------------- DECOUPLER PHASES
PH1= 0
PH2= 0 0 1 1 2 2 3 3
PH3= 1 3
;------------------------------------------- RETROGRADE 90
PH4= 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
PH5= 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3
;-------------------------------------------- WALTZ 180
PH6= 0 0 2 2 0 0 2 2 3 3 1 1 3 3 1 1
PH7= 2 2 0 0 2 2 0 0 1 1 3 3 1 1 3 3
;--------------------------------------------- RECEIVER
PH9= R0 R2 R2 R0 R0 R2 R2 R0
R1 R3 R3 R1 R1 R3 R3 R1
;==============================================

To the top


APT macro

NUTSMACRO
; -APT4.MAC Wednesday, 30 October 1996
; Gerald A. Pearson, Chem.Dept., Univ.ofIowa, Iowa City, IA 52242, USA

; Copyright (c) 1996, Gerald A. Pearson All rights reserved.
; A free (no cost) non-exclusive license is hereby granted to anyone to 
; copy, modify, and use this software, with two restrictions: 
; 1. This copyright notice must be included in all copies, 
; and in all modifications and their copies. 
; 2. Any modifications must be clearly indicated by comments. 

; NOTE: This macro was intended for use in processing Bruker sequential-
; quad NMR data, and "BT" is used to ensure that the correct form of the 
; Fourier transform is used on this data. For simultaneous-quad data, "BT" 
; should be changed to "CT" or "FT". 

;-----------------------------------------------------------------------
; For spectral editing of spectra acquired with J-molulation evolution
; times of 0, 2.31, 4.62, and 6.93 milliseconds. The input file A
; will typically be 4 1d fids, with extensions .001, .002, .003, & .004, 
; but the input file can also be a 2d file.
;-----------------------------------------------------------------------
; Process the first FID and phase up the spectrum. Then run this macro.
; Output file: \nuts\data\!-apt4.ed
; slice 6 quats & CH2 good S/N, small cross-talk
; slice 5 quats
; slice 4 CH2
; slice 3 CH3
; slice 2 CH
; slice 1 CH & CH3 good S/N, small cross-talk
; 
; Slices 2--6 are noisier and have more cross talk. It's best to use them 
; only to decide if a signal in slice 1 is either a CH or a CH3, and to 
; decide if a signal in slice 6 is either a CH2 or a quat. 

; The S/N ratio of the quats in slice 6 is 99% of what you would get from a 
; conventional BB proton-decoupled 13C spectrum, and it's the quats that are 
; almost always the weakest signals in such a spectrum. 

; Recommendation: If you _know_ that you want to run both a conventional 
; 13C{1H} _and_ a DEPT or APT experiment to determine multiplicities, then 
; save yourself some spectrometer time and run this single experiment 
; instead. If you don't have enough sensitivity to see all of the 13C 
; signals in this experiment, then you don't have enough sensitivity to get 
; a usable conventional 13C{1H} spectrum in the same total data-acquisition 
; time. 

; Comment to the user: We started using this spectral editing scheme at 
; the Univ.of Iowa about 2 or 3 years before DEPT was invented, using 
; essentially a NON-spin-echo version of APT. I did a poster paper on 
; this scheme in the late '70s or early '80s at an ENC, but never wrote 
; it up for publication in a journal. This is a robust experiment. If 
; you try it out, I think you'll like it. 

; copy/import the data into a 2d file
; ===================================

Ask FileA
set FullFileC \nuts\data\~temp1.2d
set sl 1
ga sc in

; apodize, zero fill, Fourier transform, & phase
; ==============================================

set FullFileA \nuts\data\~temp1.2d
set FullFileC \nuts\data\!-apt4.raw
set sl 1
set am 0.215
set s# 90

ga 21 zi al ms ms as ms db

ga ca zf bt ps sc in

; Now generate linear combinations
; ================================

Set FullFileA \nuts\data\!-apt4.raw

; CH & CH3 -- 0.495 0.186 -0.235 -0.450

set sl 1
set am -.505
ga al as db

set sl 2
set am 0.186
ga al bd as db

set sl 3
set am -0.235
ga al bd as db

set sl 4
set am -0.450
ga al bd as 
set FullFileC \nuts\data\~temp4.001
sc cc

; CH -- 0.038 0.937 -1.037 0.058

set sl 1
set am -.962
ga al as db

set sl 2
set am 0.937
ga al bd as db

set sl 3
set am -1.037
ga al bd as db

set sl 4
set am 0.058
ga al bd as 
set FullFileC \nuts\data\~temp4.002
sc cc

; CH3 -- 0.726 -1.069 0.978 -0.639

set sl 1
set am -0.274
ga al as db

set sl 2
set am -1.069
ga al bd as db

set sl 3
set am 0.978
ga al bd as db

set sl 4
set am -0.639
ga al bd as 
set FullFileC \nuts\data\~temp4.003
sc cc

; CH2 -- 0.818 -1.108 -0.319 0.613

set sl 1
set am -0.182
ga al as db

set sl 2
set am -1.108
ga al bd as db

set sl 3
set am -0.319
ga al bd as db

set sl 4
set am 0.613
ga al bd as 
set FullFileC \nuts\data\~temp4.004
sc cc

; quat -- -0.062 0.661 0.376 0.026

set sl 1
set am -1.062
ga al as db

set sl 2
set am 0.661
ga al bd as db

set sl 3
set am 0.376
ga al bd as db

set sl 4
set am 0.026
ga al bd as 
set FullFileC \nuts\data\~temp4.00
sc cc

; Q & CH2 -- 0.375 0.416 0.370 0.464

set sl 1
set am -0.625
ga al as db

set sl 2
set am 0.416
ga al bd as db

set sl 3
set am 0.370
ga al bd as db

set sl 4
set am 0.464
ga al bd as 
set FullFileC \nuts\data\~temp4.006
sc cc

; Copy the 1d results into a 2d matrix.
; =====================================
set FullFileA \nuts\data\~temp4.001
set FullFileC \nuts\data\!-apt4.ed
set sl 1
ga sc in

; Load the final matrix into memory.
; =================================

set FullFileA \nuts\data\!-apt4.ed
set sl 1
ga ss

end

Bruker pulse program to generate data processed by above macro.

------ FILE: APT4 .ACQ 
;Pulse program for Bruker AC, AM, & WM spectrometers, with Aspect 3000 
;computer running DISRxx or DISNxx.

; APT4.ACQ 5/3/96 G.A.PEARSON
; Acknowledgement: Pulse program inspired by one which was
; supplied to me by Prof. Horacio Olivo.

; APT: ATTACHED PROTON TEST FOR X NUCLEUS WITH NOE
; J-MODULATED SPIN-ECHO WITH COMPOSITE 180 DEG PULSES AND
; REINVERSION PULSE TO ALLOW LESS THAN A 90 DEG OBSERVE PULSE.
; S.L.PATT & J.N.SHOOLERY, J.MAGN.RES. 46, 535-9 (1982)

; Modifications implemented in this program include:
; 1. CPD decoupling instead of 2-level BB decoupling.
; 2. WALTZ ( 90 +x, 180 -x, 270 +x) composite 180 deg. pulses are
; used instead of MLEV ( 90 +x, 180 +y, 90 +x) composite
; pulses. I found that the WALTZ pulses work SIGNIFICANTLY
; BETTER in practice than the MLEV pulses. In one comparison
; of the 2 different spin-echo schemes with simple 1-pulse
; acquisition, I found sensitivity losses of 5 peaks to be
; 41%, 29%, 37%, 29%, and 29% with the MLEV scheme, but
; the WALTZ scheme gave losses only 13%, 14%, 22%, 23%, and 10%.
; 3. Phase cycling is far more complete in this program. With
; interleaving, the supercycle is complete consists of all 64 
; distinct phase combinations instead of the small subset
; (only 8) used in the program supplied by Dr. Olivo. 
; 4. Instead of collecting only 1 spectrum with the J-modulation
; evolving for ca. 7 milliseconds to give CH & CH3 peaks down
; and quats and CH2 peaks up, this program collects 4 spectra
; with the J-modulation evolving for times 0, D2, D3, & D2+D3.
; These raw data can be processed to produce combination
; spectra from which one can determine the exact proton 
; multiplicity (quat, CH, CH2, or CH3) of each and every
; carbon.
;
; CPD DECOUPLING EXCEPT FOR A SHORT VARIABLE TIME
; DURING THE FIRST REFOCUS (& DEFOCUS) TIME.
; H #######################----############################
;
; ------------------ P0 -- 180 ---------- 180
; C13 ---------------I----123------------123--------FID (ECHO)
; -------- D1 --------- D2 ----- D2 + D3 ------ D3
;
;=============================================================
; PW = RD = 0
; DP, D9 WHATEVER IS APPROPRIATE FOR GOOD COMPOSITE-
; PULSE DECOUPLING.
; P0 = PREPARATION PULSE -- 45-DEGREE PULSE RECOMMENDED
; P1, P2, P3 = 90, 180, 270 PULSE WIDTHS
; D1 = RELAXATION DELAY -- ( 5 - AQ ) SECONDS RECOMMENDED
; D2, D3 = 2.31 MILLISECONDS, 4.62 MILLISECONDS RECOMMENDED
; This will give spectra with J evolution times of 
; 0, 2.31, 4.62, and 6.93 milliseconds.
; NS = 16, OR SOME MULTIPLE OF 16.
; DS = 0 ??? DUMMY SCANS MIGHT NOT BE NECESSARY.
; VC = AT LEAST 2, AND PREFERABLY 3 OR MORE TO SPREAD INSTRUMENT
; DRIFTS AS EVENLY AS POSSIBLE OVER ALL 4 SPECTRA.
; SOME MULTIPLE OF 4 FOR COMPLETE SUPERCYCLE.
;==============================================================

;--------------- WRITE 4 BLANK FID'S TO DISK
II
D2 CPD
ZE
10 P0 PH1
WR #1
IF #1
LO TO 10 TIMES 4

;------------------ START OF BIG INTERLEAVE LOOP
20 RF #1.001

;--------------- SPECTRUM #1 -- DECOUPLED FULL TIME
RE #1
30 D1
P0 PH1 ; PREP. PULSE
D2
(P1 PH2 P2 PH3 P3 PH2) ; 1-ST COMPOSITE 180 (WALTZ)
D2
D3 
(P1 PH4 P2 PH5 P3 PH4) ; 2-ND COMPOSITE 180 
D3
GO=30 PH7
WR #1
IF #1

;-------------------- SPECTRUM #2 - DEC. GATED OFF D2
RE #1
40 D1
P0 PH1
D2
(P1 PH2 P2 PH3 P3 PH2)
D2 DO ; LET MULTIPLETS EVOLVE FOR TIME = D2
D3 CPD
(P1 PH4 P2 PH5 P3 PH4)
D3
GO=40 PH7
WR #1
IF #1

;-------------------- SPECTRUM #3 - DEC. GATED OF D3
RE #1
50 D1
P0 PH1
D2
(P1 PH2 P2 PH3 P3 PH2)
D3 DO ; LET MULTIPLETS EVOLVE FOR TIME = D3
D2 CPD
(P1 PH4 P2 PH5 P3 PH4)
D3
GO=50 PH7
WR #1
IF #1

;-------------------- SPECTRUM #4 -- DEC. GATED OFF D2 + D3
RE #1

60 D1
P0 PH1
D2
(P1 PH2 P2 PH3 P3 PH2)
D2 DO ; LET MULTIPLETS EVOLVE FOR TIME = D2 + D3
D3
(P1 PH4 P2 PH5 P3 PH4)
D3 CPD
GO=60 PH7
WR #1
IF #1

;------------------- INTERLEAVE
IP1
IP7
LO TO 20 TIMES C

EXIT
;------------------------ PREPARATION
PH1= 0 0 0 0 1 1 1 1 3 3 3 3 2 2 2 2

;------------------------ 1ST COMPOSITE 180 REFOCUS
PH2= 0 1 3 2 2 3 1 0
PH3= 2 3 1 0 0 1 3 2

;------------------------ 2ND COMPOSITE 180 REFOCUS
PH4= 0 0 2 2 0 0 2 2 1 1 3 3 1 1 3 3
PH5= 2 2 0 0 2 2 0 0 3 3 1 1 3 3 1 1

;------------------------ RECEIVER
PH7= R0 R2 R2 R0 R1 R3 R3 R1 R1 R3 R3 R1 R0 R2 R2 R0
;============================================================

To the top


Removing quadrature images from magnitude 2D data (from Gerry Pearson)

NUTSmacro
 
;   -QUAD_AM.MAC        Friday, 28 March 1997
;   Gerald A. Pearson, Chem.Dept., Univ.of Iowa, Iowa City, IA 52242, USA
;----------------------------------------------------------------------------
;   Copyright (c) 1997, Gerald A. Pearson       All rights reserved.
;   A free (no cost) non-exclusive license is hereby granted to anyone to 
;   copy, modify, and use this software, with two restrictions: 
;       1.  This copyright notice must be included in all copies, 
;           and in all modifications and their copies. 
;       2.  Any modifications must be clearly indicated by comments. 
;----------------------------------------------------------------------------
;   REMOVE QUAD IMAGES FROM AN ABSOLUTE-MAGNITUDE 2D SPECTRUM.
;   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;   1.  Set AM to the _NEGATIVE_ of the quad-image intensity.  
;       For example, GA the "raw" 2D spectrum, IP and PJ to get a 1D 
;       projection on the horizontal axis, and measure the ratios of the quad 
;       images of the NMR signals to the signals themselves.  Let's say that 
;       this ratio is 0.012 [1.2% quad image intensity].  In this case, set AM 
;       to -0.012 
;   2.  RU this macro, which asks for the name of the input file.
;   3.  The output file is     \nuts\data\!-QUAD.2D
;----------------------------------------------------------------------------
;   IMPORTANT RESTRICTION:  Each slice must exhibit the quad images.  In other 
;   words, the [imcomplete] phase cycling must be chosen so that, if the 2D 
;   matrix is reflected about the center _frequency_ in the first dimension, 
;   each NMR signal will be reflected into its quad image.  This _will_ be the 
;   case with many pulse sequences with many types of phase cycling, but not 
;   always.  For example _some_ possible minimal phase cycles for a double-
;   quantum-filtered constant-time COSY will move the quad images to other 
;   positions, such as at reflections about _both_ center frequencies 
;   (equivalent to a rotation by 180 degrees about the central point in the 
;   matrix).  In any case, it will always be possible to modify the phase 
;   cycling of the pulse program so that this macro can be used. 
;----------------------------------------------------------------------------
 
;   Reverse the spectrum, right shift one point, 
;   add AM times this to the spectrum, and zero negatives. 
 
ask FileA
set FullFileC \nuts\data\!-quad.2d
set sl 1
ga db sr rs al  bd as zn sc in
 
set FullFileA \nuts\data\!-quad.2d
set sl 1
ga
ss
 
end

To the top


NUTS users who have developed useful macros or other tools are encouraged to share them.

Return to main NUTS Help page

 

Last updated 7/12/08