add purge to hsqcphpr_1Hcoupled.4.cw

add purge to hsqcphpr_1Hcoupled.4.cw

; 13C HSQC with 1H coupling during t1 for measurement of CCR
; Jan 2017
;
; with off-resonance presat
; ZZ/crusher periods, clean-up gradient pairs
; (90,-180) phase correction
; use baseopt
;
;hsqcphpr
;avance-version (07/04/04)
;HSQC
;2D H-1/X correlation via double inept transfer
;phase sensitive
;with decoupling during acquisition
;
;G. Bodenhausen & D.J. Ruben, Chem. Phys. Lett. 69, 185 (1980)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

#include <Avance.incl>
#include <Delay.incl>
#include <Grad.incl>

"p2=p1*2"
"d2=p2"
"p4=p3*2"
"p22=p21*2"
"d4=1s/(cnst2*4)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf2"
"d0=4u"

"DELTA=d4-p16-d16-larger(p1,p3)-0.6366*p1"
"DELTA1=d4-p19-d16-p10-p1-4u-0.6366*p1"
"DELTA2=d4-p19-d16-p10-p1-12u"
"acqt0=0"

define delay vdMin
"vdMin = 2*p19 + 2*d16"

; calculate offset for WFB
"spoff1=cnst21-o1"

aqseq 312

1 ze
  vdMin
  d11 pl12:f2
2 d11 do:f2
  ; purge before d1
  20u pl6:f1
  (2mp ph1):f1
  (3mp ph2):f1

  ; off-resonance presat
  30u pl9:f1
  30u fq=cnst21(bf hz):f1
  d1 cw:f1 ph1
  30u do:f1
  30u fq=0:f1

  ; purge equilibrium 13C
  30u UNBLKGRAD
  4u pl1:f1 pl2:f2
  (p3 ph1):f2
  p16:gp0
  d16

  ; begin main sequence
  (p1 ph1)
  p16:gp1
  d16
  DELTA
  (center (p2 ph1) (p4 ph1):f2 )
  DELTA
  p16:gp1
  d16
  (p1 ph2)

  ; zz purge
  p16:gp2
  d16

  ; 13C t1
  (p3 ph11):f2
  d0
  "TAU = vd*0.5 - p19 - d16"
  TAU
  p19:gp5
  d16
  (p4 ph1):f2
  4u
  p19:gp5
  d16
  TAU
  (p3 ph12):f2

  ; zz purge
  p16:gp3
  d16

  ; final inept
  (p1 ph1)
  p19:gp4
  d16
  DELTA1
  (p10:sp1 ph3):f1
  4u pl1:f1
  (center (p2 ph1) (p4 ph1):f2 )
  4u
  (p10:sp1 ph3):f1
  DELTA2
  p19:gp4
  d16
  4u BLKGRAD
  4u pl12:f2

  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
    F1QF(ivd)
    F2PH(ip11, id0)

exit

ph1=0
ph2=1
ph3=2
ph11=0 2
ph12=0 0 2 2
ph31=0 2 2 0

;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl12: f2 channel - power level for CPD/BB decoupling
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p4 : f2 channel - 180 degree high power pulse
;p10 : f1 channel - 90 degree selective pulse [1000 usec]
;sp1 : f1 channel - 90 degree WFB (p10)
;d0 : incremented delay (2D)
;d1 : relaxation delay; 1-5 * T1
;d4 : 1/(4J)XH
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d13: short delay                                    [4 usec]
;cnst2: = J(XH)
;cnst21: off-resonance presaturation frequency (bf hz)
;inf1: 1/SW(X) = DW(X)
;in0: 1/SW(X) = DW(X)
;nd0: 1
;NS: 2 * n
;DS: 16
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEQ
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz0: 46 %
;gpz1: 13 %
;gpz2: 17 %
;gpz3: 33 %
;gpz4: 29 %

;gradients
;p16: 1000u
;p19: 300u

;use gradient files:
;gpnam0: SMSQ10.100
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100
;gpnam4: SINE.10

; 13C HSQC with 1H coupling during t1 for measurement of CCR
; Jan 2017
;
; with off-resonance presat
; ZZ/crusher periods, clean-up gradient pairs
; (90,-180) phase correction
; use baseopt
;
;hsqcphpr
;avance-version (07/04/04)
;HSQC
;2D H-1/X correlation via double inept transfer
;phase sensitive
;with decoupling during acquisition
;
;G. Bodenhausen & D.J. Ruben, Chem. Phys. Lett. 69, 185 (1980)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

#include <Avance.incl>
#include <Delay.incl>
#include <Grad.incl>

"p2=p1*2"
"d2=p2"
"p4=p3*2"
"p22=p21*2"
"d4=1s/(cnst2*4)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf2"
"d0=4u"

"DELTA=d4-p16-d16-larger(p1,p3)-0.6366*p1"
"DELTA1=d4-p19-d16-p10-p1-4u-0.6366*p1"
"DELTA2=d4-p19-d16-p10-p1-12u"
"acqt0=0"

define delay vdMin
"vdMin = 2*p19 + 2*d16"

; calculate offset for WFB
"spoff1=cnst21-o1"

aqseq 312

1 ze
  vdMin
  d11 pl12:f2
2 d11 do:f2
3 d12

  ; off-resonance presat
  30u pl9:f1
  30u fq=cnst21(bf hz):f1
  d1 cw:f1 ph1
  30u do:f1
  30u fq=0:f1

  ; purge equilibrium 13C
  30u UNBLKGRAD
  4u pl1:f1 pl2:f2
  (p3 ph1):f2
  p16:gp0
  d16

  ; begin main sequence
  (p1 ph1)
  p16:gp1
  d16
  DELTA
  (center (p2 ph1) (p4 ph1):f2 )
  DELTA
  p16:gp1
  d16
  (p1 ph2)

  ; zz purge
  p16:gp2
  d16

  ; 13C t1
  (p3 ph11):f2
  d0
  "TAU = vd*0.5 - p19 - d16"
  TAU
  p19:gp5
  d16
  (p4 ph1):f2
  4u
  p19:gp5
  d16
  TAU
  (p3 ph12):f2

  ; zz purge
  p16:gp3
  d16

  ; final inept
  (p1 ph1)
  p19:gp4
  d16
  DELTA1
  (p10:sp1 ph3):f1
  4u pl1:f1
  (center (p2 ph1) (p4 ph1):f2 )
  4u
  (p10:sp1 ph3):f1
  DELTA2
  p19:gp4
  d16
  4u BLKGRAD
  4u pl12:f2

  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
    F1QF(ivd)
    F2PH(ip11, id0)

exit

ph1=0
ph2=1
ph3=2
ph11=0 2
ph12=0 0 2 2
ph31=0 2 2 0

;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl12: f2 channel - power level for CPD/BB decoupling
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p4 : f2 channel - 180 degree high power pulse
;p10 : f1 channel - 90 degree selective pulse [1000 usec]
;sp1 : f1 channel - 90 degree WFB (p10)
;d0 : incremented delay (2D)
;d1 : relaxation delay; 1-5 * T1
;d4 : 1/(4J)XH
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d13: short delay                                    [4 usec]
;cnst2: = J(XH)
;cnst21: off-resonance presaturation frequency (bf hz)
;inf1: 1/SW(X) = DW(X)
;in0: 1/SW(X) = DW(X)
;nd0: 1
;NS: 2 * n
;DS: 16
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEQ
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz0: 46 %
;gpz1: 13 %
;gpz2: 17 %
;gpz3: 33 %
;gpz4: 29 %

;gradients
;p16: 1000u
;p19: 300u

;use gradient files:
;gpnam0: SMSQ10.100
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100
;gpnam4: SINE.10


tidying up sfhzdqcf3.cw sequence

tidying up sfhzdqcf3.cw sequence

;SOFAST-H(Z/D)QC
;  Waudby, Ouvry, Davis & Christodoulou (submitted, 2019)
;  for simultaneous collection of SOFAST-HZQC and SOFAST-HDQC spectra
;
;run as pseudo-3D (td1 = 2)
;process using nmrPipe scripts supplied

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*2)"

"in0=inf2"
"td1=2"
"l0=1"
"acqt0=de"

# ifdef ONE_D
"d0=0.1u"
#else
"d0=in0/2-p21*4/3.1415"
# endif /*ONE_D*/

"DELTA1=d21-p16-d16-p39*cnst39"
"DELTA2=p39*cnst39-de-4u"
"DELTA3=DELTA1-p40*0.5"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

aqseq 312

1 ze
  d11 pl26:f3
2 10m do:f3

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

  d12 pl3:f3
  50u UNBLKGRAD

  ; purge Nz
  (p21 ph1):f3
  p16:gp2
  d16

  ; begin main sequence
  (p39:sp23 ph11):f1
  p16:gp1
  d16

  if "l0 %2 == 1"
     {
  ; 1H 180 before d0
  (lalign (DELTA3 p40:sp24 ph1) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }
  else
     {
  ; 1H 180 after d0
  (ralign (p40:sp24 ph1 DELTA3 ) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }

  DELTA2
  p16:gp1
  d16 pl26:f3
  4u BLKGRAD

  go=2 ph31 cpd3:f3
  10m do:f3 mc #0 to 2
     F1QF(ip12)
     F2EA(rp12 & iu0, id0)

exit

ph1=0
ph2=0
ph11=0
ph12=0 2
ph31=0 2

;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 120 degree (Pc9_4_120.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (2657us at 700 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000              (1935us at 700 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;o1 : recommended to place on H(N) = cnst19
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)  [8.2 ppm]
;cnst21: frequency (in Hz) for off-resonance presaturation
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529
;NS: 2 * n
;DS: 16
;aq: <= 100 msec (with low power cpd, max. 50% duty cycle)
;td1: 2
;td2: number of experiments
;FnMODE[1]: QF
;FnMODE[2]: Echo-AntiEcho
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;Options:
;  -DOFFRES_PRESATURATION : off-resonance presaturation during d1 (cnst21, pl9)
;  -DONE_D : for 1D measurement with minimal evolution time (td2=1, td1=2)

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7
;
;for z-only gradients:
;gpz1: 11%
;gpz2:  7%
;
;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

;SOFAST-H(Z/D)QC
;run as pseudo-3D (td1 = 2), add and subtract to obtain Z/D components
;TODO check which is Z and D!
;
;Added option for off-resonance presat (e.g. to suppress urea signal), 21/6/15
;
;With option for 1D (first row)
;
;sfhmqcf3gpph
;avance-version (09/11/18)
;SOFAST HMQC
;2D H-1/X correlation via heteronuclear zero and double quantum
;   coherence
;phase sensitive
;with decoupling during acquisition
;
;P.Schanda and B. Brutscher, J. Am. Chem. Soc. 127, 8014 (2005)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*2)"

"in0=inf2"

# ifdef ONE_D
"d0=0.1u"
#else
"d0=in0/2-p21*4/3.1415"
# endif /*ONE_D*/

"DELTA1=d21-p16-d16-p39*cnst39"
"DELTA2=p39*cnst39-de-4u"
"DELTA3=DELTA1-p40*0.5"
"acqt0=de"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

"td1=2"
"l0=1"

aqseq 312

1 ze
  d11 pl26:f3
2 10m do:f3

# ifdef OFFRES_PRESAT

  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1

# else

  TAU

# endif /*OFFRES_PRESAT*/

3 d12 pl3:f3
  50u UNBLKGRAD

  ; purge Nz
  (p21 ph1):f3
  p16:gp2
  d16

  ; begin main sequence
  (p39:sp23 ph11):f1
  p16:gp1
  d16

  if "l0 %2 == 1"
     {
  (lalign (DELTA3 p40:sp24 ph1) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }
  else
     {
  (ralign (p40:sp24 ph1 DELTA3 ) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }

  DELTA2
  p16:gp1
  d16 pl26:f3
  4u BLKGRAD

  go=2 ph31 cpd3:f3
  10m do:f3 mc #0 to 2
     F1QF(ip12)
     F2EA(rp12 & iu0, id0)

exit

ph1=0
ph2=0
ph11=0
ph12=0 2
ph31=0 2

;pl3 : f3 channel - power level for pulse (default)
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 120 degree
;                   (Pc9_4_120.1000 or Q5.1000)
;sp24: f1 channel - shaped pulse 180 degree (Rsnob.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (3.0ms at 600.13 MHz)
;                  (or Q5.1000 (90o)            (2.0ms at 600.13 MHz) )
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Rsnob.1000               (1.0ms at 600.13 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_90.1000: 0.514
;           Pc9_4_120.1000: 0.529
;           Q5.1000: -0.07
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/ SW(N) = 2 * DW(N)
;nd0: 1
;NS: 2 * n
;DS: 16
;aq: <= 50 msec
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEC
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7

;for z-only gradients:
;gpz1: 11%
;gpz2:  7%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

;Processing

;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1

;$Id: sfhmqcf3gpph,v 1.1.2.8 2009/11/18 11:19:58 ber Exp $


b_trosyetf3gpsi.3.3d.cw - correct sw

b_trosyetf3gpsi.3.3d.cw - correct sw

;b_trosyetf3gpsi.3
;pseudo-3D for kinetics
;
;avance-version (15/03/12)
;best-TROSY
;2D H-1/X correlation via TROSY
;   using sensitivity improvement
;phase sensitive using Echo/Antiecho
;using f3 - channel
;using shaped pulses for inversion and refocussing on f3
;uncompensated version d25=d26
;with additional 180degree pulse on N-15
;(use parameterset B_TROSYETF3GPSI)
;
;Z. Solyom, M. Schwarten, L. Geist, R. Konrat D. Willbold &
;   Bernhard Brutscher, J. Biomol. NMR 55, 311-321 (2013)
;A. Favier & B. Brutscher, J. Biomol. NMR 49, 9-15 (2011)
;(E. Lescop, P. Schanda & B. Brutscher,
;   J. Magn. Reson.  187 163-169 (2007))
;(T. Schulte-Herbrueggen & O.W. Sorensen, J. Magn. Reson. 144,
;   123 - 128 (2000))
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

define list<gradient> EA3 = { 1.0000 0.8750 }
define list<gradient> EA5 = { 0.6667 1.0000 }
define list<gradient> EA7 = { 1.0000 0.6595 }

"d11=30m"

"d25=2.7m"
"d26=2.7m"

"p19=500u"
"p29=250u"

#   ifdef CALC_SP
"p41=(bwfac25/(cnst55*cnst51*bf1))*1000000"
"spw25=plw1/((p41*90.0)/(p1*totrot25))*((p41*90.0)/(p1*totrot25))*(integfac25*integfac25)"
"spw27=plw1/((p41*90.0)/(p1*totrot27))*((p41*90.0)/(p1*totrot27))*(integfac27*integfac27)"
"spoal25=1"
"spoal27=0"

"p42=(bwfac26/(cnst55*cnst52*bf1))*1000000"
"spw26=plw1/((p42*90.0)/(p1*totrot26))*((p42*90.0)/(p1*totrot26))*(integfac26*integfac26)"
"spoal26=0.5"

"p43=(bwfac28/(cnst55*cnst53*bf1))*1000000"
"spw28=plw1/((p43*90.0)/(p1*totrot28))*((p43*90.0)/(p1*totrot28))*(integfac28*integfac28)"
"spw29=plw1/((p43*90.0)/(p1*totrot29))*((p43*90.0)/(p1*totrot29))*(integfac29*integfac29)"
"spoal28=1"
"spoal29=0"
#   endif /*CALC_SP*/

"d0=3u"

"in0=inf2/2"

"DELTA1=d26-p29-d16-larger(p56,p42)/2-p41*cnst41"
"DELTA6=d25-p29-d16-larger(p56,p42)/2-p43*cnst43"
"DELTA7=d26-p16-d16-larger(p57,p42)/2"
"DELTA8=de+4u"

#   ifdef LABEL_CN
"DELTA=d0*2+p8+p21*4/PI+de+4u"
#   else
"DELTA=d0*2+p21*4/PI+de+4u"
#   endif /*LABEL_CN*/

"spoff13=bf2*(cnst26/1000000)-o2"

"spoff25=bf1*(cnst54/1000000)-o1"
"spoff26=bf1*(cnst54/1000000)-o1"
"spoff28=bf1*(cnst54/1000000)-o1"
"spoff27=bf1*(cnst54/1000000)-o1"
"spoff29=bf1*(cnst54/1000000)-o1"

"spoff39=0"
"spoff40=0"

"acqt0=0"
baseopt_echo

aqseq 321

1 d11 ze
2 3m

  (p56:sp39 ph1):f3
  d1
  50u UNBLKGRAD

  (p41:sp25 ph1)
  p29:gp1
  d16
  DELTA1
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA1
  p29:gp1
  d16
  (p41:sp27 ph2):f1

  p29:gp2
  d16 pl3:f3

  (p21 ph5):f3
  d0

#   ifdef LABEL_CN
  (p8:sp13 ph1):f2
#   else
#   endif /*LABEL_CN*/

  d0
  (p56:sp39 ph1):f3
  DELTA

  p19:gp3*EA3
  d16

  (p43:sp29 ph6)
  p29:gp4
  d16
  DELTA6
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA6
  p29:gp4
  d16
  (p43:sp28 ph1)

  p19:gp5*EA5
  d16 pl3:f3
  DELTA8

  (p21 ph2):f3
  p16:gp6
  d16
  DELTA7
  (center (p42:sp26 ph1) (p57:sp40 ph1):f3 )
  DELTA7
  p16:gp6
  d16 pl3:f3
  (p21 ph7:r):f3

  p19:gp7*EA7
  d16
  4u BLKGRAD

  go=2 ph31
  3m mc #0 to 2
     F2EA(calgrad(EA3) & calgrad(EA5) & calgrad(EA7) & calph(ph6, +180) & calph(ph7, +180), caldel(d0, +in0) & calph(ph5, +180) & calph(ph31, +180))
     F1QF()
exit

ph1=0
ph2=1
ph3=2
ph4=3
ph5=0 2
ph6=3
ph7=2
ph31=0 2

;pl1 : f1 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;sp13: f2 channel - shaped pulse 180 degree (Ca and C=O, adiabatic)
;sp25: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;sp26: f1 channel - shaped pulse 180 degree (Reburp.1000)
;sp27: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;                   for time reversed pulse
;sp28: f1 channel - shaped pulse  90 degree (Eburp2.1000)
;sp29: f1 channel - shaped pulse  90 degree (Eburp2tr.1000)
;                   for time reversed pulse
;sp39: f3 channel - shaped pulse 180 degree (Bip720,50,20.1)
;sp40: f3 channel - shaped pulse 180 degree (Reburp.1000)
;sp26: f1 channel - shaped pulse 180 degree (Reburp.1000)
;sp28: f1 channel - shaped pulse  90 degree (Eburp2.1000)
;sp29: f1 channel - shaped pulse  90 degree (Eburp2tr.1000)
;                   for time reversed pulse
;p8 : f2 channel - 180 degree shaped pulse for inversion (adiabatic)
;p16: homospoil/gradient pulse                         [1 msec]
;p19: gradient pulse 2                                 [500 usec]
;p21: f3 channel -  90 degree high power pulse
;p29: gradient pulse 3                                 [250 usec]
;p41: f1 channel -  90 degree shaped pulse for excitation
;                      Pc9_4_90.1000             (2.2ms at 600.13 MHz)
;p42: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.4ms at 600.13 MHz)
;p43: f1 channel -  90 degree shaped pulse for excitation
;                      Eburp2.1000/Eburp2tr.1000 (1.7ms at 600.13 MHz)
;p56: f3 channel - 180 degree shaped pulse for inversion
;                      Bip720,50,20.1            (500us at 600.13 MHz)
;p57: f3 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.6ms at 600.13 MHz)
;p42: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (2.0ms at 600.13 MHz)
;p43: f1 channel -  90 degree shaped pulse for excitation
;                      Eburp2.1000/Eburp2tr.1000 (1.92ms at 600.13 MHz)
;p56: f3 channel - 180 degree shaped pulse for inversion
;p57: f3 channel - 180 degree shaped pulse for refocussing
;d0 : incremented delay (F1)                           [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d11: delay for disk I/O                               [30 msec]
;d16: delay for homospoil/gradient recovery
;d25: 1/(4J'(NH)                                       [2.7 msec]
;d26: 1/(4J(NH)                                        [2.7 msec]
;cnst26: Call chemical shift (offset, in ppm)          [101 ppm]
;cnst41: compensation of chemical shift evolution during p41
;           Pc9_4_90.1000: 0.529
;cnst43: compensation of chemical shift evolution during p43
;           Eburp2.1000: 0.69
;cnst51: scaling factor for p41 to compensate for transition region
;           Pc9_4_90.1000: 1.172
;cnst52: scaling factor for p42 to compensate for transition region
;           Reburp.1000: 1.426
;cnst53: scaling factor for p43 to compensate for transition region
;           Eburp2.1000: 1.000
;cnst54: H(N) chemical shift (offset, in ppm)
;cnst55: H(N) bandwidth (in ppm)
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/(2 * SW(N)) = DW(N)
;nd0: 2
;ns: 2 * n
;ds: >= 16
;td1: number of experiments
;FnMODE: echo-antiecho

;for z-only gradients:
;gpz1: 2%
;gpz2: 21%
;gpz3: -80%
;gpz4: 5%
;gpz5: 30%
;gpz6: 45%
;gpz7: 30.13%

;use gradient files:
;gpnam1: SMSQ10.32
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100
;gpnam4: SMSQ10.32
;gpnam5: SMSQ10.100
;gpnam6: SMSQ10.100
;gpnam7: SMSQ10.100

                                          ;preprocessor-flags-start
;CALC_SP: for calculation of all bandselective Proton pulses based on cnst54 and cnst55
;             option -DCALC_SP (eda: ZGOPTNS)
;LABEL_CN: for C-13 and N-15 labeled samples start experiment with
;             option -DLABEL_CN (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;Processing

;PHC0(F1): 45.0

;$Id: b_trosyetf3gpsi.3,v 1.1.2.2 2015/03/12 17:07:08 ber Exp $

;b_trosyetf3gpsi.3
;pseudo-3D for kinetics
;
;avance-version (15/03/12)
;best-TROSY
;2D H-1/X correlation via TROSY
;   using sensitivity improvement
;phase sensitive using Echo/Antiecho
;using f3 - channel
;using shaped pulses for inversion and refocussing on f3
;uncompensated version d25=d26
;with additional 180degree pulse on N-15
;(use parameterset B_TROSYETF3GPSI)
;
;Z. Solyom, M. Schwarten, L. Geist, R. Konrat D. Willbold &
;   Bernhard Brutscher, J. Biomol. NMR 55, 311-321 (2013)
;A. Favier & B. Brutscher, J. Biomol. NMR 49, 9-15 (2011)
;(E. Lescop, P. Schanda & B. Brutscher,
;   J. Magn. Reson.  187 163-169 (2007))
;(T. Schulte-Herbrueggen & O.W. Sorensen, J. Magn. Reson. 144,
;   123 - 128 (2000))
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

define list<gradient> EA3 = { 1.0000 0.8750 }
define list<gradient> EA5 = { 0.6667 1.0000 }
define list<gradient> EA7 = { 1.0000 0.6595 }

"d11=30m"

"d25=2.7m"
"d26=2.7m"

"p19=500u"
"p29=250u"

#   ifdef CALC_SP
"p41=(bwfac25/(cnst55*cnst51*bf1))*1000000"
"spw25=plw1/((p41*90.0)/(p1*totrot25))*((p41*90.0)/(p1*totrot25))*(integfac25*integfac25)"
"spw27=plw1/((p41*90.0)/(p1*totrot27))*((p41*90.0)/(p1*totrot27))*(integfac27*integfac27)"
"spoal25=1"
"spoal27=0"

"p42=(bwfac26/(cnst55*cnst52*bf1))*1000000"
"spw26=plw1/((p42*90.0)/(p1*totrot26))*((p42*90.0)/(p1*totrot26))*(integfac26*integfac26)"
"spoal26=0.5"

"p43=(bwfac28/(cnst55*cnst53*bf1))*1000000"
"spw28=plw1/((p43*90.0)/(p1*totrot28))*((p43*90.0)/(p1*totrot28))*(integfac28*integfac28)"
"spw29=plw1/((p43*90.0)/(p1*totrot29))*((p43*90.0)/(p1*totrot29))*(integfac29*integfac29)"
"spoal28=1"
"spoal29=0"
#   endif /*CALC_SP*/

"d0=3u"

"in0=inf1/2"

"DELTA1=d26-p29-d16-larger(p56,p42)/2-p41*cnst41"
"DELTA6=d25-p29-d16-larger(p56,p42)/2-p43*cnst43"
"DELTA7=d26-p16-d16-larger(p57,p42)/2"
"DELTA8=de+4u"

#   ifdef LABEL_CN
"DELTA=d0*2+p8+p21*4/PI+de+4u"
#   else
"DELTA=d0*2+p21*4/PI+de+4u"
#   endif /*LABEL_CN*/

"spoff13=bf2*(cnst26/1000000)-o2"

"spoff25=bf1*(cnst54/1000000)-o1"
"spoff26=bf1*(cnst54/1000000)-o1"
"spoff28=bf1*(cnst54/1000000)-o1"
"spoff27=bf1*(cnst54/1000000)-o1"
"spoff29=bf1*(cnst54/1000000)-o1"

"spoff39=0"
"spoff40=0"

"acqt0=0"
baseopt_echo

aqseq 321

1 d11 ze
2 3m

  (p56:sp39 ph1):f3
  d1
  50u UNBLKGRAD

  (p41:sp25 ph1)
  p29:gp1
  d16
  DELTA1
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA1
  p29:gp1
  d16
  (p41:sp27 ph2):f1

  p29:gp2
  d16 pl3:f3

  (p21 ph5):f3
  d0

#   ifdef LABEL_CN
  (p8:sp13 ph1):f2
#   else
#   endif /*LABEL_CN*/

  d0
  (p56:sp39 ph1):f3
  DELTA

  p19:gp3*EA3
  d16

  (p43:sp29 ph6)
  p29:gp4
  d16
  DELTA6
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA6
  p29:gp4
  d16
  (p43:sp28 ph1)

  p19:gp5*EA5
  d16 pl3:f3
  DELTA8

  (p21 ph2):f3
  p16:gp6
  d16
  DELTA7
  (center (p42:sp26 ph1) (p57:sp40 ph1):f3 )
  DELTA7
  p16:gp6
  d16 pl3:f3
  (p21 ph7:r):f3

  p19:gp7*EA7
  d16
  4u BLKGRAD

  go=2 ph31
  3m mc #0 to 2
     F2EA(calgrad(EA3) & calgrad(EA5) & calgrad(EA7) & calph(ph6, +180) & calph(ph7, +180), caldel(d0, +in0) & calph(ph5, +180) & calph(ph31, +180))
     F1QF()
exit

ph1=0
ph2=1
ph3=2
ph4=3
ph5=0 2
ph6=3
ph7=2
ph31=0 2

;pl1 : f1 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;sp13: f2 channel - shaped pulse 180 degree (Ca and C=O, adiabatic)
;sp25: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;sp26: f1 channel - shaped pulse 180 degree (Reburp.1000)
;sp27: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;                   for time reversed pulse
;sp28: f1 channel - shaped pulse  90 degree (Eburp2.1000)
;sp29: f1 channel - shaped pulse  90 degree (Eburp2tr.1000)
;                   for time reversed pulse
;sp39: f3 channel - shaped pulse 180 degree (Bip720,50,20.1)
;sp40: f3 channel - shaped pulse 180 degree (Reburp.1000)
;sp26: f1 channel - shaped pulse 180 degree (Reburp.1000)
;sp28: f1 channel - shaped pulse  90 degree (Eburp2.1000)
;sp29: f1 channel - shaped pulse  90 degree (Eburp2tr.1000)
;                   for time reversed pulse
;p8 : f2 channel - 180 degree shaped pulse for inversion (adiabatic)
;p16: homospoil/gradient pulse                         [1 msec]
;p19: gradient pulse 2                                 [500 usec]
;p21: f3 channel -  90 degree high power pulse
;p29: gradient pulse 3                                 [250 usec]
;p41: f1 channel -  90 degree shaped pulse for excitation
;                      Pc9_4_90.1000             (2.2ms at 600.13 MHz)
;p42: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.4ms at 600.13 MHz)
;p43: f1 channel -  90 degree shaped pulse for excitation
;                      Eburp2.1000/Eburp2tr.1000 (1.7ms at 600.13 MHz)
;p56: f3 channel - 180 degree shaped pulse for inversion
;                      Bip720,50,20.1            (500us at 600.13 MHz)
;p57: f3 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.6ms at 600.13 MHz)
;p42: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (2.0ms at 600.13 MHz)
;p43: f1 channel -  90 degree shaped pulse for excitation
;                      Eburp2.1000/Eburp2tr.1000 (1.92ms at 600.13 MHz)
;p56: f3 channel - 180 degree shaped pulse for inversion
;p57: f3 channel - 180 degree shaped pulse for refocussing
;d0 : incremented delay (F1)                           [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d11: delay for disk I/O                               [30 msec]
;d16: delay for homospoil/gradient recovery
;d25: 1/(4J'(NH)                                       [2.7 msec]
;d26: 1/(4J(NH)                                        [2.7 msec]
;cnst26: Call chemical shift (offset, in ppm)          [101 ppm]
;cnst41: compensation of chemical shift evolution during p41
;           Pc9_4_90.1000: 0.529
;cnst43: compensation of chemical shift evolution during p43
;           Eburp2.1000: 0.69
;cnst51: scaling factor for p41 to compensate for transition region
;           Pc9_4_90.1000: 1.172
;cnst52: scaling factor for p42 to compensate for transition region
;           Reburp.1000: 1.426
;cnst53: scaling factor for p43 to compensate for transition region
;           Eburp2.1000: 1.000
;cnst54: H(N) chemical shift (offset, in ppm)
;cnst55: H(N) bandwidth (in ppm)
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/(2 * SW(N)) = DW(N)
;nd0: 2
;ns: 2 * n
;ds: >= 16
;td1: number of experiments
;FnMODE: echo-antiecho

;for z-only gradients:
;gpz1: 2%
;gpz2: 21%
;gpz3: -80%
;gpz4: 5%
;gpz5: 30%
;gpz6: 45%
;gpz7: 30.13%

;use gradient files:
;gpnam1: SMSQ10.32
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100
;gpnam4: SMSQ10.32
;gpnam5: SMSQ10.100
;gpnam6: SMSQ10.100
;gpnam7: SMSQ10.100

                                          ;preprocessor-flags-start
;CALC_SP: for calculation of all bandselective Proton pulses based on cnst54 and cnst55
;             option -DCALC_SP (eda: ZGOPTNS)
;LABEL_CN: for C-13 and N-15 labeled samples start experiment with
;             option -DLABEL_CN (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;Processing

;PHC0(F1): 45.0

;$Id: b_trosyetf3gpsi.3,v 1.1.2.2 2015/03/12 17:07:08 ber Exp $


updating comments for sfhmqcf3gpph.cw

updating comments for sfhmqcf3gpph.cw

;Added option for off-resonance presat (e.g. to suppress urea signal), 21/6/15
;
;With option for 1D (first row)
;
;sfhmqcf3gpph
;avance-version (09/11/18)
;SOFAST HMQC
;2D H-1/X correlation via heteronuclear zero and double quantum
;   coherence
;phase sensitive
;with decoupling during acquisition
;
;P.Schanda and B. Brutscher, J. Am. Chem. Soc. 127, 8014 (2005)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"cnst4=92"

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*2)"

"in0=inf1"

# ifndef ONE_D

"d0=in0/2-p21*4/3.1415"

# endif /*ONE_D*/

"DELTA1=d21-p16-d16-p39*cnst39"
"DELTA2=p39*cnst39-de-4u"
"acqt0=de"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

1 ze
  d11 pl26:f3
2 10m do:f3

# ifdef OFFRES_PRESAT

  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1

# else

  TAU

# endif /*OFFRES_PRESAT*/

3 d12 pl3:f3
  50u UNBLKGRAD

  p16:gp2
  d16

  (p39:sp23 ph1):f1
  p16:gp1
  d16

# ifndef ONE_D

#   ifdef LABEL_CN
  (center (p40:sp24 ph2):f1 (p8:sp13 ph1):f2 (DELTA1 p21 ph3 d0 p21 ph4 DELTA1):f3 )
#   else
  (center (p40:sp24 ph2):f1 (DELTA1 p21 ph3 d0 p21 ph4 DELTA1):f3 )
#   endif /*LABEL_CN*/

# else

 (center (p40:sp24 ph2):f1 (DELTA1 p21 ph3 6u p21 ph4 DELTA1):f3 )

# endif /*ONE_D*/

  DELTA2
  p16:gp1
  d16 pl26:f3
  4u BLKGRAD
  go=2 ph31 cpd3:f3
  10m do:f3 mc #0 to 2
     F1PH(ip3, id0)
exit

ph1=0
ph2=0
ph3=0 2
ph4=0 0 2 2
ph29=0
ph31=0 2 2 0

;pl3 : f3 channel - power level for pulse (default)
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp13: f2 channel - shaped pulse 180 degree (adiabatic)
;sp23: f1 channel - shaped pulse 120 degree (Pc9_4_120.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p8 : f2 channel - 180 degree shaped pulse for inversion (adiabatic)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (2325 us at 800 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000              (1700 us at 800  MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)  [8.2 ppm]
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/ SW(N) = 2 * DW(N)
;nd0: 1
;NS: 2 * n
;DS: 16
;aq: <= 50 msec
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEC
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7

;for z-only gradients:
;gpz1: 11%
;gpz2:  7%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

                                          ;preprocessor-flags-start
;LABEL_CN: for C-13 and N-15 labeled samples start experiment with
;             option -DLABEL_CN (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;Processing

;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1

;Added option for off-resonance presat (e.g. to suppress urea signal), 21/6/15
;
;With option for 1D (first row)
;
;sfhmqcf3gpph
;avance-version (09/11/18)
;SOFAST HMQC
;2D H-1/X correlation via heteronuclear zero and double quantum
;   coherence
;phase sensitive
;with decoupling during acquisition
;
;P.Schanda and B. Brutscher, J. Am. Chem. Soc. 127, 8014 (2005)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"cnst4=92"

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*2)"

"in0=inf1"

# ifndef ONE_D

"d0=in0/2-p21*4/3.1415"

# endif /*ONE_D*/

"DELTA1=d21-p16-d16-p39*cnst39"
"DELTA2=p39*cnst39-de-4u"
"acqt0=de"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

1 ze
  d11 pl26:f3
2 10m do:f3

# ifdef OFFRES_PRESAT

  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1

# else

  TAU

# endif /*OFFRES_PRESAT*/

3 d12 pl3:f3
  50u UNBLKGRAD

  p16:gp2
  d16

  (p39:sp23 ph1):f1
  p16:gp1
  d16

# ifndef ONE_D

#   ifdef LABEL_CN
  (center (p40:sp24 ph2):f1 (p8:sp13 ph1):f2 (DELTA1 p21 ph3 d0 p21 ph4 DELTA1):f3 )
#   else
  (center (p40:sp24 ph2):f1 (DELTA1 p21 ph3 d0 p21 ph4 DELTA1):f3 )
#   endif /*LABEL_CN*/

# else

 (center (p40:sp24 ph2):f1 (DELTA1 p21 ph3 6u p21 ph4 DELTA1):f3 )

# endif /*ONE_D*/

  DELTA2
  p16:gp1
  d16 pl26:f3
  4u BLKGRAD
  go=2 ph31 cpd3:f3
  10m do:f3 mc #0 to 2
     F1PH(ip3, id0)
exit

ph1=0
ph2=0
ph3=0 2
ph4=0 0 2 2
ph29=0
ph31=0 2 2 0

;pl3 : f3 channel - power level for pulse (default)
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp13: f2 channel - shaped pulse 180 degree (adiabatic)
;sp23: f1 channel - shaped pulse 120 degree
;                   (Pc9_4_120.1000 or Q5.1000)
;sp24: f1 channel - shaped pulse 180 degree (Rsnob.1000)
;p8 : f2 channel - 180 degree shaped pulse for inversion (adiabatic)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (3.0ms at 600.13 MHz)
;                  (or Q5.1000 (90o)            (2.0ms at 600.13 MHz) )
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Rsnob.1000               (1.0ms at 600.13 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529
;           Q5.1000: -0.07
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/ SW(N) = 2 * DW(N)
;nd0: 1
;NS: 2 * n
;DS: 16
;aq: <= 50 msec
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEC
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7

;for z-only gradients:
;gpz1: 11%
;gpz2:  7%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

                                          ;preprocessor-flags-start
;LABEL_CN: for C-13 and N-15 labeled samples start experiment with
;             option -DLABEL_CN (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;Processing

;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1

;$Id: sfhmqcf3gpph,v 1.1.2.8 2009/11/18 11:19:58 ber Exp $


updating comments for sfhzdqc_ch3.cw

updating comments for sfhzdqc_ch3.cw

;methyl-SOFAST-H(Z/D)QC
;with multiplet filter
;run as 2D with td = 6 * actual td
;aqmod QF - sw WILL be correctly calculated
;
;Chris Waudby, 9/10/18
;
;Added option for off-resonance presat (e.g. to suppress urea signal), 21/6/15

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst2*2)"
"d22=1s/(cnst2*8)"
"p4=p3*2"

"in0=inf1"
"d0=in0/2"

"DELTA1=d21-p16-d16*2-p39*cnst39"
"DELTA2=d21-p16-d16*2-4u-de"
"DELTA3=d22+d16-p40*0.5"
"DELTA4=d22-p3*1.6366"
"acqt0=de"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

"l0=0"

1 ze
  d11 pl12:f2
2 10m do:f2

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

3 d12 pl2:f2
  50u UNBLKGRAD

  ; purge Cz
  (p3 ph1):f2
  p16:gp2
  d16

  ; begin main sequence
  (p39:sp23 ph13):f1
  p16:gp1
  d16
  DELTA1

  if "l0 % 4 == 0"
     {
  (lalign (DELTA3 p40:sp24 ph1) (d16 p3 ph11 DELTA4 p4 ph1 d0 DELTA4 p3 ph12 d16):f2)
     }
  if "l0 % 4 == 1"
     {
  (lalign (DELTA3 p40:sp24 ph1) (d16 p3 ph21 DELTA4 d0 p4 ph1 DELTA4 p3 ph22 d16):f2)
     }
  if "l0 % 4 == 2"
     {
  (lalign (DELTA3 d0 p40:sp24 ph1) (d16 p3 ph11 DELTA4 d0 p4 ph1 DELTA4 p3 ph12 d16):f2)
     }
  if "l0 % 4 == 3"
     {
  (lalign (DELTA3 d0 p40:sp24 ph1) (d16 p3 ph21 DELTA4 p4 ph1 d0 DELTA4 p3 ph22 d16):f2)
     }

  DELTA2
  p16:gp1
  d16 pl12:f2
  4u BLKGRAD

  go=2 ph31 cpd2:f2
  10m do:f2 mc #0 to 2
     F1I(ip11*2 & ip21*2, 3, iu0, 4)
     F1QF(id0)

exit

ph1=0
ph11=(6) 0 ;2 4
ph21=(6) 3 ;5 1
ph12=0 2
ph22=2 0
ph13=0 0 2 2
ph29=0
ph31=0 2 2 0

;pl2 : f2 channel - power level for pulse (default)
;pl12: f2 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 120 degree (Pc9_4_120.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p3:  f2 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Rsnob.1000
;d0 : incremented delay (2D)
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(CH) [125 Hz for methyls]
;cnst19: H(met) chemical shift (offset, in ppm)
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529
;inf1: 1/SW(C) = 2 * DW(C)
;in0: 1/ SW(C) = 2 * DW(C)
;nd0: 1
;NS: 2 * n
;DS: 16
;aq: <= 50 msec
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEC
;cpd2: decoupling according to sequence defined by cpdprg2: garp4
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7

;for z-only gradients:
;gpz1: 11%
;gpz2:  7%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

;Processing

;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1

;methyl-SOFAST-H(Z/D)QC
;with multiplet filter
;run as 2D with td = 6 * actual td
;aqmod QF - sw WILL be correctly calculated
;
;Chris Waudby, 9/10/18
;
;Added option for off-resonance presat (e.g. to suppress urea signal), 21/6/15
;
;sfhmqcf3gpph
;avance-version (09/11/18)
;SOFAST HMQC
;2D H-1/X correlation via heteronuclear zero and double quantum
;   coherence
;phase sensitive
;with decoupling during acquisition
;
;P.Schanda and B. Brutscher, J. Am. Chem. Soc. 127, 8014 (2005)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst2*2)"
"d22=1s/(cnst2*8)"
"p4=p3*2"

"in0=inf1"
"d0=in0/2"

"DELTA1=d21-p16-d16*2-p39*cnst39"
"DELTA2=d21-p16-d16*2-4u-de"
"DELTA3=d22+d16-p40*0.5"
"DELTA4=d22-p3*1.6366"
"acqt0=de"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

;"spoff23=bf1*(cnst19/1000000)-o1"
;"spoff24=bf1*(cnst19/1000000)-o1"

"l0=0"

1 ze
  d11 pl12:f2
2 10m do:f2

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

3 d12 pl2:f2
  50u UNBLKGRAD

  ; purge Cz
  (p3 ph1):f2
  p16:gp2
  d16

  ; begin main sequence
  (p39:sp23 ph13):f1
  p16:gp1
  d16
  DELTA1

  if "l0 % 4 == 0"
     {
  (lalign (DELTA3 p40:sp24 ph1) (d16 p3 ph11 DELTA4 p4 ph1 d0 DELTA4 p3 ph12 d16):f2)
     }
  if "l0 % 4 == 1"
     {
  (lalign (DELTA3 p40:sp24 ph1) (d16 p3 ph21 DELTA4 d0 p4 ph1 DELTA4 p3 ph22 d16):f2)
     }
  if "l0 % 4 == 2"
     {
  (lalign (DELTA3 d0 p40:sp24 ph1) (d16 p3 ph11 DELTA4 d0 p4 ph1 DELTA4 p3 ph12 d16):f2)
     }
  if "l0 % 4 == 3"
     {
  (lalign (DELTA3 d0 p40:sp24 ph1) (d16 p3 ph21 DELTA4 p4 ph1 d0 DELTA4 p3 ph22 d16):f2)
     }

  DELTA2
  p16:gp1
  d16 pl12:f2
  4u BLKGRAD

  go=2 ph31 cpd2:f2
  10m do:f2 mc #0 to 2
     F1I(ip11*2 & ip21*2, 3, iu0, 4)
     F1QF(id0)

exit

ph1=0
ph11=(6) 0 ;2 4
ph21=(6) 3 ;5 1
ph12=0 2
ph22=2 0
ph13=0 0 2 2
ph29=0
ph31=0 2 2 0

;pl3 : f3 channel - power level for pulse (default)
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 120 degree
;                   (Pc9_4_120.1000 or Q5.1000)
;sp24: f1 channel - shaped pulse 180 degree (Rsnob.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (3.0ms at 600.13 MHz)
;                  (or Q5.1000 (90o)            (2.0ms at 600.13 MHz) )
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Rsnob.1000               (1.0ms at 600.13 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_90.1000: 0.514
;           Pc9_4_120.1000: 0.529
;           Q5.1000: -0.07
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/ SW(N) = 2 * DW(N)
;nd0: 1
;NS: 2 * n
;DS: 16
;aq: <= 50 msec
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEC
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7

;for z-only gradients:
;gpz1: 11%
;gpz2:  7%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

;Processing

;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1

;$Id: sfhmqcf3gpph,v 1.1.2.8 2009/11/18 11:19:58 ber Exp $


testing b_hncocacbgp3d.2.nuws.cw

testing b_hncocacbgp3d.2.nuws.cw

;b_hncocacbgp3d.2.nuws.cw
;with NUWS in 15N dimension (for highly folded spectra)
;NB acquistion order 312 not 321
;Chris Waudby Dec 2017
;
;avance-version (15/03/12)
;best-HN(CO)CACB
;3D sequence with
;   inverse correlation for triple resonance using multiple
;      inept transfer steps
;
;      F1(H) -> F3(N) -> F2(C=O) -> F2(Ca -> Cb,t1)
;            -> F2(C=O) -> F3(N,t2) -> F1(H,t3)
;
;on/off resonance Ca and C=O pulses using shaped pulse
;using shaped pulses for inversion and refocussing on f3
;phase sensitive (t1)
;phase sensitive using Echo/Antiecho (t2)
;using semi constant time in t2
;(use parameterset B_HNCOCACBGP3D)
;
;P. Schanda, H. v. Melckebeke & B. Brutscher,
;   J. Am. Chem. Soc. 128, 9042-9043 (2006)
;E. Lescop, P. Schanda & B. Brutscher,
;   J. Magn. Reson.  187 163-169 (2007)
;(S. Grzesiek & A. Bax, J. Magn. Reson. 96, 432 - 440 (1992))
;(J. Schleucher, M. Sattler & C. Griesinger,
;   Angew. Chem. Int. Ed. 32, 1489-1491 (1993))
;(L.E. Kay, G.Y. Xu & T. Yamazaki, J. Magn. Reson. A109,
;   129-133 (1994))
;
;$CLASS=HighRes
;$DIM=3D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

define loopcounter dsFlag
"dsFlag=1"

"d11=30m"

"d22=4.5m"
"d23=12m"
"d26=2.7m"

#   ifdef LABEL_CB
"d28=7.2m"
#   else
"d28=3.6m"
#   endif /*LABEL_CB*/

"p29=250u"

#   ifdef CALC_SP
"p41=(bwfac25/(cnst55*cnst51*bf1))*1000000"
"spw25=plw1/((p41*90.0)/(p1*totrot25))*((p41*90.0)/(p1*totrot25))*(integfac25*integfac25)"
"spw27=plw1/((p41*90.0)/(p1*totrot27))*((p41*90.0)/(p1*totrot27))*(integfac27*integfac27)"
"spoal25=1"
"spoal27=0"

"p42=(bwfac26/(cnst55*cnst52*bf1))*1000000"
"spw26=plw1/((p42*90.0)/(p1*totrot26))*((p42*90.0)/(p1*totrot26))*(integfac26*integfac26)"
"spoal26=0.5"

"p43=(bwfac28/(cnst55*cnst53*bf1))*1000000"
"spw28=plw1/((p43*90.0)/(p1*totrot28))*((p43*90.0)/(p1*totrot28))*(integfac28*integfac28)"
"spw29=plw1/((p43*90.0)/(p1*totrot29))*((p43*90.0)/(p1*totrot29))*(integfac29*integfac29)"
"spoal28=1"
"spoal29=0"
#   endif /*CALC_SP*/

"d0=3u"
"d10=3u"
"d29=3u"
"d30=d23-p43-4u-p21*4/PI"

"in0=inf1/2"
"in10=inf2/2"

"FACTOR2=d30*10000000*2/td2"
"INCR2=FACTOR2/10000000"

"if ( INCR2 > in10 ) { in30 = in10; } else { in30 = INCR2; }"
"if ( INCR2 > in10 ) { in29 = 0; } else { in29=in10-INCR2; }"

"TAU=larger(p14,p44)"

"DELTA=d0*2+larger(TAU,p56)-TAU"
"DELTA1=d26-p29-d16-p41*cnst41-larger(p42,p56)/2"
"DELTA2=d23-d26-p44-p16-d16-p14-d29"
"DELTA3=d26-p19-d16-p42/2"
"DELTA4=d26-p29-d16-p43*cnst43-larger(p42,p56)/2"
"DELTA5=p16+d16+de+8u"
"DELTA6=d23-larger(p42,p57)/2"
"DELTA7=d23-larger(p42,p57)/2-p44-d26"
"DELTA8=d26-p14-d10"
"DELTA9=d22-p14-4u"

"spoff2=0"
"spoff3=0"
"spoff5=bf2*((cnst22-cnst21)/1000000)"
"spoff7=bf2*((cnst21-cnst23)/1000000)"
"spoff8=0"

"spoff25=bf1*(cnst54/1000000)-o1"
"spoff26=bf1*(cnst54/1000000)-o1"
"spoff27=bf1*(cnst54/1000000)-o1"
"spoff28=bf1*(cnst54/1000000)-o1"
"spoff29=bf1*(cnst54/1000000)-o1"
"spoff30=0"

; number of complex points
"l3=td1/2"
"l6=td2/2"

aqseq 312

"acqt0=0"
baseopt_echo

1 d11 ze
  d11 pl26:f3
2 d11 do:f3
3 d1 fq=cnst21(bf ppm):f2
  50u UNBLKGRAD

  (p41:sp25 ph1)
  p29:gp3
  d16
  DELTA1
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA1
  p29:gp3
  d16
  (p41:sp27 ph2):f1

  p16:gp4
  d16 pl3:f3

  (p21 ph1):f3
  DELTA6
  (center (p14:sp3 ph1):f2 (p57:sp40 ph1):f3 )
  DELTA7
  (p44:sp30 ph1)
  d26 pl3:f3
  (p21 ph1):f3
  (p44:sp30 ph1)

  p16:gp5
  d16

  (p13:sp2 ph3):f2
  4u
  (p14:sp5 ph1):f2
  DELTA9
  (p14:sp3 ph1):f2
  4u
  (p14:sp5 ph1):f2
  DELTA9
  (p13:sp8 ph2):f2

  4u
  30u fq=cnst23(bf ppm):f2

  (p13:sp2 ph4):f2
  d28
  (p14:sp3 ph1):f2
  d28
  (p13:sp8 ph2):f2
  d0
  (center (p44:sp30 ph1) (p14:sp7 ph1):f2 (p56:sp39 ph7):f3 )
  d0
  4u
  (p14:sp3 ph1):f2
  DELTA
  (center (p44:sp30 ph1) (p14:sp7 ph1):f2 )
  4u
  (p13:sp2 ph9):f2
  d28
  (p14:sp3 ph1):f2
  d28
  (p13:sp8 ph10):f2

  4u
  30u fq=cnst21(bf ppm):f2

  (p13:sp2 ph2):f2
  DELTA9
  (p14:sp5 ph1):f2
  4u
  (p14:sp3 ph1):f2
  DELTA9
  (p14:sp5 ph1):f2
  4u
  (p13:sp8 ph1):f2

  p16:gp6
  d16 pl3:f3

  (p44:sp30 ph1)
  (p21 ph8):f3
  2u
  (p56:sp39 ph1):f3
  d10
  (p14:sp5 ph1):f2
  DELTA8
  (p44:sp30 ph1)
  DELTA2
  p16:gp1*EA
  d16
  (p14:sp3 ph1):f2
  d29
  (p56:sp39 ph7):f3
  d30
  2u pl3:f3
  (p43:sp28 ph1)
  (p21 ph5):f3
  p19:gp7
  d16
  DELTA3
  (center (p42:sp26 ph1) (p57:sp40 ph1):f3 )
  DELTA3
  p19:gp7
  d16 pl3:f3
  (p21 ph6):f3

  (p43:sp29 ph2)
  p29:gp8
  d16
  DELTA4
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA4
  p29:gp8
  d16
  (p43:sp28 ph1)
  DELTA5
  (p42:sp26 ph1)
  4u
  p16:gp2
  d16 pl26:f3
  4u BLKGRAD
  go=2 ph31 cpd3:f3

; begin NUWS bit
  if "dsFlag==0" goto 10
  zd
  "dsFlag=0"
10 4u

; repeat acquisition block according to schedule in vclist
  lo to 2 times c

; save data, reset scan counter
  4u do:f3
  d11 wr #0 if #0 zd

; 13C looping
  1u dp9
  1u dp10
  lo to 3 times 2
  1u id0
  1u ip9
  1u ip9
  lo to 3 times l3

; 15N looping (and NUWS incrementation)
  4u ivc
  1u rp9
  1u rp10
  1u rd0
  1u igrad EA
  1u ip6
  1u ip6
  lo to 3 times 2
  1u id10
  1u id29
  1u dd30
  1u ip8
  1u ip8
  1u ip31
  1u ip31
  lo to 3 times l6

;  d11 do:f3 mc #0 to 2
;     F1PH(calph(ph9, -90) & calph(ph10, -90), caldel(d0, +in0) & calph(ph9, +180))
;     F2EA(calgrad(EA) & calph(ph6, +180), caldel(d10, +in10) & caldel(d29, +in29) & caldel(d30, -in30) & calph(ph8, +180) & calph(ph31, +180))
;  TAU
exit

ph1=0
ph2=1
ph3=0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph4=0
ph5=0 0 2 2
ph6=1 1 3 3
ph7=0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph8=0
ph9=3 1
ph10=0 2 0 2 2 0 2 0
ph31=0 2 2 0 2 0 0 2 2 0 0 2 0 2 2 0

;pl3 : f3 channel - power level for pulse (default)
;pl26: f3 channel - power level for CPD/BB low power decoupling
;sp2: f2 channel - shaped pulse  90 degree  (on resonance)
;sp3: f2 channel - shaped pulse 180 degree  (on resonance)
;sp5: f2 channel - shaped pulse 180 degree  (Ca off resonance)
;sp7: f2 channel - shaped pulse 180 degree  (C=O off resonance)
;sp8: f2 channel - shaped pulse  90 degree  (on resonance)
;                  for time reversed pulse
;sp25: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;sp26: f1 channel - shaped pulse 180 degree (Reburp.1000)
;sp27: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;                   for time reversed pulse
;sp28: f1 channel - shaped pulse  90 degree (Eburp2.1000)
;sp29: f1 channel - shaped pulse  90 degree (Eburp2tr.1000)
;                   for time reversed pulse
;sp30: f1 channel - shaped pulse 180 degree (Bip720,50,20.1)
;sp39: f3 channel - shaped pulse 180 degree (Bip720,50,20.1)
;sp40: f3 channel - shaped pulse 180 degree (Reburp.1000)
;p13: f2 channel -  90 degree shaped pulse
;p14: f2 channel - 180 degree shaped pulse
;p16: homospoil/gradient pulse                         [1 msec]
;p19: gradient pulse 2                                 [500 usec]
;p21: f3 channel -  90 degree high power pulse
;p29: gradient pulse 3                                 [250 usec]
;p41: f1 channel -  90 degree shaped pulse for excitation
;                      Pc9_4_90.1000             (2.2ms at 600.13 MHz)
;p42: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.4ms at 600.13 MHz)
;p43: f1 channel -  90 degree shaped pulse for excitation
;                      Eburp2.1000/Eburp2tr.1000 (1.7ms at 600.13 MHz)
;p44: f1 channel - 180 degree shaped pulse for refocussing
;                      Bip720,50,20.1            (200us at 600.13 MHz)
;p56: f3 channel - 180 degree shaped pulse for inversion
;                      Bip720,50,20.1            (500us at 600.13 MHz)
;p57: f3 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.6ms at 600.13 MHz)
;d0 : incremented delay (F1 in 3D)                     [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d10: incremented delay (F2 in 3D)                     [3 usec]
;d11: delay for disk I/O                               [30 msec]
;d16: delay for homospoil/gradient recovery
;d22: 1/(4J(COCa)                                      [4.5 msec]
;d23: 1/(4J(NCO)                                       [12 msec]
;d26: 1/(4J(NH)                                        [2.7 msec]
;d28: 1/(4J(CaCb)                                      [3.6 msec or 7.2 msec]
;d29: incremented delay (F2 in 3D)                     [3 usec]
;d30: decremented delay (F2 in 3D) = d23-p43-4u-p21*4/PI
;cnst21: CO chemical shift (offset, in ppm)
;cnst22: Calpha chemical shift (offset, in ppm)
;cnst23: Caliphatic chemical shift (offset, in ppm)
;cnst41: compensation of chemical shift evolution during p41
;           Pc9_4_90.1000: 0.529
;cnst43: compensation of chemical shift evolution during p43
;           Eburp2.1000: 0.5
;cnst51: scaling factor for p41 to compensate for transition region
;           Pc9_4_90.1000: 1.172
;cnst52: scaling factor for p42 to compensate for transition region
;           Reburp.1000: 1.426
;cnst53: scaling factor for p43 to compensate for transition region
;           Eburp2.1000: 1.000
;cnst54: H(N) chemical shift (offset, in ppm)
;cnst55: H(N) bandwidth (in ppm)
;o2p: Caliphatic chemical shift (cnst23)
;inf1: 1/SW(Cali) = 2 * DW(Cali)
;inf2: 1/SW(N) = 2 * DW(N)
;in0: 1/(2 * SW(Cali)) =  DW(Cali)
;nd0: 2
;in10: 1/(2 * SW(N)) = DW(N)
;nd10: 2
;in29: = (1 - k2) * in10
;in30: = k2 * in10
;ns: 8 * n
;ds: >= 16
;aq: <= 50 msec
;td1: number of experiments in F1
;td2: number of experiments in F2
;FnMODE: States-TPPI (or TPPI) in F1
;FnMODE: echo-antiecho in F2
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 80%
;gpz2: 8.1%
;gpz3: 11%
;gpz4: 70%
;gpz5: 40%
;gpz6: 75%
;gpz7: 29%
;gpz8: 17%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.32
;gpnam4: SMSQ10.100
;gpnam5: SMSQ10.100
;gpnam6: SMSQ10.100
;gpnam7: SMSQ10.50
;gpnam8: SMSQ10.32

                                          ;preprocessor-flags-start
;LABEL_CB: for Cb only start experiment with
;             option -DLABEL_CB (eda: ZGOPTNS)
;CALC_SP: for calculation of all bandselective Proton pulses based on cnst54 and cnst55
;             option -DCALC_SP (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;$Id: b_hncocacbgp3d.2,v 1.1.2.2 2015/03/12 17:07:07 ber Exp $

;b_hncocacbgp3d.2.nuws.cw
;with NUWS in 15N dimension (for highly folded spectra)
;NB acquistion order 312 not 321
;Chris Waudby Dec 2017
;
;avance-version (15/03/12)
;best-HN(CO)CACB
;3D sequence with
;   inverse correlation for triple resonance using multiple
;      inept transfer steps
;
;      F1(H) -> F3(N) -> F2(C=O) -> F2(Ca -> Cb,t1)
;            -> F2(C=O) -> F3(N,t2) -> F1(H,t3)
;
;on/off resonance Ca and C=O pulses using shaped pulse
;using shaped pulses for inversion and refocussing on f3
;phase sensitive (t1)
;phase sensitive using Echo/Antiecho (t2)
;using semi constant time in t2
;(use parameterset B_HNCOCACBGP3D)
;
;P. Schanda, H. v. Melckebeke & B. Brutscher,
;   J. Am. Chem. Soc. 128, 9042-9043 (2006)
;E. Lescop, P. Schanda & B. Brutscher,
;   J. Magn. Reson.  187 163-169 (2007)
;(S. Grzesiek & A. Bax, J. Magn. Reson. 96, 432 - 440 (1992))
;(J. Schleucher, M. Sattler & C. Griesinger,
;   Angew. Chem. Int. Ed. 32, 1489-1491 (1993))
;(L.E. Kay, G.Y. Xu & T. Yamazaki, J. Magn. Reson. A109,
;   129-133 (1994))
;
;$CLASS=HighRes
;$DIM=3D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

define loopcounter dsFlag
"dsFlag=1"

"d11=30m"

"d22=4.5m"
"d23=12m"
"d26=2.7m"

#   ifdef LABEL_CB
"d28=7.2m"
#   else
"d28=3.6m"
#   endif /*LABEL_CB*/

"p29=250u"

#   ifdef CALC_SP
"p41=(bwfac25/(cnst55*cnst51*bf1))*1000000"
"spw25=plw1/((p41*90.0)/(p1*totrot25))*((p41*90.0)/(p1*totrot25))*(integfac25*integfac25)"
"spw27=plw1/((p41*90.0)/(p1*totrot27))*((p41*90.0)/(p1*totrot27))*(integfac27*integfac27)"
"spoal25=1"
"spoal27=0"

"p42=(bwfac26/(cnst55*cnst52*bf1))*1000000"
"spw26=plw1/((p42*90.0)/(p1*totrot26))*((p42*90.0)/(p1*totrot26))*(integfac26*integfac26)"
"spoal26=0.5"

"p43=(bwfac28/(cnst55*cnst53*bf1))*1000000"
"spw28=plw1/((p43*90.0)/(p1*totrot28))*((p43*90.0)/(p1*totrot28))*(integfac28*integfac28)"
"spw29=plw1/((p43*90.0)/(p1*totrot29))*((p43*90.0)/(p1*totrot29))*(integfac29*integfac29)"
"spoal28=1"
"spoal29=0"
#   endif /*CALC_SP*/

"d0=3u"
"d10=3u"
"d29=3u"
"d30=d23-p43-4u-p21*4/PI"

"in0=inf1/2"
"in10=inf2/2"

"FACTOR2=d30*10000000*2/td2"
"INCR2=FACTOR2/10000000"

"if ( INCR2 > in10 ) { in30 = in10; } else { in30 = INCR2; }"
"if ( INCR2 > in10 ) { in29 = 0; } else { in29=in10-INCR2; }"

"TAU=larger(p14,p44)"

"DELTA=d0*2+larger(TAU,p56)-TAU"
"DELTA1=d26-p29-d16-p41*cnst41-larger(p42,p56)/2"
"DELTA2=d23-d26-p44-p16-d16-p14-d29"
"DELTA3=d26-p19-d16-p42/2"
"DELTA4=d26-p29-d16-p43*cnst43-larger(p42,p56)/2"
"DELTA5=p16+d16+de+8u"
"DELTA6=d23-larger(p42,p57)/2"
"DELTA7=d23-larger(p42,p57)/2-p44-d26"
"DELTA8=d26-p14-d10"
"DELTA9=d22-p14-4u"

"spoff2=0"
"spoff3=0"
"spoff5=bf2*((cnst22-cnst21)/1000000)"
"spoff7=bf2*((cnst21-cnst23)/1000000)"
"spoff8=0"

"spoff25=bf1*(cnst54/1000000)-o1"
"spoff26=bf1*(cnst54/1000000)-o1"
"spoff27=bf1*(cnst54/1000000)-o1"
"spoff28=bf1*(cnst54/1000000)-o1"
"spoff29=bf1*(cnst54/1000000)-o1"
"spoff30=0"

; number of complex points
"l3=td1/2"
"l6=td2/2"

aqseq 312

"acqt0=0"
baseopt_echo

1 d11 ze
  d11 pl26:f3
2 d11 do:f3
3 d1 fq=cnst21(bf ppm):f2
  50u UNBLKGRAD

  (p41:sp25 ph1)
  p29:gp3
  d16
  DELTA1
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA1
  p29:gp3
  d16
  (p41:sp27 ph2):f1

  p16:gp4
  d16 pl3:f3

  (p21 ph1):f3
  DELTA6
  (center (p14:sp3 ph1):f2 (p57:sp40 ph1):f3 )
  DELTA7
  (p44:sp30 ph1)
  d26 pl3:f3
  (p21 ph1):f3
  (p44:sp30 ph1)

  p16:gp5
  d16

  (p13:sp2 ph3):f2
  4u
  (p14:sp5 ph1):f2
  DELTA9
  (p14:sp3 ph1):f2
  4u
  (p14:sp5 ph1):f2
  DELTA9
  (p13:sp8 ph2):f2

  4u
  30u fq=cnst23(bf ppm):f2

  (p13:sp2 ph4):f2
  d28
  (p14:sp3 ph1):f2
  d28
  (p13:sp8 ph2):f2
  d0
  (center (p44:sp30 ph1) (p14:sp7 ph1):f2 (p56:sp39 ph7):f3 )
  d0
  4u
  (p14:sp3 ph1):f2
  DELTA
  (center (p44:sp30 ph1) (p14:sp7 ph1):f2 )
  4u
  (p13:sp2 ph9):f2
  d28
  (p14:sp3 ph1):f2
  d28
  (p13:sp8 ph10):f2

  4u
  30u fq=cnst21(bf ppm):f2

  (p13:sp2 ph2):f2
  DELTA9
  (p14:sp5 ph1):f2
  4u
  (p14:sp3 ph1):f2
  DELTA9
  (p14:sp5 ph1):f2
  4u
  (p13:sp8 ph1):f2

  p16:gp6
  d16 pl3:f3

  (p44:sp30 ph1)
  (p21 ph8):f3
  2u
  (p56:sp39 ph1):f3
  d10
  (p14:sp5 ph1):f2
  DELTA8
  (p44:sp30 ph1)
  DELTA2
  p16:gp1*EA
  d16
  (p14:sp3 ph1):f2
  d29
  (p56:sp39 ph7):f3
  d30
  2u pl3:f3
  (p43:sp28 ph1)
  (p21 ph5):f3
  p19:gp7
  d16
  DELTA3
  (center (p42:sp26 ph1) (p57:sp40 ph1):f3 )
  DELTA3
  p19:gp7
  d16 pl3:f3
  (p21 ph6):f3

  (p43:sp29 ph2)
  p29:gp8
  d16
  DELTA4
  (center (p42:sp26 ph1) (p56:sp39 ph1):f3 )
  DELTA4
  p29:gp8
  d16
  (p43:sp28 ph1)
  DELTA5
  (p42:sp26 ph1)
  4u
  p16:gp2
  d16 pl26:f3
  4u BLKGRAD
  go=2 ph31 cpd3:f3

; begin NUWS bit
  if "dsFlag==0" goto 10
  zd
  "dsFlag=0"
10 4u

; repeat acquisition block according to schedule in vclist
  lo to 2 times c

; save data, reset scan counter
  4u do:f3
  d11 wr #0 if #0 zd

; 13C looping
  4u dp9 dp10
  lo to 3 times 2
  4u id0 ip9*2
  lo to 3 times l3

; 15N looping (and NUWS incrementation)
  4u ivc
  4u rp9 rp10 rd0
  4u igrad EA ip6*2
  lo to 3 times 2
  4u id10 id29 dd30 ip8*2 ip31*2
  lo to 3 times l6

;  d11 do:f3 mc #0 to 2
;     F1PH(calph(ph9, -90) & calph(ph10, -90), caldel(d0, +in0) & calph(ph9, +180))
;     F2EA(calgrad(EA) & calph(ph6, +180), caldel(d10, +in10) & caldel(d29, +in29) & caldel(d30, -in30) & calph(ph8, +180) & calph(ph31, +180))
;  TAU
exit

ph1=0
ph2=1
ph3=0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph4=0
ph5=0 0 2 2
ph6=1 1 3 3
ph7=0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph8=0
ph9=3 1
ph10=0 2 0 2 2 0 2 0
ph31=0 2 2 0 2 0 0 2 2 0 0 2 0 2 2 0

;pl3 : f3 channel - power level for pulse (default)
;pl26: f3 channel - power level for CPD/BB low power decoupling
;sp2: f2 channel - shaped pulse  90 degree  (on resonance)
;sp3: f2 channel - shaped pulse 180 degree  (on resonance)
;sp5: f2 channel - shaped pulse 180 degree  (Ca off resonance)
;sp7: f2 channel - shaped pulse 180 degree  (C=O off resonance)
;sp8: f2 channel - shaped pulse  90 degree  (on resonance)
;                  for time reversed pulse
;sp25: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;sp26: f1 channel - shaped pulse 180 degree (Reburp.1000)
;sp27: f1 channel - shaped pulse  90 degree (Pc9_4_90.1000)
;                   for time reversed pulse
;sp28: f1 channel - shaped pulse  90 degree (Eburp2.1000)
;sp29: f1 channel - shaped pulse  90 degree (Eburp2tr.1000)
;                   for time reversed pulse
;sp30: f1 channel - shaped pulse 180 degree (Bip720,50,20.1)
;sp39: f3 channel - shaped pulse 180 degree (Bip720,50,20.1)
;sp40: f3 channel - shaped pulse 180 degree (Reburp.1000)
;p13: f2 channel -  90 degree shaped pulse
;p14: f2 channel - 180 degree shaped pulse
;p16: homospoil/gradient pulse                         [1 msec]
;p19: gradient pulse 2                                 [500 usec]
;p21: f3 channel -  90 degree high power pulse
;p29: gradient pulse 3                                 [250 usec]
;p41: f1 channel -  90 degree shaped pulse for excitation
;                      Pc9_4_90.1000             (2.2ms at 600.13 MHz)
;p42: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.4ms at 600.13 MHz)
;p43: f1 channel -  90 degree shaped pulse for excitation
;                      Eburp2.1000/Eburp2tr.1000 (1.7ms at 600.13 MHz)
;p44: f1 channel - 180 degree shaped pulse for refocussing
;                      Bip720,50,20.1            (200us at 600.13 MHz)
;p56: f3 channel - 180 degree shaped pulse for inversion
;                      Bip720,50,20.1            (500us at 600.13 MHz)
;p57: f3 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000               (1.6ms at 600.13 MHz)
;d0 : incremented delay (F1 in 3D)                     [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d10: incremented delay (F2 in 3D)                     [3 usec]
;d11: delay for disk I/O                               [30 msec]
;d16: delay for homospoil/gradient recovery
;d22: 1/(4J(COCa)                                      [4.5 msec]
;d23: 1/(4J(NCO)                                       [12 msec]
;d26: 1/(4J(NH)                                        [2.7 msec]
;d28: 1/(4J(CaCb)                                      [3.6 msec or 7.2 msec]
;d29: incremented delay (F2 in 3D)                     [3 usec]
;d30: decremented delay (F2 in 3D) = d23-p43-4u-p21*4/PI
;cnst21: CO chemical shift (offset, in ppm)
;cnst22: Calpha chemical shift (offset, in ppm)
;cnst23: Caliphatic chemical shift (offset, in ppm)
;cnst41: compensation of chemical shift evolution during p41
;           Pc9_4_90.1000: 0.529
;cnst43: compensation of chemical shift evolution during p43
;           Eburp2.1000: 0.5
;cnst51: scaling factor for p41 to compensate for transition region
;           Pc9_4_90.1000: 1.172
;cnst52: scaling factor for p42 to compensate for transition region
;           Reburp.1000: 1.426
;cnst53: scaling factor for p43 to compensate for transition region
;           Eburp2.1000: 1.000
;cnst54: H(N) chemical shift (offset, in ppm)
;cnst55: H(N) bandwidth (in ppm)
;o2p: Caliphatic chemical shift (cnst23)
;inf1: 1/SW(Cali) = 2 * DW(Cali)
;inf2: 1/SW(N) = 2 * DW(N)
;in0: 1/(2 * SW(Cali)) =  DW(Cali)
;nd0: 2
;in10: 1/(2 * SW(N)) = DW(N)
;nd10: 2
;in29: = (1 - k2) * in10
;in30: = k2 * in10
;ns: 8 * n
;ds: >= 16
;aq: <= 50 msec
;td1: number of experiments in F1
;td2: number of experiments in F2
;FnMODE: States-TPPI (or TPPI) in F1
;FnMODE: echo-antiecho in F2
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 80%
;gpz2: 8.1%
;gpz3: 11%
;gpz4: 70%
;gpz5: 40%
;gpz6: 75%
;gpz7: 29%
;gpz8: 17%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.32
;gpnam4: SMSQ10.100
;gpnam5: SMSQ10.100
;gpnam6: SMSQ10.100
;gpnam7: SMSQ10.50
;gpnam8: SMSQ10.32

                                          ;preprocessor-flags-start
;LABEL_CB: for Cb only start experiment with
;             option -DLABEL_CB (eda: ZGOPTNS)
;CALC_SP: for calculation of all bandselective Proton pulses based on cnst54 and cnst55
;             option -DCALC_SP (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;$Id: b_hncocacbgp3d.2,v 1.1.2.2 2015/03/12 17:07:07 ber Exp $


add presat option and 13C purge

add presat option and 13C purge

;hsqcctetgpsp.cw
;avance-version (15/02/27)
;HSQC
;2D H-1/X correlation via double inept transfer
;phase sensitive using Echo/Antiecho-TPPI gradient selection
;with decoupling during acquisition
;constant time version
;using trim pulses in inept transfer
;using shaped pulses for inversion on f2 - channel
;
;(G.W. Vuister & A. Bax, J. Magn. Reson. 98, 428-435 (1992))
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"p2=p1*2"
"p22=p21*2"
"d4=1s/(cnst2*4)"
"d11=30m"
"d12=20u"

"d0=3u"
"d20=d23-p16-d16-p14*1.5-4u-d12"

"in0=inf1/2"

"in20=in0"

"td1=tdmax(td1,d20*2,in20)"

"DELTA1=d4-larger(p2,p8)/2-p16-de-8u"
"DELTA2=d4-larger(p2,p8)/2-4u-p16-d16"
"DELTA3=d23-d0-p14/2-larger(p14,p22)-4u"
"DELTA4=d4-larger(p2,p8)/2-p1*2/PI-4u-p16-d16"

"spoff3=0"
"spoff5=bf2*(cnst21/1000000)-o2"
"spoff13=0"

"acqt0=0"
baseopt_echo

1 ze
  d11 pl1:f1 pl12:f2 pl3:f3
2 d11 do:f2

# ifdef OFFRES_PRESAT
  30u fq=cnst19(bf hz):f1
  4u pl9:f1
  d1 cw:f1 ph1
  4u do:f1
  30u fq=0:f1
# else
  d1
# endif /*OFFRES_PRESAT*/

  ; purge 13C
  d12 pl1:f1 pl2:f2
  50u UNBLKGRAD
  (p3 ph1):f2
  4u
  p16:gp1
  d16*2

  ; begin HSQC
  (p1 ph1)
  4u
  p16:gp4
  d16
  DELTA2 pl0:f2
  (center (p2 ph1) (p8:sp13 ph6):f2 )
  DELTA2 pl2:f2
  p16:gp4
  d16
#ifdef NOZZ1
  (p1 ph2) (p3 ph3):f2
#else
  (p1 ph2)
  ; zz filter
  4u
  p16:gp3*-0.8
  d16
  (p3 ph3):f2
#endif /*NOZZ1*/
  ; t1 evolution
  d0
  (center (p2 ph5) (p14:sp5 ph1):f2 (p22 ph1):f3 )
  4u
  DELTA3 pl0:f2
  (p14:sp3 ph4):f2
  d20
  p16:gp1*EA*-1
  d16 pl0:f2
  (p14:sp5 ph1):f2
  4u
  d12 pl2:f2

#ifdef NOZZ2
  (ralign (p1 ph1) (p3 ph4):f2 )
#else
  (p3 ph4):f2
  ; zz filter
  4u
  p16:gp3
  d16
  (p1 ph1)
#endif /*NOZZ2*/
  ; back-transfer
  4u
  p16:gp5
  d16
  DELTA4 pl0:f2
  (center (p2 ph1) (p8:sp13 ph1):f2 )
  4u
  p16:gp2
  DELTA1 pl12:f2
  4u BLKGRAD
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
     F1EA(calgrad(EA), caldel(d0, +in0) & caldel(d20, -in20) & calph(ph3, +180) & calph(ph6, +180) & calph(ph31, +180))
exit

ph1=0
ph2=1
ph3=0 2
ph4=0 0 0 0 2 2 2 2
ph5=0 0 2 2
ph6=0
ph31=0 2 0 2 2 0 2 0

;pl0 : 0W
;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;pl12: f2 channel - power level for CPD/BB decoupling
;sp3 : f2 channel - shaped pulse 180 degree (on resonance)
;sp5 : f2 channel - shaped pulse 180 degree (off resonance)
;sp13: f2 channel - shaped pulse 180 degree (adiabatic)
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p8 : f2 channel - 180 degree shaped pulse for inversion (adiabatic)
;p14: f2 channel - 180 degree shaped pulse
;p16: homospoil/gradient pulse
;p22: f3 channel - 180 degree high power pulse
;p28: f1 channel - trim pulse                        [1 msec]
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d4 : 1/(4J)XH
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d20 : = d23
;d23: d23 = T : 13.3 or 26.6 msec
;     2T (constant time period) = n/J(CC)
;cnst2: = J(XH)
;cnst19: water frequency (in ppm)
;cnst21: CO chemical shift (offset, in ppm)
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;in20: = in0
;nd0: 2
;ns: 4 * n
;ds: 32
;td1: number of experiments
;FnMODE: echo-antiecho
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 80%
;gpz2: 30.1% for C-13
;gpz3: 55% (zz filters)
;gpz4: 13% (180 refocusing)
;gpz5: 10% (180 refocusing)

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100
;gpnam4: SMSQ10.100
;gpnam5: SMSQ10.100

;$Id: hsqcctetgpsp,v 1.8.2.1 2015/03/03 11:21:23 ber Exp $

;hsqcctetgpsp.cw
;avance-version (15/02/27)
;HSQC
;2D H-1/X correlation via double inept transfer
;phase sensitive using Echo/Antiecho-TPPI gradient selection
;with decoupling during acquisition
;constant time version
;using trim pulses in inept transfer
;using shaped pulses for inversion on f2 - channel
;
;(G.W. Vuister & A. Bax, J. Magn. Reson. 98, 428-435 (1992))
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"p2=p1*2"
"p22=p21*2"
"d4=1s/(cnst2*4)"
"d11=30m"
"d12=20u"

"d0=3u"
"d20=d23-p16-d16-p14*1.5-4u-d12"

"in0=inf1/2"

"in20=in0"

"td1=tdmax(td1,d20*2,in20)"

"DELTA1=d4-larger(p2,p8)/2-p16-de-8u"
"DELTA2=d4-larger(p2,p8)/2-4u-p16-d16"
"DELTA3=d23-d0-p14/2-larger(p14,p22)-4u"
"DELTA4=d4-larger(p2,p8)/2-p1*2/PI-4u-p16-d16"

"spoff3=0"
"spoff5=bf2*(cnst21/1000000)-o2"
"spoff13=0"

"acqt0=0"
baseopt_echo

1 ze
  d11 pl12:f2 pl3:f3
2 d1 do:f2

  4u UNBLKGRAD

  (p1 ph1)
  4u
  p16:gp4
  d16
  DELTA2 pl0:f2
  (center (p2 ph1) (p8:sp13 ph6):f2 )
  DELTA2 pl2:f2
  p16:gp4
  d16
#ifdef NOZZ1
  (p1 ph2) (p3 ph3):f2
#else
  (p1 ph2)
  ; zz filter
  4u
  p16:gp3*-0.8
  d16
  (p3 ph3):f2
#endif /*NOZZ1*/
  ; t1 evolution
  d0
  (center (p2 ph5) (p14:sp5 ph1):f2 (p22 ph1):f3 )
  4u
  DELTA3 pl0:f2
  (p14:sp3 ph4):f2
  d20
  p16:gp1*EA*-1
  d16 pl0:f2
  (p14:sp5 ph1):f2
  4u
  d12 pl2:f2

#ifdef NOZZ2
  (ralign (p1 ph1) (p3 ph4):f2 )
#else
  (p3 ph4):f2
  ; zz filter
  4u
  p16:gp3
  d16
  (p1 ph1)
#endif /*NOZZ2*/
  ; back-transfer
  4u
  p16:gp5
  d16
  DELTA4 pl0:f2
  (center (p2 ph1) (p8:sp13 ph1):f2 )
  4u
  p16:gp2
  DELTA1 pl12:f2
  4u BLKGRAD
  go=2 ph31 cpd2:f2
  d1 do:f2 mc #0 to 2
     F1EA(calgrad(EA), caldel(d0, +in0) & caldel(d20, -in20) & calph(ph3, +180) & calph(ph6, +180) & calph(ph31, +180))
exit

ph1=0
ph2=1
ph3=0 2
ph4=0 0 0 0 2 2 2 2
ph5=0 0 2 2
ph6=0
ph31=0 2 0 2 2 0 2 0

;pl0 : 0W
;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;pl12: f2 channel - power level for CPD/BB decoupling
;sp3 : f2 channel - shaped pulse 180 degree (on resonance)
;sp5 : f2 channel - shaped pulse 180 degree (off resonance)
;sp13: f2 channel - shaped pulse 180 degree (adiabatic)
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p8 : f2 channel - 180 degree shaped pulse for inversion (adiabatic)
;p14: f2 channel - 180 degree shaped pulse
;p16: homospoil/gradient pulse
;p22: f3 channel - 180 degree high power pulse
;p28: f1 channel - trim pulse                        [1 msec]
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d4 : 1/(4J)XH
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d20 : = d23
;d23: d23 = T : 13.3 or 26.6 msec
;     2T (constant time period) = n/J(CC)
;cnst2: = J(XH)
;cnst21: CO chemical shift (offset, in ppm)
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;in20: = in0
;nd0: 2
;ns: 4 * n
;ds: 32
;td1: number of experiments
;FnMODE: echo-antiecho
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 80%
;gpz2: 30.1% for C-13
;gpz3: 55% (zz filters)
;gpz4: 13% (180 refocusing)
;gpz5: 10% (180 refocusing)

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100
;gpnam4: SMSQ10.100
;gpnam5: SMSQ10.100

;$Id: hsqcctetgpsp,v 1.8.2.1 2015/03/03 11:21:23 ber Exp $


updating comments for b_trosy_hzdqc.cw

updating comments for b_trosy_hzdqc.cw

;BEST-TROSY-H(Z/D)QC
;  Waudby, Ouvry, Davis & Christodoulou (J Biomol NMR, in press)
;
;options:
; -DLABEL_CN = 13C decoupling
; -DDQ = HDQC (otherwise runs HZQC)
; -DONE_D = first-row
; -DOFFRES_PRESAT = presat, pl9 on cnst21 (Hz bf)

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*4)"

"p22=p21*2"

"in0=inf1"
# ifdef ONE_D
"d0=2u"
#else
"d0=in0/2-p21*4/3.1415"
# endif /*ONE_D*/

"d2=p39-p39*cnst39-0.3633*p21"
"d3=0.5*p40-0.3633*p21"
"DELTA1=d21-p39*cnst39-p40*0.5-p16-d16-4u"
"DELTA2=d21-0.3633*p21-p16-d16-4u-0.5*p40"
"DELTA3=d21-p40-p16-d16-4u"
"DELTA4=d21-0.5*p40-p16-d16-4u-p21-de"
"acqt0=de"

#ifdef LABEL_CN
"d10=DELTA3+d3+p21+d0*0.5-p8*0.5"
"d9=DELTA3+d3+p21+d0*0.5-p8*0.5"
"in10=in0*0.5"
"in9=in0*0.5"
#endif

# ifdef OFFRES_PRESAT
  "TAU=d1-d11-60u-d12*2-d13-d12-50u-p21-2*p16-2*d16-12u"
# else
  "TAU=d1-d11-d12-50u-p21-2*p16-2*d16-12u"
# endif /*OFFRES_PRESAT*/

;"spoff23=bf1*(cnst19/1000000)-o1"
;"spoff24=bf1*(cnst19/1000000)-o1"
"spoff23=0" ; for amides on-resonance (recommended)
"spoff24=0"

"l0=1"  ; loop counter for shifting 1H 180 pulse between echo/anti-echoes

1 ze
  d11
2 d11

  4u UNBLKGRAD
  p16:gp3
  d16
  4u BLKGRAD

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph1
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

3 d12 pl3:f3
  50u UNBLKGRAD

  ; purge Nz
  (p21 ph1):f3
  4u
  p16:gp0
  d16

  ; begin main sequence
  if "l0 %2 == 1"
     {
  (p39:sp23 ph10) (d2 p21 ph11):f3
     }
  else
     {
  (p39:sp23 ph10) (d2 p21 ph21):f3
     }

  DELTA1
  4u
  p16:gp1
  d16
  (center (p40:sp24 ph1) (p22 ph12):f3 )
  4u
  p16:gp1
  d16

  if "l0 %2 == 1"
     {
#ifdef LABEL_CN
  (ralign (p40:sp24 ph16 DELTA3) (DELTA2 p21 ph13 d0 p21 ph1 d3 DELTA3):f3 (p8:sp13 ph1 d10):f2 )
#else
  (ralign (p40:sp24 ph16) (DELTA2 p21 ph13 d0 p21 ph1 d3):f3 )
  DELTA3
#endif /*LABEL_CN*/
     }
  else
     {
#ifdef LABEL_CN
  (DELTA3 p40:sp24 ph16) (DELTA3 d3 p21 ph23 d0 p21 ph1 DELTA2):f3 (d9 p8:sp13 ph1):f2
#else
  DELTA3
  (p40:sp24 ph16) (d3 p21 ph23 d0 p21 ph1 DELTA2):f3
#endif /*LABEL_CN*/
     }
  4u
  p16:gp2
  d16
  (center (p40:sp24 ph1) (p22 ph1):f3 )
  4u
  p16:gp2
  d16
  DELTA4 BLKGRAD
  (p21 ph14):f3

  go=2 ph31
#ifdef LABEL_CN
  d11 mc #0 to 2
     F1EA(iu0 & ip13*2 & ip14*2, id0 & id10 & id9 & ip10*2 & ip31*2)
#else
  d11 mc #0 to 2
     F1EA(iu0 & ip13*2 & ip14*2, id0 & ip10*2 & ip31*2)
#endif /*LABEL_CN*/

exit

ph1=0
ph10=0
ph11=2 0 3 1
ph21=2 0 1 3
ph12=0
#ifdef DQ
ph13=1 3 2 0
ph23=1 3 0 2
ph14=3
#else /* ZQ */
ph13=1 3 0 2
ph23=1 3 2 0
ph14=1
#endif
ph16=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph31=0 2 3 1 2 0 1 3

;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 90 degree (Pc9_4_90.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 90 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (1958us at 950 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000              (1432us at 950 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(4J)NH
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)  [8.2 ppm]
;cnst21: frequency (in Hz) for off-resonance presaturation
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_90.1000: 0.514
;NS: 4 * n
;DS: 16
;td1: number of experiments
;FnMODE: Echo-AntiEcho

;use gradient ratio:	gp 0 : gp 1 : gp 2
;			-16 :  11 :    7

;for z-only gradients:
;gpz0: -16%
;gpz1: 11%
;gpz2:  7%
;gpz3: -23%

;use gradient files:
;gpnam0: SMSQ10.100
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100

;Processing
;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1

;BEST-TROSY-H(Z/D)QC
;  Waudby, Ouvry, Davis & Christodoulou (submitted, 2019)
;
;options:
; -DLABEL_CN = 13C decoupling
; -DDQ = HDQC (otherwise runs HZQC)
; -DONE_D = first-row
; -DOFFRES_PRESAT = presat, pl9 on cnst21 (Hz bf)

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*4)"

"p22=p21*2"

"in0=inf1"
# ifdef ONE_D
"d0=2u"
#else
"d0=in0/2-p21*4/3.1415"
# endif /*ONE_D*/

"d2=p39-p39*cnst39-0.3633*p21"
"d3=0.5*p40-0.3633*p21"
"DELTA1=d21-p39*cnst39-p40*0.5-p16-d16-4u"
"DELTA2=d21-0.3633*p21-p16-d16-4u-0.5*p40"
"DELTA3=d21-p40-p16-d16-4u"
"DELTA4=d21-0.5*p40-p16-d16-4u-p21-de"
"acqt0=de"

#ifdef LABEL_CN
"d10=DELTA3+d3+p21+d0*0.5-p8*0.5"
"d9=DELTA3+d3+p21+d0*0.5-p8*0.5"
"in10=in0*0.5"
"in9=in0*0.5"
#endif

# ifdef OFFRES_PRESAT
  "TAU=d1-d11-60u-d12*2-d13-d12-50u-p21-2*p16-2*d16-12u"
# else
  "TAU=d1-d11-d12-50u-p21-2*p16-2*d16-12u"
# endif /*OFFRES_PRESAT*/

;"spoff23=bf1*(cnst19/1000000)-o1"
;"spoff24=bf1*(cnst19/1000000)-o1"
"spoff23=0" ; for amides on-resonance (recommended)
"spoff24=0"

"l0=1"  ; loop counter for shifting 1H 180 pulse between echo/anti-echoes

1 ze
  d11
2 d11

  4u UNBLKGRAD
  p16:gp3
  d16
  4u BLKGRAD

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph1
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

3 d12 pl3:f3
  50u UNBLKGRAD

  ; purge Nz
  (p21 ph1):f3
  4u
  p16:gp0
  d16

  ; begin main sequence
  if "l0 %2 == 1"
     {
  (p39:sp23 ph10) (d2 p21 ph11):f3
     }
  else
     {
  (p39:sp23 ph10) (d2 p21 ph21):f3
     }

  DELTA1
  4u
  p16:gp1
  d16
  (center (p40:sp24 ph1) (p22 ph12):f3 )
  4u
  p16:gp1
  d16

  if "l0 %2 == 1"
     {
#ifdef LABEL_CN
  (ralign (p40:sp24 ph16 DELTA3) (DELTA2 p21 ph13 d0 p21 ph1 d3 DELTA3):f3 (p8:sp13 ph1 d10):f2 )
#else
  (ralign (p40:sp24 ph16) (DELTA2 p21 ph13 d0 p21 ph1 d3):f3 )
  DELTA3
#endif /*LABEL_CN*/
     }
  else
     {
#ifdef LABEL_CN
  (DELTA3 p40:sp24 ph16) (DELTA3 d3 p21 ph23 d0 p21 ph1 DELTA2):f3 (d9 p8:sp13 ph1):f2
#else
  DELTA3
  (p40:sp24 ph16) (d3 p21 ph23 d0 p21 ph1 DELTA2):f3
#endif /*LABEL_CN*/
     }
  4u
  p16:gp2
  d16
  (center (p40:sp24 ph1) (p22 ph1):f3 )
  4u
  p16:gp2
  d16
  DELTA4 BLKGRAD
  (p21 ph14):f3

  go=2 ph31
#ifdef LABEL_CN
  d11 mc #0 to 2
     F1EA(iu0 & ip13*2 & ip14*2, id0 & id10 & id9 & ip10*2 & ip31*2)
#else
  d11 mc #0 to 2
     F1EA(iu0 & ip13*2 & ip14*2, id0 & ip10*2 & ip31*2)
#endif /*LABEL_CN*/

exit

ph1=0
ph10=0
ph11=2 0 3 1
ph21=2 0 1 3
ph12=0
#ifdef DQ
ph13=1 3 2 0
ph23=1 3 0 2
ph14=3
#else /* ZQ */
ph13=1 3 0 2
ph23=1 3 2 0
ph14=1
#endif
ph16=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph31=0 2 3 1 2 0 1 3

;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 90 degree (Pc9_4_90.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 90 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (1958us at 950 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000              (1432us at 950 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(4J)NH
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)  [8.2 ppm]
;cnst21: frequency (in Hz) for off-resonance presaturation
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_90.1000: 0.514
;NS: 4 * n
;DS: 16
;td1: number of experiments
;FnMODE: Echo-AntiEcho

;use gradient ratio:	gp 0 : gp 1 : gp 2
;			-16 :  11 :    7

;for z-only gradients:
;gpz0: -16%
;gpz1: 11%
;gpz2:  7%
;gpz3: -23%

;use gradient files:
;gpnam0: SMSQ10.100
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.100

;Processing
;PHC0(F1): 90
;PHC1(F1): -180
;FCOR(F1): 1


updating comments for sfhzdqcf3.cw

updating comments for sfhzdqcf3.cw

;SOFAST-H(Z/D)QC
;  Waudby, Ouvry, Davis & Christodoulou (J Biomol NMR, in press)
;  for simultaneous collection of SOFAST-HZQC and SOFAST-HDQC spectra
;
;run as pseudo-3D (td1 = 2)
;process using nmrPipe scripts supplied

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*2)"

"in0=inf2"
"td1=2"
"l0=1"
"acqt0=de"

# ifdef ONE_D
"d0=0.1u"
#else
"d0=in0/2-p21*4/3.1415"
# endif /*ONE_D*/

"DELTA1=d21-p16-d16-p39*cnst39"
"DELTA2=p39*cnst39-de-4u"
"DELTA3=DELTA1-p40*0.5"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

aqseq 312

1 ze
  d11 pl26:f3
2 10m do:f3

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

  d12 pl3:f3
  50u UNBLKGRAD

  ; purge Nz
  (p21 ph1):f3
  p16:gp2
  d16

  ; begin main sequence
  (p39:sp23 ph11):f1
  p16:gp1
  d16

  if "l0 %2 == 1"
     {
  ; 1H 180 before d0
  (lalign (DELTA3 p40:sp24 ph1) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }
  else
     {
  ; 1H 180 after d0
  (ralign (p40:sp24 ph1 DELTA3 ) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }

  DELTA2
  p16:gp1
  d16 pl26:f3
  4u BLKGRAD

  go=2 ph31 cpd3:f3
  10m do:f3 mc #0 to 2
     F1QF(ip12)
     F2EA(rp12 & iu0, id0)

exit

ph1=0
ph2=0
ph11=0
ph12=0 2
ph31=0 2

;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 120 degree (Pc9_4_120.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (2325 us at 800 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000              (1700 us at 800  MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;o1 : recommended to place on H(N) = cnst19
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)  [8.2 ppm]
;cnst21: frequency (in Hz) for off-resonance presaturation
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529
;NS: 2 * n
;DS: 16
;aq: <= 100 msec (with low power cpd, max. 50% duty cycle)
;td1: 2
;td2: number of experiments
;FnMODE[1]: QF
;FnMODE[2]: Echo-AntiEcho
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;Options:
;  -DOFFRES_PRESATURATION : off-resonance presaturation during d1 (cnst21, pl9)
;  -DONE_D : for 1D measurement with minimal evolution time (td2=1, td1=2)

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7
;
;for z-only gradients:
;gpz1: 11%
;gpz2:  7%
;
;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100

;SOFAST-H(Z/D)QC
;  Waudby, Ouvry, Davis & Christodoulou (submitted, 2019)
;  for simultaneous collection of SOFAST-HZQC and SOFAST-HDQC spectra
;
;run as pseudo-3D (td1 = 2)
;process using nmrPipe scripts supplied

prosol relations=<triple>

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"d11=30m"
"d12=20u"
"d13=4u"
"d21=1s/(cnst4*2)"

"in0=inf2"
"td1=2"
"l0=1"
"acqt0=de"

# ifdef ONE_D
"d0=0.1u"
#else
"d0=in0/2-p21*4/3.1415"
# endif /*ONE_D*/

"DELTA1=d21-p16-d16-p39*cnst39"
"DELTA2=p39*cnst39-de-4u"
"DELTA3=DELTA1-p40*0.5"

# ifdef OFFRES_PRESAT
  "TAU=d1-10m-60u-d12*2-d13"
# else
  "TAU=d1-10m"
# endif /*OFFRES_PRESAT*/

"spoff23=bf1*(cnst19/1000000)-o1"
"spoff24=bf1*(cnst19/1000000)-o1"

aqseq 312

1 ze
  d11 pl26:f3
2 10m do:f3

# ifdef OFFRES_PRESAT
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  TAU cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  30u fq=0:f1
# else
  TAU
# endif /*OFFRES_PRESAT*/

  d12 pl3:f3
  50u UNBLKGRAD

  ; purge Nz
  (p21 ph1):f3
  p16:gp2
  d16

  ; begin main sequence
  (p39:sp23 ph11):f1
  p16:gp1
  d16

  if "l0 %2 == 1"
     {
  ; 1H 180 before d0
  (lalign (DELTA3 p40:sp24 ph1) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }
  else
     {
  ; 1H 180 after d0
  (ralign (p40:sp24 ph1 DELTA3 ) (DELTA1 p21 ph12 d0 p21 ph1 DELTA1):f3 )
     }

  DELTA2
  p16:gp1
  d16 pl26:f3
  4u BLKGRAD

  go=2 ph31 cpd3:f3
  10m do:f3 mc #0 to 2
     F1QF(ip12)
     F2EA(rp12 & iu0, id0)

exit

ph1=0
ph2=0
ph11=0
ph12=0 2
ph31=0 2

;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl26: f3 channel - power level for CPD/BB decoupling (low power)
;sp23: f1 channel - shaped pulse 120 degree (Pc9_4_120.1000)
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p21: f3 channel -  90 degree high power pulse
;p39: f1 channel - 120 degree shaped pulse for excitation
;                      Pc9_4_120.1000 (120o)    (2657us at 700 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing
;                      Reburp.1000              (1935us at 700 MHz)
;d0 : incremented delay (2D) = in0/2-p21*4/3.1415
;d1 : relaxation delay
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21 : 1/(2J)NH
;o1 : recommended to place on H(N) = cnst19
;cnst4: = J(NH)
;cnst19: H(N) chemical shift (offset, in ppm)  [8.2 ppm]
;cnst21: frequency (in Hz) for off-resonance presaturation
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529
;NS: 2 * n
;DS: 16
;aq: <= 100 msec (with low power cpd, max. 50% duty cycle)
;td1: 2
;td2: number of experiments
;FnMODE[1]: QF
;FnMODE[2]: Echo-AntiEcho
;cpd3: decoupling according to sequence defined by cpdprg3: garp4.p62
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence
;          use pulse of >= 350 usec

;Options:
;  -DOFFRES_PRESATURATION : off-resonance presaturation during d1 (cnst21, pl9)
;  -DONE_D : for 1D measurement with minimal evolution time (td2=1, td1=2)

;use gradient ratio:	gp 1 : gp 2
;			  11 :    7
;
;for z-only gradients:
;gpz1: 11%
;gpz2:  7%
;
;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100


hmqcgpphpr_zqdqT2.cw fixed and working OK

;methyl ZQ and DQ T2 measurement using HMQC with multiplet filter
;Chris Waudby, July 2020
;
;set td2 = 6 * desired td (3 step cycle for ZQ/DQ selection + 2 step cycle for multiplet suppression)
;
;avance-version (07/04/04)
;HMQC
;2D H-1/X correlation via heteronuclear zero and double quantum
;   coherence
;phase sensitive
;with decoupling during acquisition
;
;A. Bax, R.H. Griffey & B.L. Hawkins, J. Magn. Reson. 55, 301 (1983)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"p2=p1*2"
"p4=p3*2"
"d2=1s/(cnst2*2)"
"d3=1s/(cnst2*8)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf2"
"d0=2*0.63662*p3 + in0/2"

; loop counter for ZQ/DQ and E/AE blocks
"l1 = 0"

"acqt0=0"
baseopt_echo

aqseq 321

1 ze
  d11 pl12:f2
2 d11 do:f2
  ; purge before d1
  20u pl6:f1
  (2mp ph1):f1
  (3mp ph2):f1

  4u BLKGRAD

  ; relaxation period, with off-res presat
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  d1 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD

  (p3 ph1):f2    ; crush eq'm 13C magnetisation
  d13
  p16:gp1
  d16

  ; start main sequence
  (p1 ph1):f1  ; INEPT
  "DELTA1 = d2 - p1*0.6366"
  DELTA1

  if "l1 % 4 == 0"
    {
  (p3 ph11):f2
  "DELTA = d3 - p3"
  DELTA
  (p3*2 ph1):f2
  "DELTA = vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16"
  DELTA
  p19:gp2
  d16
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  "DELTA = d3 + d0*0.5 - p3 - p1*2"
  DELTA
  (p3*2 ph1):f2
  p19:gp2
  d16
  "DELTA = vd*0.5 - p3 - p19 - d16"
  DELTA
  (p3 ph1):f2
    }

  if "l1 % 4 == 1"
    {
  (p3 ph11):f2
  (p3*2 ph1):f2
  "DELTA = d3 - p3 + vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16"
  DELTA
  p19:gp2
  d16
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  "DELTA = d0*0.5 - p1*2"
  DELTA
  (p3*2 ph1):f2
  p19:gp2
  d16
  "DELTA = d3 - p3 + vd*0.5 - p3 - p19 - d16"
  DELTA
  (p3 ph1):f2
    }

  if "l1 % 4 == 2"
    {
  (p3 ph11):f2
  "DELTA = vd*0.5 - p3 - p19 - d16"
  DELTA
  p19:gp2
  d16
  (p3*2 ph1):f2
  "DELTA = d3 + d0*0.5 - p3 - p1*2"
  DELTA
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  p19:gp2
  d16
  "DELTA = vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16"
  DELTA
  (p3*2 ph1):f2
  "DELTA = d3 - p3"
  DELTA
  (p3 ph1):f2
    }

   if "l1 % 4 == 3"
    {
  (p3 ph11):f2
  "DELTA = vd*0.5 - p3 - p19 - d16 + d3 - p3"
  DELTA
  p19:gp2
  d16
  (p3*2 ph1):f2
  "DELTA = d0*0.5 - p1*2"
  DELTA
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  p19:gp2
  d16
  "DELTA = vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16 + d3 - p3"
  DELTA
  (p3*2 ph1):f2
  (p3 ph1):f2
    }

   ; back-transfer
  "DELTA2 = d2 - d12 - 4u"
  DELTA2
  d12 pl12:f2
  4u BLKGRAD

  ; acquisition
  go=2 ph31 cpd2:f2

  d11 do:f2 mc #0 to 2
    F2I(ip11, 3, iu1, 2)
    F2EA(iu1, id0)
    F1QF(rd0 & rp11 & ru1 & ivd)

  4u BLKGRAD
exit

ph1= 0
ph2= 1
ph11= (3) 0
ph29=0
ph31=0

;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl12: f2 channel - power level for CPD/BB decoupling
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p4 : f2 channel - 180 degree high power pulse
;p16: homospoil/gradient pulse
;p19: gradient pulse [300 usec]
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)CH
;d3 : 1/(8J)CH
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d13: short delay                                    [4 usec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(CH)
;cnst21: frequency in Hz for off-res presat
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;l0: number of repeats for entire experiment
;NS: 1 * n
;DS: 16
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEQ
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 31%
;gpz2: 7%
;gpz3: -40%
;gpz4: 29%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.32
;gpnam4: SMSQ10.32

;methyl ZQ and DQ T2 measurement using HMQC with multiplet filter
;Chris Waudby, July 2020
;
;set td2 = 6 * desired td (3 step cycle for ZQ/DQ selection + 2 step cycle for multiplet suppression)
;
;avance-version (07/04/04)
;HMQC
;2D H-1/X correlation via heteronuclear zero and double quantum
;   coherence
;phase sensitive
;with decoupling during acquisition
;
;A. Bax, R.H. Griffey & B.L. Hawkins, J. Magn. Reson. 55, 301 (1983)
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>

"p2=p1*2"
"p4=p3*2"
"d2=1s/(cnst2*2)"
"d3=1s/(cnst2*8)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf2"
"d0=2*0.63662*p3 + in0/2"

; loop counter for ZQ/DQ and E/AE blocks
"l1 = 0"

"acqt0=0"
baseopt_echo

aqseq 321

1 ze
  d11 pl12:f2
2 d11 do:f2
  ; purge before d1
  20u pl6:f1
  (2mp ph1):f1
  (3mp ph2):f1

  4u BLKGRAD

  ; relaxation period, with off-res presat
  30u fq=cnst21(bf hz):f1
  d12 pl9:f1
  d1 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD

  (p3 ph1):f2    ; crush eq'm 13C magnetisation
  d13
  p16:gp1
  d16

  ; start main sequence
  (p1 ph1):f1  ; INEPT
  "DELTA1 = d2 - p1*0.6366"
  DELTA1

  if "l1 % 4 == 0"
    {
  (p3 ph11):f2
  "DELTA = d3 - p3"
  DELTA
  (p3*2 ph1):f2
  "DELTA = vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16"
  DELTA
  p19:gp2
  d16
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  "DELTA = d3 + d0*0.5 - p3 - p1*2"
  DELTA
  (p3*2 ph1):f2
  p19:gp2
  d16
  "DELTA = vd*0.5 - p3 - p19 - d16"
  DELTA
  (p3 ph1):f2
    }

  if "l1 % 4 == 1"
    {
  (p3 ph11):f2
  (p3*2 ph1):f2
  "DELTA = d3 - p3 + vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16"
  DELTA
  p19:gp2
  d16
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  "DELTA = d0*0.5 - p1*2"
  DELTA
  (p3*2 ph1):f2
  p19:gp2
  d16
  "DELTA = d3 - p3 + vd*0.5 - p3 - p19 - d16"
  DELTA
  (p3 ph1):f2
    }

  if "l1 % 4 == 2"
    {
  (p3 ph11):f2
  "DELTA = vd*0.5 - p3 - p19 - d16"
  DELTA
  p19:gp2
  d16
  (p3*2 ph1):f2
  "DELTA = d3 + d0*0.5 - p3 - p1*2"
  DELTA
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  p19:gp2
  d16
  "DELTA = vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16"
  DELTA
  (p3*2 ph1):f2
  "DELTA = d3 - p3"
  DELTA
  (p3 ph1):f2
    }

   if "l1 % 4 == 3"
    {
  (p3 ph11):f2
  "DELTA = vd*0.5 - p3 - p19 - d16 + d3 - p3"
  DELTA
  p19:gp2
  d16
  (p3*2 ph1):f2
  "DELTA = d0*0.5 - p1*2"
  DELTA
  (p1 ph2):f1
  (p2 ph1):f1
  (p1 ph2):f1
  p19:gp2
  d16
  "DELTA = vd*0.5 + d0*0.5 - p3 - p1*2 - p19 - d16 + d3 - p3"
  DELTA
  (p3*2 ph1):f2
  (p3 ph1):f2
    }

   ; back-transfer
  "DELTA2 = d2 - d12 - 4u"
  DELTA2
  d12 pl12:f2
  4u BLKGRAD

  ; acquisition
  go=2 ph31 cpd2:f2

  d11 do:f2 mc #0 to 2
    F2I(ip11, 3, iu1, 2)
    F2EA(iu1, id0)
    F1QF(ivd)

  4u BLKGRAD
exit

ph1= 0
ph2= 1
ph11= (3) 0
ph29=0
ph31=0

;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;pl9 : f1 channel - power level for presaturation
;pl12: f2 channel - power level for CPD/BB decoupling
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p3 : f2 channel -  90 degree high power pulse
;p4 : f2 channel - 180 degree high power pulse
;p16: homospoil/gradient pulse
;p19: gradient pulse [300 usec]
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)CH
;d3 : 1/(8J)CH
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d13: short delay                                    [4 usec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(CH)
;cnst21: frequency in Hz for off-res presat
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;l0: number of repeats for entire experiment
;NS: 1 * n
;DS: 16
;td1: number of experiments
;FnMODE: States-TPPI, TPPI, States or QSEQ
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 31%
;gpz2: 7%
;gpz3: -40%
;gpz4: 29%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100
;gpnam3: SMSQ10.32
;gpnam4: SMSQ10.32