b_trosy_hzdqc.cw phase cycling updated

b_trosy_hzdqc.cw phase cycling updated

;BEST-TROSY-H(Z/D)QC
;Chris Waudby, June 2018
;
;options:
; -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 OFFRES_PRESAT
  "TAU=d1-d11-60u-d12*2-d13-d12-50u-p21-p16-d16-4u"
# else
  "TAU=d1-d11-d12-50u-p21-p16-d16-4u"
# endif /*OFFRES_PRESAT*/

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

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

1 ze
  d11
2 d11

# 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"
     {
  ;(lalign (p39:sp23 ph10) (d2 p21 ph11):f3 )
  (p39:sp23 ph10) (d2 p21 ph11):f3
     }
  else
     {
  ;(lalign (p39:sp23 ph10) (d2 p21 ph21):f3 )
  (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"
     {
  (ralign (p40:sp24 ph16) (DELTA2 p21 ph13 d0 p21 ph1 d3):f3 )
  DELTA3
     }
  else
     {
  DELTA3
  ;(lalign (p40:sp24 ph16) (d3 p21 ph23 d0 p21 ph1 DELTA2):f3 )
  (p40:sp24 ph16) (d3 p21 ph23 d0 p21 ph1 DELTA2):f3
     }
  4u
  p16:gp2
  d16
  (center (p40:sp24 ph1) (p22 ph1):f3 )
  4u
  p16:gp2
  d16
  DELTA4 BLKGRAD
  (p21 ph14):f3

  go=2 ph31
  d11 mc #0 to 2
     F1EA(iu0 & ip13*2 & ip14*2, id0 & ip10*2 & ip31*2)

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)
;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/(4J)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
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/ SW(N) = 2 * DW(N)
;nd0: 1
;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%

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

;Processing

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

;BEST-TROSY-H(Z/D)QC
;Chris Waudby, June 2018
;
;options:
; -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 OFFRES_PRESAT
  "TAU=d1-d11-60u-d12*2-d13-d12-50u-p21-p16-d16-4u"
# else
  "TAU=d1-d11-d12-50u-p21-p16-d16-4u"
# endif /*OFFRES_PRESAT*/

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

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

1 ze
  d11
2 d11

# 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
  4u
  p16:gp0
  d16

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

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

  if "l0 %2 == 1"
     {
  (ralign (p40:sp24 ph1) (DELTA2 p21 ph13 d0 p21 ph1 d3):f3 )
  DELTA3
     }
  else
     {
  DELTA3
  (lalign (p40:sp24 ph1) (d3 p21 ph23 d0 p21 ph1 DELTA2):f3 )
     }
  4u
  p16:gp2
  d16
  (center (p40:sp24 ph1) (p22 ph1):f3 )
  4u
  p16:gp2
  d16
  DELTA4 BLKGRAD
  (p21 ph14):f3

  go=2 ph31
  d11 mc #0 to 2
     F1EA(iu0 & ip13*2 & ip14*2, id0)

exit

ph1=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
ph31=0 2 3 1

;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/(4J)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
;inf1: 1/SW(N) = 2 * DW(N)
;in0: 1/ SW(N) = 2 * DW(N)
;nd0: 1
;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%

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

;Processing

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


correcting hmqcgpphpr_1HT2.1.cw

correcting hmqcgpphpr_1HT2.1.cw

; Dec 2016: use baseopt
;
; Jun 2013: added option for Ernst angle excitation
;
; Apr 2013: modified to use half-dwell first-point delay by default
;	    Added option for off-res presat
;
; Option for first row
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
; With options for 15N decoupling and 90,-180 or 180,-360 phase corr.
;
;hmqcphpr
;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)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf2/2"

# ifndef ONE_D

#   ifdef LABEL_CN
    "p22=p21*2"
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-larger(p1,p21)"
#   else
    "d0=in0/2-0.63662*p3-larger(p1,p21)"
#   endif /*SINGLEDWELL*/
#   else
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-p1"
#   else
    "d0=in0/2-0.63662*p3-p1"
#   endif /*SINGLEDWELL*/
#   endif /*LABEL_CN*/

# endif /*ONE_D*/

# ifdef ERNST
    "p0=p1*cnst31"
# endif /*ERNST*/

define delay vdmin
"vdmin=4*(p1+p3)"

"DELTA1=d2-p16-d16"
"DELTA2=d2-p16-d16-d12-4u-de+0.6366*p1"
"acqt0=de"
aqseq 312
baseopt_echo

1 ze
  vdmin
  d11 pl12:f2
2 d11 do:f2

  20u
  "TAU1=vd*0.25-p3"
  "TAU2=vd*0.25-p3-p1"

  4u BLKGRAD

# ifdef OFFRES_PRESAT
    30u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/

  d12 pl9:f1
  d1 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD
  (p3 ph1):f2
  d13
  p16:gp1
  d16*2

# ifdef ERNST
  (p0 ph1):f1
# else
  (p1 ph1):f1
# endif /*ERNST*/

  TAU1
  (p4 ph1):f2
  TAU2
  (p2 ph6):f1
  TAU2
  (p4 ph1):f2
  TAU1

  DELTA1
  p16:gp2
  d16

# ifdef ONE_D

    ( center (p3 ph3 2u p3 ph4):f2 (p2 ph2):f1 )

# else

  (p3 ph3):f2
  d0

#   ifdef LABEL_CN
  (center (p2 ph5):f1 (p22 ph2):f3 )
#   else
  (p2 ph5):f1
#   endif /*LABEL_CN*/

  d0
  (p3 ph4):f2

# endif /*ONE_D*/

  d12 pl12:f2
  p16:gp2
  d16
  4u BLKGRAD
  DELTA2
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
      F1QF(ivd)
      F2PH(ip3 & ip29, id0)
  4u BLKGRAD
exit

ph1=0
ph2=0
ph3=0 2
ph4=0 0 2 2
ph5=0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
ph6=0 0 0 0 1 1 1 1
ph29=0
ph31=0 2 2 0 2 0 0 2 2 0 0 2 0 2 2 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
;p16: homospoil/gradient pulse
;p22 : f3 channel - 180 degree high power pulse
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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)
;nd0: 2
;NS: 4 * 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

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

;for z-only gradients:
;gpz1: 31%
;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)
;SINGLEDWELL: for initial sampling delay of one dwell-time with
;	    option -DSINGLEDWELL (eda: ZGOPTNS)
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;	    option -DOFFRES_PRESAT (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;$Id: hmqcphpr,v 1.4 2007/04/11 13:34:30 ber Exp $

; Dec 2016: use baseopt
;
; Jun 2013: added option for Ernst angle excitation
;
; Apr 2013: modified to use half-dwell first-point delay by default
;	    Added option for off-res presat
;
; Option for first row
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
; With options for 15N decoupling and 90,-180 or 180,-360 phase corr.
;
;hmqcphpr
;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)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf1/2"

# ifndef ONE_D

#   ifdef LABEL_CN
    "p22=p21*2"
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-larger(p1,p21)"
#   else
    "d0=in0/2-0.63662*p3-larger(p1,p21)"
#   endif /*SINGLEDWELL*/
#   else
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-p1"
#   else
    "d0=in0/2-0.63662*p3-p1"
#   endif /*SINGLEDWELL*/
#   endif /*LABEL_CN*/

# endif /*ONE_D*/

# ifdef ERNST
    "p0=p1*cnst31"
# endif /*ERNST*/

define delay vdmin
"vdmin=4*(p1+p3)"

"DELTA1=d2-p16-d16"
"DELTA2=d2-p16-d16-d12-4u-de+0.6366*p1"
"acqt0=de"
aqseq 312
baseopt_echo

1 ze
  vdmin
  d11 pl12:f2
2 d11 do:f2

  20u
  "TAU1=vd*0.25-p3"
  "TAU2=vd*0.25-p3-p1"

  4u BLKGRAD

# ifdef OFFRES_PRESAT
    30u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/

  d12 pl9:f1
  d1 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD
  (p3 ph1):f2
  d13
  p16:gp1
  d16*2

# ifdef ERNST
  (p0 ph1):f1
# else
  (p1 ph1):f1
# endif /*ERNST*/

  TAU1
  (p4 ph1):f2
  TAU2
  (p2 ph6):f1
  TAU2
  (p4 ph1):f2
  TAU1

  DELTA1
  p16:gp2
  d16

# ifdef ONE_D

    ( center (p3 ph3 2u p3 ph4):f2 (p2 ph2):f1 )

# else

  (p3 ph3):f2
  d0

#   ifdef LABEL_CN
  (center (p2 ph5):f1 (p22 ph2):f3 )
#   else
  (p2 ph5):f1
#   endif /*LABEL_CN*/

  d0
  (p3 ph4):f2

# endif /*ONE_D*/

  d12 pl12:f2
  p16:gp2
  d16
  4u BLKGRAD
  DELTA2
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
      F1QF(ivd)
      F2PH(ip3 & ip29, id0)
  4u BLKGRAD
exit

ph1=0
ph2=0
ph3=0 2
ph4=0 0 2 2
ph5=0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
ph6=0 0 0 0 1 1 1 1
ph29=0
ph31=0 2 2 0 2 0 0 2 2 0 0 2 0 2 2 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
;p16: homospoil/gradient pulse
;p22 : f3 channel - 180 degree high power pulse
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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)
;nd0: 2
;NS: 4 * 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

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

;for z-only gradients:
;gpz1: 31%
;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)
;SINGLEDWELL: for initial sampling delay of one dwell-time with
;	    option -DSINGLEDWELL (eda: ZGOPTNS)
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;	    option -DOFFRES_PRESAT (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;$Id: hmqcphpr,v 1.4 2007/04/11 13:34:30 ber Exp $


15N CEST water purge improved

15N CEST water purge improved

;15N-CEST experiment based on Lakomek sensitivity-enhanced 15N-T1 measurement
;Chris Waudby, June 2016
;

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

;list of CEST saturation frequencies
;first line in file 'Hz sfo'
;second line in file should be zero, indicating the reference plane
;give values in Hz relative to sfo3
define list<frequency> N15sat = <$FQ3LIST>

;38 points in steps of 45 Hz:
;define list<frequency> N15sat = {0  -810.0 -765.0 -720.0 -675.0 -630.0 -585.0 -540.0 -495.0 -450.0 -405.0 -360.0 -315.0 -270.0 -225.0 -180.0 -135.0 -90.0 -45.0 0.0 45.0 90.0 135.0 180.0 225.0 270.0 315.0 360.0 405.0 450.0 495.0 540.0 585.0 630.0 675.0 720.0 765.0 810.0}
;define list<frequency> N15sat = {0 -1000 0}
;define list<frequency> N15sat = {0}

"in0=inf2*0.5"

"p2=p1*2"
"p22=p21*2"

"d0=10u"
"d11=30m"
"d26=p21-p1"
"DELTA=2.65m"
"DELTA1=2.65m"
"DELTA2=2.65m-200u"
"DELTA3=2.65m-200u"
"DELTA4=p24-p19*0.6366"
"DELTA5=2.65m-p25-200u"
"DELTA7=2.65m"

"l2=1" ; loop counter for saturation list
"l6=td1"
"l3=td2/2"
; used to identify first point as the reference spectrum,
; and to activate temperature compensation for this point

"DELTA6=30u+p2" ; for zero phase correction

;"cnst18=-800"
;"cnst19=8.2"

aqseq 312
"acqt0=0"

1 ze
  1m
2 2m do:f3
  1m LOCKH_OFF
  d11
3 3m
4 1m
5 1m do:f3
  10u UNBLKGRAD

;---------temperature compensation and d1 recovery delay---------

; apply temperature compensation for 1st point (reference with no spinlock)
if "l2==1"
{
    10u LOCKH_ON
    10u fq=cnst19(bf ppm):f1 ; put 1H on amides
    10u pl8:f1
    d18 cpds1:f1
    10u do:f1
    10u fq=0:f1 ; put 1H back on water
    10u LOCKH_OFF
}
; purge water before recycle delay
10u pl8:f1
2mp ph0
3mp ph1
10u pl1:f1
;10u pl1:f1
;(p1 ph0):f1
;5u
;p16:gp8
;200u
1m BLKGRAD

d1

1m UNBLKGRAD

;------- kill steady state 15N ------------
10u pl3:f3
(p21 ph0):f3
5u
p16:gp9
200u

;------- first INEPT Hz-> 2HxNz -------------------------
(p1 ph0):f1
5u
DELTA gron0 ; soft gradient to prevent radiation damping
5u  groff
(center (p2 ph0):f1 (p22 ph0):f3)
5u
DELTA gron0
5u groff

;------- rephase  2HxNz to Nz-----------------------------
(center (p1 ph5):f1  (p21 ph0):f3)
5u
DELTA1 gron1 ; soft gradient to prevent radiation damping
5u groff
(center (p2 ph0):f1 (p22 ph0):f3)
5u
DELTA1 gron1
5u groff
(center (p1 ph2):f1 (p21 ph6):f3) ; phase-cycle Nz, -Nz for Freeman-Hill decay
                                  ; purge pulse to kill any residual HzNz
;--------------------------------------------------------
5u
p16:gp6  ; cleaning gradient
200u

;------15N T1 relaxation period--------------------------
5u pl8:f1 pl18:f3

; water purge
2mp ph0
3mp ph1

if "l2==1" goto 77
5u LOCKH_ON
5u N15sat:f3
5u fq=cnst19(bf ppm):f1
d18 cpds1:f1 cw:f3 ph0
5u do:f1 do:f3
5u LOCKH_OFF
5u fq=0:f1
5u fq=0:f3
77 5u
5u

; water purge
2mp ph0
3mp ph1

5u pl1:f1 pl3:f3

5u
p16:gp7  ; cleaning gradient
200u
;goto 999
;---------- Echo-Antiecho encoding------------------------
(p21 ph7):f3
DELTA6 ;compensation for d0 15N evolution
DELTA5
190u
p25:gp5*EA ; 1ms
10u
(center (p2 ph0):f1 (p22 ph9):f3)
10u
p25:gp5*EA*-1 ; 1ms
190u
DELTA5

; t1 evolution ---------------------------------------------
d0*0.5 gron1
5u groff
d0*0.5 gron1*-1
5u groff
(p2 ph0):f1
d0
;--------Rance-Kay transfer back ----------------------------

(center (p1 ph0):f1 (p21 ph8):f3)
DELTA2 gron2
200u groff
(center(p2 ph0):f1 (p22 ph0):f3)
DELTA2 gron2
200u groff

; ---second INEPT ----------------------------------------
(center (p1 ph1):f1 (p21 ph1):f3)    ;DOUBLE 90
DELTA3 gron3
200u groff
(center(p2 ph0):f1 (p22 ph0):f3)
DELTA3 gron3
200u groff

d26*0.5 ;d26 = p21 - p1
(p19 ph0:r):f1 ; fine tune p19 for water suppression
245u
DELTA4
(p2 ph0):f1
5u
p24:gp4 ; 201u
200u

999  10u
10u pl31:f3
20u BLKGRAD

go=2 ph31 cpds3:f3
500u do:f3
d11 wr #0 if #0 zd

; loop over CEST frequencies
1m N15sat.inc
1m iu2
lo to 3 times l6

; Echo/Anti-echo
1m ip8*2
1m igrad EA
1m ru2
1m N15sat.res
lo to 4 times 2

; t1 evolution
1m id0
1m ip7*2
1m ip31*2
lo to 5 times l3

1m do:f3
1m BLKGRAD
exit

ph0= 0
ph1= 1          ;check right phase for Boltzmann !!!!!
ph2= 2
ph5= 1 1 1 1
ph6= 1 1 3 3
ph7= 1 3
ph8= 0
ph9= 1 3
ph31=1 3 3 1

;-------------NOTES----------------------

;o1p = 4.7 ppm
;o3p=119 ppm

;NS=4*n
;in0=inf/2
;SW=1/(2*in0)
;echo-antiecho in N15 (process as Complex in NmrDraw before splitting the spectra)

;d18: relaxation time

;l6: number of CEST frequencies (including reference) (td1)
;l3: number of complex points (td2 / 2)
;cnst19: chemical shift at center of amide region (ppm)

; 1H pulses

;p1:  90 deg hard 1H pulse @pl1
;p19 last 90 deg hard 1H pulse @pl1, can be adjusted for improving water-supression
;pl1: 1H 90 deg
;pl0: 120 dB
;pcpd1: 1H 90 for CPD (4.5 kHz at 900 MHz = 55.5 us)
;pl8: 1H decoupling power (4.5 kHz at 900 MHz = 55.5 us)

;15N pulses
;p21 : 90 deg hard 15N pulse @pl3
;pl3 :15N 90 deg
;pl18: 15N spin-lock power
;CPDPRG3: garp (aq 15N decoupling)
;pcpd3: 15N decoupling (200u @pl31)
;pl31: 15N decoupling power

; gradients
;p16: 1000u
;p17: 200u
;p24: 201u Echo/Anti-echo decoding gradient
;p25: 1000u Echo/Anti-echo half-encoding gradient

;for z-only gradients
;gpz0: 3%
;gpz1: 2%
;gpz2: -5%
;gpz3: -0.5%
;gpz4: 40%
;gpz5: 40%
;gpz6: 30%
;gpz7: 50%
;gpz8: 77%
;gpz9: 40%

;gpnam4 SINE.10
;gpnam5 SINE.10
;gpnam6 SINE.50
;gpnam7 SINE.10
;gpnam8 SMSQ10.100
;gpnam9 SMSQ10.100

;15N-CEST experiment based on Lakomek sensitivity-enhanced 15N-T1 measurement
;Chris Waudby, June 2016
;

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

;list of CEST saturation frequencies
;first line in file 'Hz sfo'
;second line in file should be zero, indicating the reference plane
;give values in Hz relative to sfo3
define list<frequency> N15sat = <$FQ3LIST>

;38 points in steps of 45 Hz:
;define list<frequency> N15sat = {0  -810.0 -765.0 -720.0 -675.0 -630.0 -585.0 -540.0 -495.0 -450.0 -405.0 -360.0 -315.0 -270.0 -225.0 -180.0 -135.0 -90.0 -45.0 0.0 45.0 90.0 135.0 180.0 225.0 270.0 315.0 360.0 405.0 450.0 495.0 540.0 585.0 630.0 675.0 720.0 765.0 810.0}
;define list<frequency> N15sat = {0 -1000 0}
;define list<frequency> N15sat = {0}

"in0=inf2*0.5"

"p2=p1*2"
"p22=p21*2"

"d0=10u"
"d11=30m"
"d26=p21-p1"
"DELTA=2.65m"
"DELTA1=2.65m"
"DELTA2=2.65m-200u"
"DELTA3=2.65m-200u"
"DELTA4=p24-p19*0.6366"
"DELTA5=2.65m-p25-200u"
"DELTA7=2.65m"

"l2=1" ; loop counter for saturation list
"l6=td1"
"l3=td2/2"
; used to identify first point as the reference spectrum,
; and to activate temperature compensation for this point

"DELTA6=30u+p2" ; for zero phase correction

;"cnst18=-800"
;"cnst19=8.2"

aqseq 312
"acqt0=0"

1 ze
  1m
2 2m do:f3
  1m LOCKH_OFF
  d11
3 3m
4 1m
5 1m do:f3
  10u UNBLKGRAD

;---------temperature compensation and d1 recovery delay---------

; apply temperature compensation for 1st point (reference with no spinlock)
if "l2==1"
{
    10u LOCKH_ON
    10u fq=cnst19(bf ppm):f1 ; put 1H on amides
    10u pl8:f1
    d18 cpds1:f1
    10u do:f1
    10u fq=0:f1 ; put 1H back on water
    10u LOCKH_OFF
}
; purge water before recycle delay
10u pl1:f1
(p1 ph0):f1
5u
p16:gp8
200u
1m BLKGRAD

d1

1m UNBLKGRAD

;------- kill steady state 15N ------------
10u pl3:f3
(p21 ph0):f3
5u
p16:gp9
200u

;------- first INEPT Hz-> 2HxNz -------------------------
(p1 ph0):f1
5u
DELTA gron0 ; soft gradient to prevent radiation damping
5u  groff
(center (p2 ph0):f1 (p22 ph0):f3)
5u
DELTA gron0
5u groff

;------- rephase  2HxNz to Nz-----------------------------
(center (p1 ph5):f1  (p21 ph0):f3)
5u
DELTA1 gron1 ; soft gradient to prevent radiation damping
5u groff
(center (p2 ph0):f1 (p22 ph0):f3)
5u
DELTA1 gron1
5u groff
(center (p1 ph2):f1 (p21 ph6):f3) ; phase-cycle Nz, -Nz for Freeman-Hill decay
                                  ; purge pulse to kill any residual HzNz
;--------------------------------------------------------
5u
p16:gp6  ; cleaning gradient
200u

;------15N T1 relaxation period--------------------------
5u pl8:f1 pl18:f3

if "l2==1" goto 77
5u LOCKH_ON
5u N15sat:f3
5u fq=cnst19(bf ppm):f1
d18 cpds1:f1 cw:f3 ph0
5u do:f1 do:f3
5u LOCKH_OFF
5u fq=0:f1
5u fq=0:f3
77 5u
5u

; water purge
2mp ph0
3mp ph1

 5u pl1:f1 pl3:f3

5u
p16:gp7  ; cleaning gradient
200u

;---------- Echo-Antiecho encoding------------------------
(p21 ph7):f3
DELTA6 ;compensation for d0 15N evolution
DELTA5
190u
p25:gp5*EA ; 1ms
10u
(center (p2 ph0):f1 (p22 ph9):f3)
10u
p25:gp5*EA*-1 ; 1ms
190u
DELTA5

; t1 evolution ---------------------------------------------
d0*0.5 gron1
5u groff
d0*0.5 gron1*-1
5u groff
(p2 ph0):f1
d0
;--------Rance-Kay transfer back ----------------------------

(center (p1 ph0):f1 (p21 ph8):f3)
DELTA2 gron2
200u groff
(center(p2 ph0):f1 (p22 ph0):f3)
DELTA2 gron2
200u groff

; ---second INEPT ----------------------------------------
(center (p1 ph1):f1 (p21 ph1):f3)    ;DOUBLE 90
DELTA3 gron3
200u groff
(center(p2 ph0):f1 (p22 ph0):f3)
DELTA3 gron3
200u groff

d26*0.5 ;d26 = p21 - p1
(p19 ph0:r):f1 ; fine tune p19 for water suppression
245u
DELTA4
(p2 ph0):f1
5u
p24:gp4 ; 201u
200u

999  10u
10u pl31:f3
20u BLKGRAD

go=2 ph31 cpds3:f3
500u do:f3
d11 wr #0 if #0 zd

; loop over CEST frequencies
1m N15sat.inc
1m iu2
lo to 3 times l6

; Echo/Anti-echo
1m ip8*2
1m igrad EA
1m ru2
1m N15sat.res
lo to 4 times 2

; t1 evolution
1m id0
1m ip7*2
1m ip31*2
lo to 5 times l3

1m do:f3
1m BLKGRAD
exit

ph0= 0
ph1= 1          ;check right phase for Boltzmann !!!!!
ph2= 2
ph5= 1 1 1 1
ph6= 1 1 3 3
ph7= 1 3
ph8= 0
ph9= 1 3
ph31=1 3 3 1

;-------------NOTES----------------------

;o1p = 4.7 ppm
;o3p=119 ppm

;NS=4*n
;in0=inf/2
;SW=1/(2*in0)
;echo-antiecho in N15 (process as Complex in NmrDraw before splitting the spectra)

;d18: relaxation time

;l6: number of CEST frequencies (including reference) (td1)
;l3: number of complex points (td2 / 2)
;cnst19: chemical shift at center of amide region (ppm)

; 1H pulses

;p1:  90 deg hard 1H pulse @pl1
;p19 last 90 deg hard 1H pulse @pl1, can be adjusted for improving water-supression
;pl1: 1H 90 deg
;pl0: 120 dB
;pcpd1: 1H 90 for CPD (4.5 kHz at 900 MHz = 55.5 us)
;pl8: 1H decoupling power (4.5 kHz at 900 MHz = 55.5 us)

;15N pulses
;p21 : 90 deg hard 15N pulse @pl3
;pl3 :15N 90 deg
;pl18: 15N spin-lock power
;CPDPRG3: garp (aq 15N decoupling)
;pcpd3: 15N decoupling (200u @pl31)
;pl31: 15N decoupling power

; gradients
;p16: 1000u
;p17: 200u
;p24: 201u Echo/Anti-echo decoding gradient
;p25: 1000u Echo/Anti-echo half-encoding gradient

;for z-only gradients
;gpz0: 3%
;gpz1: 2%
;gpz2: -5%
;gpz3: -0.5%
;gpz4: 40%
;gpz5: 40%
;gpz6: 30%
;gpz7: -50%
;gpz8: 77%
;gpz9: 40%

;gpnam4 SINE.10
;gpnam5 SINE.10
;gpnam6 SINE.50
;gpnam7 SINE.10
;gpnam8 SMSQ10.100
;gpnam9 SMSQ10.100


fix 1D mode for hmqcgpphpr.cw

fix 1D mode for hmqcgpphpr.cw

; Dec 2016: use baseopt
;
; Jun 2013: added option for Ernst angle excitation
;
; Apr 2013: modified to use half-dwell first-point delay by default
;	    Added option for off-res presat
;
; Option for first row
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
; With options for 15N decoupling and 90,-180 or 180,-360 phase corr.
;
;hmqcphpr
;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"
"d2=1s/(cnst2*2)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf1/2"

# ifndef ONE_D

#   ifdef LABEL_CN
    "p22=p21*2"
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-larger(p1,p21)"
#   else
    "d0=in0/2-0.63662*p3-larger(p1,p21)"
#   endif /*SINGLEDWELL*/
#   else
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-p1"
#   else
    "d0=in0/2-0.63662*p3-p1"
#   endif /*SINGLEDWELL*/
#   endif /*LABEL_CN*/

# endif /*ONE_D*/

# ifdef ERNST
    "p0=p1*cnst31"
# endif /*ERNST*/

"DELTA1=d2-p16-d16"
"DELTA2=d2-p16-d16-d12-4u-de+0.6366*p1"
"acqt0=de"

1 ze
  d11 pl12:f2
2 d11 do:f2
  4u BLKGRAD

# ifdef OFFRES_PRESAT
    30u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/

  d12 pl9:f1
  d1 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD
  (p3 ph1):f2
  d13
  p16:gp1
  d16*2

# ifdef ERNST
  (p0 ph1):f1
# else
  (p1 ph1):f1
# endif /*ERNST*/

  DELTA1
  p16:gp2
  d16

# ifdef ONE_D

    ( center (p3 ph3 0.1u p3 ph4):f2 (p2 ph5):f1 )

# else

  (p3 ph3):f2
  d0

#   ifdef LABEL_CN
  (center (p2 ph5):f1 (p22 ph2):f3 )
#   else
  (p2 ph5):f1
#   endif /*LABEL_CN*/

  d0
  (p3 ph4):f2

# endif /*ONE_D*/

  d12 pl12:f2
  p16:gp2
  d16
  4u BLKGRAD
  DELTA2
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2 F1PH(ip3 & ip29, id0)
  4u BLKGRAD
exit

ph1=0
ph2=0
ph3=0 2
ph4=0 0 2 2
ph5=0 0 0 0 1 1 1 1
ph29=0

# ifdef FILTERED
ph31=0 0 0 0 2 2 2 2
# else
ph31=0 2 2 0 2 0 0 2
# endif /*FILTERED*/

;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
;p16: homospoil/gradient pulse
;p22 : f3 channel - 180 degree high power pulse
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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)
;nd0: 2
;NS: 4 * 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

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

;for z-only gradients:
;gpz1: 31%
;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)
;SINGLEDWELL: for initial sampling delay of one dwell-time with
;	    option -DSINGLEDWELL (eda: ZGOPTNS)
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;	    option -DOFFRES_PRESAT (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;$Id: hmqcphpr,v 1.4 2007/04/11 13:34:30 ber Exp $

; Dec 2016: use baseopt
;
; Jun 2013: added option for Ernst angle excitation
;
; Apr 2013: modified to use half-dwell first-point delay by default
;	    Added option for off-res presat
;
; Option for first row
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
; With options for 15N decoupling and 90,-180 or 180,-360 phase corr.
;
;hmqcphpr
;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"
"d2=1s/(cnst2*2)"
"d11=30m"
"d12=20u"
"d13=4u"

"in0=inf1/2"

# ifndef ONE_D

#   ifdef LABEL_CN
    "p22=p21*2"
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-larger(p1,p21)"
#   else
    "d0=in0/2-0.63662*p3-larger(p1,p21)"
#   endif /*SINGLEDWELL*/
#   else
#   ifdef SINGLEDWELL
    "d0=in0-0.63662*p3-p1"
#   else
    "d0=in0/2-0.63662*p3-p1"
#   endif /*SINGLEDWELL*/
#   endif /*LABEL_CN*/

# endif /*ONE_D*/

# ifdef ERNST
    "p0=p1*cnst31"
# endif /*ERNST*/

"DELTA1=d2-p16-d16"
"DELTA2=d2-p16-d16-d12-4u-de+0.6366*p1"
"acqt0=de"

1 ze
  d11 pl12:f2
2 d11 do:f2
  4u BLKGRAD

# ifdef OFFRES_PRESAT
    30u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/

  d12 pl9:f1
  d1 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD
  (p3 ph1):f2
  d13
  p16:gp1
  d16*2

# ifdef ERNST
  (p0 ph1):f1
# else
  (p1 ph1):f1
# endif /*ERNST*/

  DELTA1
  p16:gp2
  d16

# ifdef ONE_D

    ( center (p3 ph3 2u p3 ph4):f2 (p2 ph2):f1 )

# else

  (p3 ph3):f2
  d0

#   ifdef LABEL_CN
  (center (p2 ph5):f1 (p22 ph2):f3 )
#   else
  (p2 ph5):f1
#   endif /*LABEL_CN*/

  d0
  (p3 ph4):f2

# endif /*ONE_D*/

  d12 pl12:f2
  p16:gp2
  d16
  4u BLKGRAD
  DELTA2
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2 F1PH(ip3 & ip29, id0)
  4u BLKGRAD
exit

ph1=0
ph2=0
ph3=0 2
ph4=0 0 2 2
ph5=0 0 0 0 1 1 1 1
ph29=0

# ifdef FILTERED
ph31=0 0 0 0 2 2 2 2
# else
ph31=0 2 2 0 2 0 0 2
# endif /*FILTERED*/

;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
;p16: homospoil/gradient pulse
;p22 : f3 channel - 180 degree high power pulse
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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)
;nd0: 2
;NS: 4 * 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

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

;for z-only gradients:
;gpz1: 31%
;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)
;SINGLEDWELL: for initial sampling delay of one dwell-time with
;	    option -DSINGLEDWELL (eda: ZGOPTNS)
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;	    option -DOFFRES_PRESAT (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

;$Id: hmqcphpr,v 1.4 2007/04/11 13:34:30 ber Exp $


fixing ch3_mq_cpmg.cw for interleaving in ts3.5pl7

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

define delay TIME_T2
"TIME_T2 = 40m"

define delay DEL
define delay DEL_1
define delay DEL_2

define delay TAUB
"TAUB = 960u - p24 - 2u"
define delay COMPH
"COMPH = p1"

define loopcounter COUNTER

;define list<loopcounter> ncyc = {0}
;define list<loopcounter> ncyc = {0 1 20}
;define list<loopcounter> ncyc = {0 1 40}
;define list<loopcounter> ncyc = {0 1 2 3 4 5 6 7 8 9 10 12 14 16 18 20 24 28 32 36 40}
;define list<loopcounter> ncyc = {0 1 2 3 4 5 6 7 8 9 10 12 14 16 18 20}
;define list<loopcounter> ncyc = {0 20 1 18 2 16 3 14 4 12 5 10 6 9 7 8}
define list<loopcounter> ncyc = {0 40 1 36 2 32 3 28 4 24 5 20 6 18 7 16 8 14 9 12 10}
;define loopcounter ncyc
;"ncyc = l0" ;"ncyc=0"

;"d3=3.75m - p23 - 2u"
;"d4=3.75m - p23 - 2u - p8"
"d3=4m - p23 - 2u + 0.6366*p1"
"d4=4m - p23 - 2u - p8 - 4u"
"acqt0=0"

"d11=1m"
"d12=1m"

;carbon evolution time
"in0=inf2/2"
"d0=in0*0.5 - p8*0.5*0.63662 - p1*2 - 2u - p1"

aqseq 312

1 ze
  10m st0
2 2u do:f2
3 2u do:f2
4 d1 do:f2

"if (ncyc == 0) \
  { \
   DEL = TIME_T2/4 - p8; \
   DEL_1 = DEL - p8*0.63662*0.5; \
   DEL_2 = DEL - p1; \
   COUNTER = 0; \
  } \
else \
  { \
   DEL = TIME_T2/(4*ncyc) - p8; \
   DEL_1 = TIME_T2/(4*ncyc) - p8 - p8*0.63662*0.5; \
   DEL_2 = DEL - p1; \
   COUNTER = ncyc - 2; \
  }"

  1m UNBLKGRAD
  10u pl8:f2
  10u pl0:f1
  (p2:sp2 ph0:r):f1    ; SOLVENT SUPPRESSION FLIP-BACKS
  2u pl0:f1
  (p8 ph0):f2
  2u
  p20:gp0
  2.0m pl1:f1

   (p1 ph0):f1
   2u
   p23:gp3
   d3

   (p8 ph1):f2
   2u
   p24:gp4
   TAUB
   (center (p8*2 ph0):f2 (p1*2 ph0):f1)
   2u
   p24:gp4
   TAUB
   (p8 ph2):f2
;******	CPMG STARTS HERE **************
if "ncyc == 1"
{
   DEL
   (p8*2 ph5):f2
   DEL_2
}

if "ncyc == 2"
{
   DEL
   (p8*2 ph5):f2
   DEL
   DEL
   (p8*2 ph5):f2
   DEL_2
}

if "ncyc > 2"
{
   DEL
   (p8*2 ph5):f2
   DEL
10 DEL
   (p8*2 ph5):f2
   DEL
lo to 10 times COUNTER
   DEL
   (p8*2 ph5):f2
   DEL_2
}

  (p1*2 ph3):f1

if "ncyc == 1"
{
   DEL_2
   (p8*2 ph5):f2
   DEL
}

if "ncyc == 2"
{
   DEL_2
   (p8*2 ph5):f2
   DEL
   DEL
   (p8*2 ph5):f2
   DEL
}

if "ncyc > 2"
{
   DEL_2
   (p8*2 ph5):f2
   DEL
20 DEL
   (p8*2 ph5):f2
   DEL
lo to 20 times COUNTER
   DEL
   (p8*2 ph5):f2
   DEL
}
;****** CPMG ENDS HERE ****************
;******	carbon evolution **************
if "ncyc == 0"
{
   d0
   (p1 ph0 2u p1*2 ph7 2u p1 ph0):f1
   d0
}
else
{
   COMPH
   d0
   (p1 ph0 2u p1*2 ph7 2u p1 ph0):f1
   d0
   COMPH
}
;****** back to protons ***************
   (p8 ph4):f2
   2u
   p23:gp3
   d4 pl31:f2
   4u BLKGRAD

;start looping experiment
;  go=2 ph31 cpd2:f2
;  d11 do:f2 wr #0 if #0 zd
;    F1QF(ncyc.inc)
;    F2PH(ip4, id0)

   goscnp ph31 cpd2:f2

   3m do:f2
   3m st ncyc.inc   ; nbl = number of CPMG points
   lo to 2 times nbl

   20u ncyc.res
   3m ipp1 ipp2 ipp3 ipp31
   lo to 3 times ns  ; CPMG innermost loop, then ns

;   1m BLKGRAD
   d1 mc #0 to 4
      F1QF()
      F2PH(calph(ph4, +90) & exec(rppall), caldel(d0,+in0))

1m BLKGRAD
exit

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

;pl1 : 1H hard 90
;pl8 : 13C hard 90 and CPMG (19 kHz)
;pl31 : 13C decoupling (2 kHz)
;p1 : 1H hard 90
;p2 : 1000 us, water flip-down
;p8 : 13C hard 90 (13.16 us for 19 kHz)
;p20 : purge gradient [1 ms]
;p23 : coherence selection [600 us]
;p24 : coherence selection [200 us]
;sp2 : 1H water flip-down (sinc1.1000)
;spoff2 : place on residual HDO resonance
;cpd2 : 13C decoupling, WALTZ-16
;pcpd2 : 13C decoupling (2 kHz)
;gpz0 : 10%
;gpz3 : 40%
;gpz4 : -40%
;o1p : 1H carrier on methyl resonances

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

define delay TIME_T2
"TIME_T2 = 40m"

define delay DEL
define delay DEL_1
define delay DEL_2

define delay TAUB
"TAUB = 960u - p24 - 2u"
define delay COMPH
"COMPH = p1"

define loopcounter COUNTER

;define list<loopcounter> ncyc = {0}
;define list<loopcounter> ncyc = {0 1 20}
;define list<loopcounter> ncyc = {0 1 40}
;define list<loopcounter> ncyc = {0 1 2 3 4 5 6 7 8 9 10 12 14 16 18 20 24 28 32 36 40}
;define list<loopcounter> ncyc = {0 1 2 3 4 5 6 7 8 9 10 12 14 16 18 20}
;define list<loopcounter> ncyc = {0 20 1 18 2 16 3 14 4 12 5 10 6 9 7 8}
define list<loopcounter> ncyc = {0 40 1 36 2 32 3 28 4 24 5 20 6 18 7 16 8 14 9 12 10}
;define loopcounter ncyc
;"ncyc = l0" ;"ncyc=0"

;"d3=3.75m - p23 - 2u"
;"d4=3.75m - p23 - 2u - p8"
"d3=4m - p23 - 2u + 0.6366*p1"
"d4=4m - p23 - 2u - p8"
"acqt0=0"

"d11=1m"
"d12=1m"

;carbon evolution time
"in0=inf2/2"
"d0=in0*0.5 - p8*0.5*0.63662 - p1*2 - 2u - p1"

aqseq 312

1 ze
  10m st0
2 2u do:f2
3 2u do:f2
  1m BLKGRAD
4 d1 do:f2

if "ncyc == 0"
  {
   "DEL = TIME_T2/4 - p8"
   "DEL_1 = DEL - p8*0.63662*0.5"
   "DEL_2 = DEL - p1"
   "COUNTER = 0"
  }
else
  {
   "DEL = TIME_T2/(4*ncyc) - p8"
   "DEL_1 = TIME_T2/(4*ncyc) - p8 - p8*0.63662*0.5"
   "DEL_2 = DEL - p1"
   "COUNTER = ncyc - 2"
  }

  1m UNBLKGRAD
  10u pl8:f2
  10u pl0:f1
  (p2:sp2 ph0:r):f1    ; SOLVENT SUPPRESSION FLIP-BACKS
  2u pl0:f1
  (p8 ph0):f2
  2u
  p20:gp0
  2.0m pl1:f1

   (p1 ph0):f1
   2u
   p23:gp3
   d3

   (p8 ph1):f2
   2u
   p24:gp4
   TAUB
   (center (p8*2 ph0):f2 (p1*2 ph0):f1)
   2u
   p24:gp4
   TAUB
   (p8 ph2):f2
;******	CPMG STARTS HERE **************
if "ncyc == 1"
{
   DEL
   (p8*2 ph5):f2
   DEL_2
}

if "ncyc == 2"
{
   DEL
   (p8*2 ph5):f2
   DEL
   DEL
   (p8*2 ph5):f2
   DEL_2
}

if "ncyc > 2"
{
   DEL
   (p8*2 ph5):f2
   DEL
10 DEL
   (p8*2 ph5):f2
   DEL
lo to 10 times COUNTER
   DEL
   (p8*2 ph5):f2
   DEL_2
}

  (p1*2 ph3):f1

if "ncyc == 1"
{
   DEL_2
   (p8*2 ph5):f2
   DEL
}

if "ncyc == 2"
{
   DEL_2
   (p8*2 ph5):f2
   DEL
   DEL
   (p8*2 ph5):f2
   DEL
}

if "ncyc > 2"
{
   DEL_2
   (p8*2 ph5):f2
   DEL
20 DEL
   (p8*2 ph5):f2
   DEL
lo to 20 times COUNTER
   DEL
   (p8*2 ph5):f2
   DEL
}
;****** CPMG ENDS HERE ****************
;******	carbon evolution **************
if "ncyc == 0"
{
   d0
   (p1 ph0 2u p1*2 ph7 2u p1 ph0):f1
   d0
}
else
{
   COMPH
   d0
   (p1 ph0 2u p1*2 ph7 2u p1 ph0):f1
   d0
   COMPH
}
;****** back to protons ***************
   (p8 ph4):f2
   2u
   p23:gp3
   d4 pl31:f2

;start looping experiment
   goscnp ph31 cpd2:f2

   3m do:f2
   3m st ncyc.inc   ; nbl = number of CPMG points
   lo to 2 times nbl

   3m ipp1 ipp2 ipp3 ipp31
   lo to 3 times ns  ; CPMG innermost loop, then ns

   1m BLKGRAD
   d1 mc #0 to 4
      F1QF()
      F2PH(ip4, id0)

;   d11 wr #0 if #0 zd
;
;   d12 ncyc.inc
;   lo to 3 times l2    ; l2 = number of CPMG points
;
;   d12 ip4
;   lo to 4 times 2     ; states-TPPI
;
;   d12 ip31
;   d12 ip31
;   d12 id0
;   lo to 5 times l3    ; l3 = number of complex points

1m BLKGRAD
exit

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

;pl1 : 1H hard 90
;pl8 : 13C hard 90 and CPMG (19 kHz)
;pl31 : 13C decoupling (2 kHz)
;p1 : 1H hard 90
;p2 : 1000 us, water flip-down
;p8 : 13C hard 90 (13.16 us for 19 kHz)
;p20 : purge gradient [1 ms]
;p23 : coherence selection [600 us]
;p24 : coherence selection [200 us]
;sp2 : 1H water flip-down (sinc1.1000)
;spoff2 : place on residual HDO resonance
;cpd2 : 13C decoupling, WALTZ-16
;pcpd2 : 13C decoupling (2 kHz)
;gpz0 : 10%
;gpz3 : 40%
;gpz4 : -40%
;o1p : 1H carrier on methyl resonances


fix offres presat during STE, and replace cnst21 with cnst22 to avoid dosy overwrite

; stebphmqcgpphpr2.cw
; 1H STE diffusion measurement with 13C editing via HMQC
; pseudo-2D (indirect diffusion dimension, no carbon frequency dimension)
; with water saturation during diffusion delay
; off-resonance presat (-DOFFRES_PRESAT) (cnst22 Hz relative to bf)
;
; With proton stimulated gradient-echo prior to HMQC
; Lit. Protein Engineering, Design & Selection, 24, 99-103 (2011)
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
;
;hmqcphpr
;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=

;prosol relations=<triple_d>
prosol relations=<triple>

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

define list<gradient> diff=<Difframp>

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

"DELTA1=d2-p16-d16"
"DELTA2=d2-p16-d16-d12-4u+0.6366*p1-de"
"DELTA3=d20-2*p30-p19-3*d16-p2-2*p1-d12-d13-8u"
"acqt0=de"

1 ze
2 d11 do:f2
  4u BLKGRAD
  4u pl9:f1

# ifdef OFFRES_PRESAT
  4u fq=cnst22(bf hz):f1
# endif /*OFFRES_PRESAT*/

  d1 cw:f1 ph29
  4u do:f1
  4u pl1:f1 pl2:f2
  4u fq=0:f1
  4u UNBLKGRAD
  (p3 ph1):f2
  4u
  p16:gp1
  d16
;----------- STE element -------------
  p1 ph1
  p30:gp6*diff
  d16
  p2 ph5
  p30:gp6*-1*diff
  d16
  p1 ph1
  p19:gp4
  d16 pl9:f1
# ifdef OFFRES_PRESAT
  4u fq=cnst22(bf hz):f1
# else
  4u
# endif /*OFFRES_PRESAT*/
  DELTA3 cw:f1 ph29
  d13 do:f1
  4u fq=0:f1
  d12 pl1:f1
  p1 ph2
  p30:gp6*diff
  d16
  p2 ph6
  p30:gp6*-1*diff
  d16
;--------------- HMQC ----------------

  DELTA1
  p16:gp2
  d16

  ( center (p3 ph3 0.1u p3 ph4):f2 (p2 ph1):f1 )

  d12 pl12:f2
  p16:gp2
  d16
  4u BLKGRAD
  DELTA2
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
	F1QF(igrad diff)

  ; repeat whole experiment
  lo to 2 times l0

  4u BLKGRAD
exit

ph1= 0
ph2= 2
ph3= 0 2
ph4= 0 0 2 2
ph5= 0 0 0 0 2 2 2 2
ph6= 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph29=0
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
;p16: homospoil/gradient pulse
;p19: gradient pulse 2 (spoil gradient)
;p30: gradient pulse (little DELTA * 0.5)
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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
;d20: diffusion time (big DELTA)
;cnst2: = J(CH)
;cnst22: frequency for off-res presat (Hz relative to bf)
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;nd0: 2
;l0: number of repeats for entire experiment
;NS: 4 * 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

;use gradient ratio:    gp 1  : gp 2  : gp6  : gp4
;                       -17.13: -13.17: var  :-15.37

;for z-only gradients:
;gpz1: -17.13%
;gpz2: -13.17%
;gpz4: -15.37%
;gpz6: 100%

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

; stebphmqcgpphpr2.cw
; 1H STE diffusion measurement with 13C editing via HMQC
; pseudo-2D (indirect diffusion dimension, no carbon frequency dimension)
; with water saturation during diffusion delay
; off-resonance presat (-DOFFRES_PRESAT) (cnst21 Hz relative to bf)
;
; With proton stimulated gradient-echo prior to HMQC
; Lit. Protein Engineering, Design & Selection, 24, 99-103 (2011)
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
;
;hmqcphpr
;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=

;prosol relations=<triple_d>
prosol relations=<triple>

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

define list<gradient> diff=<Difframp>

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

"DELTA1=d2-p16-d16"
"DELTA2=d2-p16-d16-d12-4u-0.6366*p1-de"
"DELTA3=d20-2*p30-p19-3*d16-p2-2*p1-d12-d13"
"acqt0=de"

1 ze
2 d11 do:f2
  4u BLKGRAD
  4u pl9:f1

# ifdef OFFRES_PRESAT
  4u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/

  d1 cw:f1 ph29
  4u do:f1
  4u pl1:f1 pl2:f2
  4u fq=0:f1
  4u UNBLKGRAD
  (p3 ph1):f2
  4u
  p16:gp1
  d16
;----------- STE element -------------
  p1 ph1
  p30:gp6*diff
  d16
  p2 ph5
  p30:gp6*-1*diff
  d16
  p1 ph1
  p19:gp4
  d16 pl9:f1
  DELTA3 cw:f1 ph29
  d13 do:f1
  d12 pl1:f1
  p1 ph2
  p30:gp6*diff
  d16
  p2 ph6
  p30:gp6*-1*diff
  d16
;--------------- HMQC ----------------

  DELTA1
  p16:gp2
  d16

  ( center (p3 ph3 0.1u p3 ph4):f2 (p2 ph1):f1 )

  d12 pl12:f2
  p16:gp2
  d16
  4u BLKGRAD
  DELTA2
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
	F1QF(igrad diff)

  ; repeat whole experiment
  lo to 2 times l0

  4u BLKGRAD
exit

ph1= 0
ph2= 2
ph3= 0 2
ph4= 0 0 2 2
ph5= 0 0 0 0 2 2 2 2
ph6= 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph29=0
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
;p16: homospoil/gradient pulse
;p19: gradient pulse 2 (spoil gradient)
;p30: gradient pulse (little DELTA * 0.5)
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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
;d20: diffusion time (big DELTA)
;cnst2: = J(CH)
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;nd0: 2
;l0: number of repeats for entire experiment
;NS: 4 * 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

;use gradient ratio:    gp 1  : gp 2  : gp6  : gp4
;                       -17.13: -13.17: var  :-15.37

;for z-only gradients:
;gpz1: -17.13%
;gpz2: -13.17%
;gpz4: -15.37%
;gpz6: 100%

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


sfnoesysfhmqcgpph_hch.3d.cw tested

sfnoesysfhmqcgpph_hch.3d.cw tested

;3D H[N/M]CMHM SF-NOESY-SFHMQC
;for amide/methyl-methyl NOES
; Rossi 2016 JBNMR

;F1(H,t1) ---NOE--> F1(H) -> F2(C[mq],t2) -> F1(H,t3)
;
;Indirect evolution order is t2, t1 (13C, 1Hnoe)
;Delays adjusted for zero first-order phase correction in acqusition dim

;$CLASS=HighRes
;$DIM=3D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

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

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

;------------options for first (in transfer pathway) 1H (F1)
"d0=3u"
"in0=inf1"

;------------options for second (in transfer pathway) 13C (F2)
"in10=inf2"
"d10=in10/2-p3*4/3.1415"

"spoff13=bf1*(cnst19/1000000)-o1" ; H[N] fd (p29)
"spoff14=bf1*(cnst19/1000000)-o1" ; H[N] 180 (p30)
"spoff15=bf1*(cnst19/1000000)-o1" ; H[N] fb (p29)
"spoal13=1"
"spoal14=0.5"
"spoal15=0"

"spoff23=bf1*(cnst20/1000000)-o1" ; H[M] fd (p39)
"spoff24=bf1*(cnst20/1000000)-o1" ; H[M] 180 (p40)
"spoal23=1"
"spoal24=0.5"

"TAU=d8-p16*2-d16*2-p3-14u"

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

aqseq 321	; for info only

1 ze
  d11 pl12:f2 pl16:f3
2 d11 do:f2 do:f3
  4u BLKGRAD

  d1
  50u UNBLKGRAD
  p16:gp1
  d16

;-------------------------start 1H evolution

  20u pl16:f3
  4u cpd3:f3 ; 15N cpd
  (p29:sp13 ph11):f1
  d0
  (p30:sp14 ph13):f1
  3u
  (p29:sp15 ph14):f1
  4u do:f3

  ; purge residual magnetisation
  p16:gp1
  d16 pl2:f2
  (p3 ph1):f2
  10u
  p16:gp1*0.71
  d16

  TAU

;------------------------start second 13C HMQC element
  (p39:sp23 ph1):f1
  p16:gp2
  d16
  (center (p40:sp24 ph2):f1 (DELTA1 p3 ph12 d10 p3 ph15 DELTA1):f2 )
  DELTA2
  p16:gp2
  d16 pl12:f2
  4u BLKGRAD
  go=2 ph31 cpd2:f2

  d11 do:f2 mc #0 to 2
	F2PH(ip15, id10)
	F1PH(rp15 & rd10 & ip14, id0)

  4u BLKGRAD

exit

ph1= 0
ph2= 1
ph11=0 2
ph12=0 0 2 2
ph13=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph14=0
ph15=0
ph31=0 2 2 0 2 0 0 2

;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
;pl16: f3 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
;p29: f1 channel - 90 degree shaped pulse for excitation (amide)
;                      Pc9_4_90.1000 (90o)    (2657 us at 700 MHz)
;p30: f1 channel - 180 degree shaped pulse for refocussing (amide)
;                      Reburp.1000               (1943 us at 700 MHz)
;p39: f1 channel - 120 degree shaped pulse for excitation (methyl)
;                      Pc9_4_120.1000 (120o)    (2314 us at 700 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing (methyl)
;                      Reburp.1000               (1693 us at 700 MHz)
;sp13: f1 channel - shaped pulse 90 degree (amide)
;                   (Pc9_4_90.1000 )
;sp14: f1 channel - shaped pulse 180 degree (Reburp.1000) (amide)
;sp23: f1 channel - shaped pulse 120 degree (methyl)
;                   (Pc9_4_120.1000 )
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000) (methyl)
;sp25: f1 channel - shaped pulse 120 degree (methyl)
;                   (Pc9_4_120.1000 )
;cnst19: H(N) chemical shift (offset, in ppm) [8.2 ppm]
;cnst20: H(methyl) chemical shift (offset, in ppm) [0.7 ppm]
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529

;p16: homospoil/gradient pulse                       [1 msec]
;p22: f3 channel - 180 degree high power pulse
;p28: f1 channel - trim pulse                        [1 msec]
;d0 : incremented delay (4D)
;d10: incremented delay (4D)
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)CH
;d8 : mixing time
;d11: delay for disk I/O                             [45 msec]
;d12: delay for power switching                      [20 usec]
;d13: short delay                                    [4 usec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(CH)
;inf1: 1/SW(H)
;inf2: 1/SW(C) = DW(C)
;in0: 1/(SW(H)) = DW(C)
;in10: 1/(2 * SW(C)) = 0.5 * DW(C)
;NS: 8 * n
;DS: 16
;td1: number of experiments in F1
;td2: number of experiments in F2
;FnMODE: States-TPPI (or States) in F1
;FnMODE: States-TPPI (or States) in F2
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence
;cpd3: decoupling according to sequence defined by cpdprg2
;pcpd3: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 31%
;gpz2: 29%
;gpz3: 23%
;gpz4: 13%
;gpz5: 43%
;gpz6: 19%

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

                                          ;preprocessor-flags-start
;LABEL_CN: for 15N decoupling during indirect 13C evolution periods
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;NOE_SAT: for water saturation during NOE mixing time
;F2_plane: for zero 13C phase evolution in F3
;F3_plane: for zero 13C phase evolution in F2
;F2_SINGLEDWELL: for single-dwell first-point delay in F2
;F3_SINGLEDWELL: for single-dwell first-point delay in F3
;TRIMPULSE: to apply trim-pulses in second 13C HMQC element, set p28
;NUS: for non-uniform sampling (Topspin 3)
                                          ;preprocessor-flags-end

;3D H[N/M]CMHM SF-NOESY-SFHMQC
;for amide/methyl-methyl NOES
; Rossi 2016 JBNMR

;F1(H) -> F2(C[mq],t1) ---NOE--> F1(H) -> F2(C[mq],t2) -> F1(H,t3)
;
;Indirect evolution order is t2, t1 (13Cdir, 13Cnoe)
;Uses half-dwell first-point delay by default in all indirect dims
;Option for off-res presat
;Options for 2D planes in each 13C dim
;  (set both to get 1D or 2D HH plane with no 13C phase evolution)
;Removal of 13C equilibrium magnetisation
;Delays adjusted for zero first-order phase correction in acqusition dim

;$CLASS=HighRes
;$DIM=4D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

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

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

;------------options for first (in transfer pathway) 1H (F1)
"d0=3u"
"in0=inf1"

;------------options for second (in transfer pathway) 13C (F2)
"d10=in10/2-p3*4/3.1415"
"in10=inf2"

"spoff13=bf1*(cnst19/1000000)-o1" ; H[N] fd (p29)
"spoff14=bf1*(cnst19/1000000)-o1" ; H[N] 180 (p30)
"spoff15=bf1*(cnst19/1000000)-o1" ; H[N] fb (p29)
"spoal13=1"
"spoal14=0.5"
"spoal15=0"

"spoff23=bf1*(cnst20/1000000)-o1" ; H[M] fd (p39)
"spoff24=bf1*(cnst20/1000000)-o1" ; H[M] 180 (p40)
"spoal23=1"
"spoal24=0.5"

"TAU=d8-p16*2-d16*2-p3-14u"

"DELTA1=d2-p16-d16"
"DELTA2=p39*cnst23-4u-de"
"acqt0=de"

aqseq 321	; for info only

1 ze
  d11 pl12:f2 pl16:f3
2 d11 do:f2 do:f3
  4u BLKGRAD

  d1
  50u UNBLKGRAD
  p16:gp1
  d16

;-------------------------start 1H evolution

  20u pl16:f3
  4u cpd3:f3 ; 15N cpd
  (p29:sp13 ph11):f1
  d0
  (p30:sp14 ph13):f1
  3u
  (p29:sp15 ph14):f1
  4u do:f3

  ; purge residual magnetisation
  p16:gp1
  d16 pl2:f2
  (p3 ph1):f2
  10u
  p16:gp1*0.71
  d16

  TAU

;------------------------start second 13C HMQC element
  (p39:sp23 ph1):f1
  p16:gp2
  d16
  (center (p40:sp24 ph2):f1 (DELTA1 p3 ph12 d10 p3 ph15 DELTA1):f2 )
  DELTA2
  p16:gp2
  d16 pl12:f2
  4u BLKGRAD
  go=2 ph31 cpd2:f2

  d11 do:f2 mc #0 to 2
	F2PH(ip15, id10)
	F1PH(rp15 & rd10 & ip14, id0)

  4u BLKGRAD

exit

ph1= 0
ph2= 1
ph11=0 2
ph12=0 0 2 2
ph13=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph14=0
ph15=0
ph31=0 2 2 0 2 0 0 2

;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
;pl16: f3 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
;p29: f1 channel - 90 degree shaped pulse for excitation (amide)
;                      Pc9_4_90.1000 (90o)    (2657 us at 700 MHz)
;p30: f1 channel - 180 degree shaped pulse for refocussing (amide)
;                      Reburp.1000               (1943 us at 700 MHz)
;p39: f1 channel - 120 degree shaped pulse for excitation (methyl)
;                      Pc9_4_120.1000 (120o)    (1598 us at 700 MHz)
;p40: f1 channel - 180 degree shaped pulse for refocussing (methyl)
;                      Reburp.1000               (1259 us at 700 MHz)
;sp13: f1 channel - shaped pulse 90 degree (amide)
;                   (Pc9_4_90.1000 )
;sp14: f1 channel - shaped pulse 180 degree (Reburp.1000) (amide)
;sp23: f1 channel - shaped pulse 120 degree (methyl)
;                   (Pc9_4_120.1000 )
;sp24: f1 channel - shaped pulse 180 degree (Reburp.1000) (methyl)
;sp25: f1 channel - shaped pulse 120 degree (methyl)
;                   (Pc9_4_120.1000 )
;cnst19: H(N) chemical shift (offset, in ppm) [8.2 ppm]
;cnst20: H(methyl) chemical shift (offset, in ppm) [0.7 ppm]
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_120.1000: 0.529

;p16: homospoil/gradient pulse                       [1 msec]
;p22: f3 channel - 180 degree high power pulse
;p28: f1 channel - trim pulse                        [1 msec]
;d0 : incremented delay (4D)
;d10: incremented delay (4D)
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)CH
;d8 : mixing time
;d11: delay for disk I/O                             [45 msec]
;d12: delay for power switching                      [20 usec]
;d13: short delay                                    [4 usec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(CH)
;inf1: 1/SW(H)
;inf2: 1/SW(C) = DW(C)
;in0: 1/(SW(H)) = DW(C)
;in10: 1/(2 * SW(C)) = 0.5 * DW(C)
;NS: 8 * n
;DS: 16
;td1: number of experiments in F1
;td2: number of experiments in F2
;FnMODE: States-TPPI (or States) in F1
;FnMODE: States-TPPI (or States) in F2
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence
;cpd3: decoupling according to sequence defined by cpdprg2
;pcpd3: f2 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz1: 31%
;gpz2: 29%
;gpz3: 23%
;gpz4: 13%
;gpz5: 43%
;gpz6: 19%

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

                                          ;preprocessor-flags-start
;LABEL_CN: for 15N decoupling during indirect 13C evolution periods
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;NOE_SAT: for water saturation during NOE mixing time
;F2_plane: for zero 13C phase evolution in F3
;F3_plane: for zero 13C phase evolution in F2
;F2_SINGLEDWELL: for single-dwell first-point delay in F2
;F3_SINGLEDWELL: for single-dwell first-point delay in F3
;TRIMPULSE: to apply trim-pulses in second 13C HMQC element, set p28
;NUS: for non-uniform sampling (Topspin 3)
                                          ;preprocessor-flags-end


hsqcctetgpsp.cw ZZ filter default changed

;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 $

;hsqcctetgpsp
;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 ZZ1
  (p1 ph2)
  ; zz filter
  4u
  p16:gp3*-0.8
  d16
  (p3 ph3):f2
#else
  (p1 ph2) (p3 ph3):f2
#endif /*ZZ1*/
  ; 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 ZZ2
  (p3 ph4):f2
  ; zz filter
  4u
  p16:gp3
  d16
  (p1 ph1)
#else
  (ralign (p1 ph1) (p3 ph4):f2 )
#endif /*ZZ2*/
  ; 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

;use gradient ratio:    gp 1 : gp 2
;                         80 : 20.1    for C-13
;                         80 :  8.1    for N-15

;for z-only gradients:
;gpz1: 80%
;gpz2: 30.1% for C-13
;gpz3: 35% (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 $


adding hsqcetgp.cw

adding hsqcetgp.cw

;Explicit coding of acquisition with prior setting of receiver phase
;Replaced trim pulse with ZZ period
;
;hsqcetgp
;avance-version (07/04/04)
;HSQC
;2D H-1/X correlation via double inept transfer
;phase sensitive using Echo/Antiecho-TPPI gradient selection
;with decoupling during acquisition
;using trim pulses in inept transfer
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

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

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

"d0=3u"
"in0=inf1/2"

"DELTA1=d4-p16-d16-4u-larger(p2,p8)*0.5"
"DELTA2=2*d0+p2"
"DELTA3=d16+0.6366*p1"

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

  d1
  50u UNBLKGRAD
  4u pl1:f1 pl2:f2

   ; begin HSQC
  (p1 ph1)
  4u
  p16:gp1
  d16
  DELTA1
  (center (p2 ph2) (p8:sp13 ph1):f2 )
  DELTA1
  p16:gp1
  d16 pl2:f2
  4u
  (p1 ph2)

  ; zz filter
  4u
  p16:gp2
  d16

  ; t1 evolution
  (p3 ph11):f2
  d0
  (p2 ph13)
  d0
  p16:gp3*EA
  d16
  (p4 ph4):f2
  p16:gp3*EA*-1
  d16
  DELTA2
  (p3 ph12):f2

  ; zz filter
  4u
  p16:gp4
  d16

  ; back-transfer
  (p1 ph1)
  4u
  p16:gp5
  d16
  DELTA1 pl0:f2
  (center (p2 ph1) (p8:sp13 ph1):f2 )
  4u
  p16:gp6
  DELTA1 pl12:f2
  DELTA3 BLKGRAD
  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
     F1EA(calgrad(EA), caldel(d0, +in0) & calph(ph12, +180) & calph(ph31, +180))

exit

ph1=0
ph2=1
ph11=0 2
ph12=0 0 2 2
ph13=0 0 0 0 2 2 2 2
ph6=0
;ph30=0
ph31=0 2 0 2 2 0 2 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)
;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: second homospoil/gradient pulse
;p22: f3 channel - 180 degree high power pulse
;d0 : incremented delay (2D)                  [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d4 : 1/(4J)XH
;d11: delay for disk I/O                             [30 msec]
;d13: short delay                                    [4 usec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(XH)
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;nd0: 2
;NS: 1 * n
;DS: >= 16
;td1: number of experiments
;FnMODE: echo-antiecho
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence

;use gradient ratio:	gp 1 : gp 2
;			  80 : 20.1    for C-13
;			  80 :  8.1    for N-15

;for z-only gradients:
;gpz1: 80%
;gpz2: 20.1% for C-13, 8.1% for N-15
;gpz3: 7%

;use gradient files:
;gpnam1: SINE.100
;gpnam2: SINE.100
;gpnam3: SINE.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

;$Id: hsqcetgp,v 1.4 2007/04/11 13:34:30 ber Exp $

error: pathspec 'hsqcetgp.cw' did not match any file(s) known to git


adding b_hsqcf2et.cw

adding b_hsqcf2et.cw

;b_hsqcf2et.cw
;1H,13C BEST-HSQC
;gradient-selected (echo/anti-echo)
;evolution times adjusted for zero 1H and 13C phase correction (AQMOD digital)
;with decoupling during acquisition
;
;modified Chris Waudby 15/10/16
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

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

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

"p4=2*p3"

"in0=inf1/2"
"d0=3u"

"DELTA=p3*0.6366+p17+d17-p40*0.5-d0"
"DELTA1=d21-p17-d16-0.5*larger(p40,p4)-p39*cnst39"
"DELTA2=d21-p17-d16-0.5*larger(p40,p4)-p39*cnst39"
"DELTA3=d21-p17-d16-0.5*larger(p40,p4)-de-8u"
"acqt0=de"

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

1 ze
  d11 pl12:f2
2 d1 do:f2
3 d12 pl2:f2
  50u UNBLKGRAD

  ; purge equilibrium 13C
  (p3 ph1):f2
  4u
  p16:gp5
  d16

  (p39:sp23 ph1):f1
  p17:gp1
  d16
  DELTA1
  ;(center (p40:sp24 ph1):f1 (p3 ph11 p4 ph12 p3 ph11):f2 ) ; composite 13C inversion
  (center (p40:sp24 ph1):f1 (p3*2 ph1):f2 )
  DELTA1
  p17:gp1
  d16
  (p39:sp23 ph2):f1

  ; zz purge
  p16:gp3
  200u

;  ; t1 evolution
  (p3 ph3):f2
  p17:gp6*EA
  d17
  (p4 ph5):f2
  DELTA

  d0
  (p40:sp24 ph1):f1
  d0

  DELTA
  (p4 ph1):f2
  p17:gp6*EA
  d17
  (p3 ph4):f2

;  (p3 ph3):f2
;  d0
;  DELTA
;  (p4 ph5):f2
;  p17:gp6*EA
;  d16
;  (p3 ph4):f2

  ; zz purge
  p16:gp4
  200u

  (p39:sp23 ph1):f1
  p17:gp2
  d16
  DELTA2
  (center (p40:sp24 ph1):f1 (p3*2 ph1):f2 )
  DELTA3
  p17:gp7
  d16
  4u BLKGRAD
  4u pl12:f2
  go=2 ph31 cpd2:f2
  d1 do:f2 mc #0 to 2
     F1EA(igrad EA, id0 & ip3*2 & ip31*2)
exit

ph1=0
ph2=1
ph3=0 2
ph4=0 0 2 2
ph5=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph11=0
ph12=1
ph31=0 2 2 0 2 0 0 2

;pl2 : f2 channel - power level for pulse (default)
;pl12: f2 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 (Rsnob.1000)
;p16: homospoil/gradient pulse                       [1 msec]
;p3:  f2 channel -  90 degree high power pulse
;p39: f1 channel - 90 degree shaped pulse for excitation
;                      Pc9_4_90.1000 (90o)    (3.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-p3*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
;cnst2: = J(CH) [125 Hz for methyls]
;cnst19: H(N) chemical shift (offset, in ppm)
;cnst39: compensation of chemical shift evolution during p39
;           Pc9_4_90.1000: 0.529
;inf1: 1/SW(C) = 2 * DW(C)
;in0: 1/ SW(C) = 2 * DW(C)
;nd0: 1
;NS: 4 * 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

;for z-only gradients:
;gpz1: 11%
;gpz2:  7%
;gpz3:  9%
;gpz4: 17%
;gpz5: 13%
;gpz6: 40%
;gpz7: 27.1% (20.1% + gpz2)

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

                                          ;preprocessor-flags-start
                                          ;preprocessor-flags-end

;Processing

;PHC0(F1): 0
;PHC1(F1): 0
;FCOR(F1): 0.5

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

error: pathspec 'b_hsqcf2et.cw' did not match any file(s) known to git


creating and testing noesyhsqcfpf3gpphwg.3.cw

;NOESY-15N HSQC (derived from hsqcfpf3gpphwg.3.2.jk)
; incorporating flip-back during mixing time using radiation damping
; set d21 = radiation damping period (10-50 ms)
; 45/180 phase correction in t1
;For 15N-labelled samples only (no 13C decoupling)
;With water flipback
;
;$CLASS=HighRes
;$DIM=3D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

prosol relations=<triple>

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

"p2=p1*2"
"p22=p21*2"
"d11=30m"
"d12=20u"
;"d13=4u"
"d26=1s/(cnst4*4)"

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

"DELTA1=d26-p16-d16-4u"
"DELTA2=d26-p19-d16-p11-d12-4u"
"DELTA3=d26-p19-d16-p11-d12-8u-de+0.63662*p1"

"TAU=d8-p16-d16-p11-20u"

"d0=in0/2-0.6366*p1"
# ifdef N_SINGLEDWELL
    "d10=in10-0.5*(10u+p1+0.63662*p21)"
# else
    "d10=in10/2-0.5*(10u+p1+0.63662*p21)"
# endif /*N_SINGLEDWELL*/

"acqt0=0"

aqseq 321

1 ze
  d11 pl16:f3
2 d11 do:f3

  d1

3 d12 pl1:f1 pl3:f3
  50u UNBLKGRAD

  ;(p21 ph1):f3
  ;4u
  ;p16:gp0
  ;d16
  ;(p21 ph2):f3
  ;4u
  ;p16:gp0*0.7
  ;d16*2

# ifndef NH_PLANE
  ; 1H evolution
  10u pl1:f1

  ; half-dwell = 1.2*p1+p22+8u+2*d0
  ; => d0 = in1/2 - 0.6366*p1 - p21 - 4u
  "d20=d0-p21-4u"
  if "d20 < 4u"
  {
    (p1 ph10):f1
    d0
    d0
    (p1 ph11):f1
  }
  else
  {
    (p1 ph10):f1
    d20 gron1
    4u groff
    (p22 ph5):f3
    d20 gron1*-1
    4u groff
    (p1 ph11):f1
  }
  ; NOESY mixing period
  "TAU=d8*0.5-d21*0.5-p16*1.5-d16*0.5-4u"
  p16:gp2
  TAU gron3
  4u groff
  TAU gron3*-1
  4u groff
  p16:gp2*-1

  d21 ; radiation damping time [10 ms]

  p16:gp4
  d16
;goto 999

# endif /*NH_PLANE*/

  (p1 ph1)
  4u
  p16:gp5
  d16
  DELTA1
  (center (p2 ph2) (p22 ph6):f3 )
  DELTA1
  4u
  p16:gp5
  d16
  (p1 ph2)

  4u pl0:f1
  (p11:sp1 ph8:r):f1	; flipdown(x), -y -> -z
  4u
  p16:gp6
  d16 pl1:f1

# ifdef HH_PLANE

    (p21 ph3):f3
    2u
    (p21 ph4):f3
    2u
    (p2 ph5):f1

# else

    (p21 ph3):f3
    2u
    d10 gron9
    d10 gron9*-1
    8u groff
    (p2 ph5):f1
    2u
    d10 gron9
    d10 gron9*-1
    8u groff
    (p21 ph4):f3

# endif /*HH_PLANE*/

  4u
  p16:gp8
  d16 pl0:f1
  (p11:sp1 ph7:r):f1	; flipdown(-x), z -> y
  4u
  4u pl1:f1

  (p1 ph1)
  4u
  p19:gp7
  d16 pl0:f1
  DELTA2
  (p11:sp1 ph7:r):f1	; flipdown(-x), z -> y
  d12 pl1:f1
  (center (p2 ph1) (p22 ph1):f3 )
  d12 pl0:f1
  (p11:sp11 ph9:r):f1	; flipback(-x), -y -> z
  4u
  p19:gp7
999  d16 pl16:f3
  DELTA3
  4u BLKGRAD

  go=2 ph31 cpd3:f3
  d11 do:f3 mc #0 to 2
	F1PH(rp3 & rp6 & rd10 & ip11 & ip21, id0)
	F2PH(ip3 & ip6, id10)
exit

ph1=0
ph2=1
ph6=0
ph7=2
ph8=0
ph9=2

# ifndef NH_PLANE

ph3=0 2
ph4=0 0 0 0 2 2 2 2
ph5=0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph10=(8) 1 1 5 5
ph11=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
ph20=2 2 0 0
ph21=2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
     0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ph31=0 2 2 0 2 0 0 2 0 2 2 0 2 0 0 2
     2 0 0 2 0 2 2 0 2 0 0 2 0 2 2 0

# else

ph3=0 2
ph4=0 0 2 2
ph5=0 0 0 0 2 2 2 2
ph31=0 2 2 0

# endif /*NH_PLANE*/

;pl0 : 120dB
;pl1 : f1 channel - power level for pulse (default)
;pl3 : f3 channel - power level for pulse (default)
;pl16: f3 channel - power level for CPD/BB decoupling
;sp1: f1 channel - shaped pulse  90 degree (flip-down)
;sp11: f1 channel - shaped pulse  90 degree (flip-back)
;p1 : f1 channel -  90 degree high power pulse
;p2 : f1 channel - 180 degree high power pulse
;p11: f1 channel -  90 degree shaped pulse
;p16: homospoil/gradient pulse
;p19: second homospoil/gradient pulse
;p21: f3 channel -  90 degree high power pulse
;p22: f3 channel - 180 degree high power pulse
;d10 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d8 : mixing time
;d11: delay for disk I/O                             [30 msec]
;d12: delay for power switching                      [20 usec]
;d16: delay for homospoil/gradient recovery
;d21: radiation damping delay [10 msec]
;d26 : 1/(4J)NH
;cnst4: = J(NH)
;inf1: 1/SW(H) = 4 * DW(H)
;inf2: 1/SW(N) = 4 * DW(N)
;in0: 1/(2 * SW(H)) = DW(H)
;in10: 1/(2 * SW(N)) = DW(N)
;nd0: 4
;nd10: 4
;NS: 4 * n
;DS: 16
;td1: number of experiments in F1
;td2: number of experiments in F2
;FnMODE: States-TPPI, TPPI, States or QSEQ in F1
;FnMODE: States-TPPI, TPPI, States or QSEQ in F2
;cpd3: decoupling according to sequence defined by cpdprg3
;pcpd3: f3 channel - 90 degree pulse for decoupling sequence

;for z-only gradients:
;gpz9: 1-2%
;gpz0: 47%
;gpz1: 2%
;gpz2: 29%
;gpz3: 2%
;gpz4: 35%
;gpz5: 7%
;gpz6: 17%
;gpz7: 53%
;gpz8: 13%

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

error: pathspec 'noesyhsqcfpf3gpphwg.3.cw' did not match any file(s) known to git


create simple HSQC with presat

create simple HSQC with presat

;hsqcph.cw
;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 <Grad.incl>
#include <Delay.incl>

"p2=p1*2"
"d2=p2"
"p4=p3*2"
"d4=1s/(cnst2*4)"
"d11=30m"

"DELTA1=d4-p16-d16-4u-0.5*larger(p2,p4)-0.6366*p1"
"DELTA2=d4-p16-d16-8u-0.5*larger(p2,p4)-de"

"in0=inf1/2"
"d0=in0/2-p1-p3*0.6366"

"acqt0=de"
baseopt_echo

1 ze
  d11 pl1:f1 pl12:f2
2 d11 do:f2
  4u BLKGRAD

# ifdef OFFRES_PRESAT
    30u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/
  20u pl9:f1
  d1 cw:f1 ph29
  4u do:f1
  20u pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD

  (p3 ph1):f2    ; crush eq'm magnetisation
  20u
  p16:gp1
  d16

  (p1 ph1)
  4u
  p16:gp2
  d16
  DELTA1
  (center (p2 ph2) (p4 ph9):f2 )
  DELTA1
  4u
  p16:gp2
  d16
  (p1 ph3)

#ifdef CALIB_F2
;crusher
  50u UNBLKGRAD
  p16:gp0*0.9
  d16

  4u pl20:f2
  (p20 ph1):f2
  p16:gp0
  d16 pl2:f2
#endif

  (p3 ph6):f2
  d0
  (p2 ph8) ; central 1H refocusing
  d0
  (p3 ph7):f2

  (p1 ph4)
  4u
  p16:gp3
  d16
  DELTA1
  (center (p2 ph2) (p4 ph5):f2 )
  DELTA2
  4u pl12:f2
  p16:gp3
  d16
  4u BLKGRAD

  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2 F1PH(ip6 & ip9, id0)

exit

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

;pl1 : f1 channel - power level for pulse (default)
;pl2 : f2 channel - power level for pulse (default)
;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
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d4 : 1/(4J)XH
;d11: delay for disk I/O                             [30 msec]
;d16: delay for homospoil/gradient recovery
;cnst2: = J(XH)
;inf1: 1/SW(X) = 2 * DW(X)
;in0: 1/(2 * SW(X)) = DW(X)
;nd0: 2
;NS: 4 * 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

error: pathspec 'hsqcphpr.cw' did not match any file(s) known to git


adding hmqcgpphpr_zqdqT2.cw

adding hmqcgpphpr_zqdqT2.cw

;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=in0/2-2*0.63662*p3"

; 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
  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 - p16 - d16 - 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

error: pathspec 'hmqcgpphpr_zqdqT2.cw' did not match any file(s) known to git


creating hmqcgpphpr_MQT2.cw

creating hmqcgpphpr_MQT2.cw

; Measurement of methyl MQ relaxation
; using purge element to suppress outer lines
;
; Jun 2013: added option for Ernst angle excitation
;
; Apr 2013: modified to use half-dwell first-point delay by default
;	    Added option for off-res presat
;
; Option for first row
;
; Removal of 13C equilibrium magnetisation (for methyl TROSY)
; Addition of clean-up gradient-pair
; Delays adjusted for zero first-order phase correction
; With options for 15N decoupling and 90,-180 or 180,-360 phase corr.
;
;hmqcphpr
;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>

define delay XI1
define delay XI2
define delay vdMin

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

"DELTA1=d2-0.6366*p1-p3"
"DELTA2=d2-d12-4u"
"XI1=d2/4-p17-d17-larger(p2,p4)"
"XI2=d2/4-p17-d17-p3-larger(p2,p4)"
"vdMin=4*p19+4*d17+4*p3"

"in0=inf2"
"d0=in0/2"

"acqt0=0"
baseopt_echo
aqseq 312

1 ze
  vdMin
  d11 pl12:f2
2 d11 do:f2
  4u BLKGRAD

# ifdef OFFRES_PRESAT
    30u fq=cnst21(bf hz):f1
# endif /*OFFRES_PRESAT*/

  ; recycle delay - calculate new delays for relaxation in this time
  d12 pl9:f1
  d1 cw:f1 ph29
  "d20=vd-p3-p19-d17"
  "d21=vd-p3"
  d13 do:f1
  d12 pl1:f1 pl2:f2
  30u fq=0:f1
  50u UNBLKGRAD

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

  (p1 ph1):f1
  ;"DELTA1=d2-0.6366*p1-p3"
  DELTA1
  ;p16:gp2
  ;d16

  (p3 ph11):f2

  ;begin purge element
  ;"XI1=d2/4-p17-d17-larger(p2,p4)"
  XI1
  p17:gp1
  d17
  (center (p2 ph1):f1 (p4 ph1):f2 )
  p17:gp1
  d17
  ;"XI2=d2/4-p17-d17-p3-larger(p2,p4)"
  XI2
  (p3 ph12):f2

  ;begin relaxation/t1 evolution
  ;"d20=vd-p3-p19-d17"
  d20
  p19:gp2
  d17
  (p4 ph1):f2
  ;"d21=vd-p3"
  d21
  (center (p2 ph1):f1 (d0):f2 )
  d20
  p19:gp2
  d17
  (p4 ph1):f2
  d21
  (p2 ph13):f1 (p3 ph14):f2

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

  go=2 ph31 cpd2:f2
  d11 do:f2 mc #0 to 2
       F1QF(ivd)
       F2PH(ip14, id0)
  4u BLKGRAD
exit

ph1= 0
ph11=0 2
ph12=1 1 3 3
ph13=0 0 0 0 2 2 2 2
ph14=0
ph31=0 2

;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
;p17: gradient pulse [300 usec]
;p19: gradient pulse [200 usec]
;p22 : f3 channel - 180 degree high power pulse
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay; 1-5 * T1
;d2 : 1/(2J)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 [200 usec]
;d17: short delay for gradient recovery [100 usec]
;cnst2: = J(CH)
;cnst21: frequency in Hz for off-res presat
;nd1: 1
;NS: 8 * 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: -40%
;gpz1: 31%
;gpz2: 11%

;use gradient files:
;gpnam0: SMSQ10.100
;gpnam1: SMSQ10.32
;gpnam2: SINE.20

                                          ;preprocessor-flags-start
;OFFRES_PRESAT: for off-resonance presaturation, set cnst21=o1(water)
;	    option -DOFFRES_PRESAT (eda: ZGOPTNS)
                                          ;preprocessor-flags-end

error: pathspec 'hmqcgpphpr_MQT2.cw' did not match any file(s) known to git


sfhmqcf2gpph_1HT2.cw created

sfhmqcf2gpph_1HT2.cw created

;sfhmqcf2gpph.nuws.cw
;1H,13C SOFAST HMQC
;switch on NUWS with -DNUWS
;option for first-increment only with -DONE_D
;with apodisation-weighted sampling
;with exorcycle on 1H 180
;phase sensitive
;with decoupling during acquisition
;
;set sampling schedule via vclist:
;  total number of scans = ns * c
;  add one to first point of vclist to allow for dummy scans
;
;modified Chris Waudby 10/10/16
;
;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>

#ifdef NUWS
define loopcounter dsFlag
; dsFlag starts as 1, will be set to zero after first set of dummy scans is completed
"dsFlag=1"
#endif /* NUWS */

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

"in0=inf2"
"d0=in0/2-p3*4/3.1415"

"DELTA=d21-p16-d16"
"DELTA4=d16-4u-de"
"acqt0=de"

define delay vdmin
"vdmin=4*larger(p3+0.5*p40,p3+cnst39*p39)"

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

aqseq 312

1 ze
  vdmin
  d11 pl12:f2
2 d1 do:f2
  "DELTA1=0.25*vd-p3-cnst39*p39"
  "DELTA2=0.25*vd-p3-0.5*p40"
  "DELTA3=0.25*vd-p3"
  d12 pl2:f2
  50u UNBLKGRAD

  ; purge equilibrium 13C
  (p3 ph1):f2
  4u
  p16:gp2
  d16

  (p39:sp23 ph1):f1
  DELTA1
  (p4 ph1):f2
  DELTA2
  (p40:sp24 ph13):f1
  DELTA2
  (p4 ph1):f2
  DELTA3

  p16:gp1
  d16

#ifdef ONE_D
  (center (p40:sp24 ph14):f1 (DELTA p3 ph11 0.1u p3 ph12 DELTA):f2 )
#else
  (center (p40:sp24 ph14):f1 (DELTA p3 ph11 d0 p3 ph12 DELTA):f2 )
#endif /* ONE_D */

  p16:gp1
  DELTA4 pl12:f2
  4u BLKGRAD
  go=2 ph31 cpd2:f2

#ifdef NUWS
  if "dsFlag==0" goto 10
  zd
  "dsFlag=0"
  goto 2
10 4u

  ; repeat acquisition block according to schedule in vclist
  lo to 2 times c
  30u ivc
#endif /* NUWS */

  d1 do:f2 mc #0 to 2
     F1QF(ivd)
     F2PH(ip3, id0)
exit

ph1= 0
ph11=0 2
ph12=0 0 2 2
ph13=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph14=0
ph31=0 2 2 0 2 0 0 2

;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 or Q5.1000)
;sp24: f1 channel - shaped pulse 180 degree (Rsnob.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)    (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-p3*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
;cnst2: = J(CH) [125 Hz for methyls]
;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(C) = 2 * DW(C)
;in0: 1/ SW(C) = 2 * DW(C)
;nd0: 1
;NS: 4 * 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

                                          ;preprocessor-flags-start
                                          ;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 $

error: pathspec 'sfhmqcf2gpph_1HT2.cw' did not match any file(s) known to git


adding hmqcet.cw (untested)

adding hmqcet.cw (untested)

;hmqcet.cw
;1H,13C HMQC
;phase sensitive using Echo/Anti-Echo (Hurd & John 1991)
; Modern Instrumental Analysis, edited by Satinder Ahuja, Neil Jespersen, p286
;with decoupling during acquisition
;
;modified Chris Waudby 25/11/18

prosol relations=<triple>

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

"d11=30m"
"d12=20u"
"d21=1s/(cnst2*2)"
"p2=p1*2"

"in0=inf1/2"

"d0=3u"

"DELTA=p3*0.6366+p17+d17-p1-d0"
"DELTA1=d21-p1*0.6366"
"DELTA2=d21-p17-d16-4u"
"acqt0=0"

1 ze
  d11 pl12:f2
2 d1 do:f2
  d12 pl1:f1 pl2:f2
  50u UNBLKGRAD

  ; purge equilibrium 13C
  (p3 ph1):f2
  4u
  p16:gp3
  d16

  (p1 ph1):f1
  DELTA1

  (p3 ph3):f2
  p17:gp1
  d17
  (p4 ph2):f2
  DELTA

  d0
  (p2 ph1):f1
  d0

  DELTA
  (p4 ph1):f2
  p17:gp1
  d17
  (p3 ph4):f2

  DELTA2
  p17:gp2*EA
  d16 pl12:f2
  4u BLKGRAD

  go=2 ph31 cpd2:f2
  d1 do:f2 mc #0 to 2
     F1EA(igrad EA, id0 & ip3*2 & ip31*2)
exit

ph1=0
ph2=0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
ph3=0 2
ph4=0 0 2 2
ph31=0 2 2 0 2 0 0 2

;pl2 : f2 channel - power level for pulse (default)
;pl12: f2 channel - power level for CPD/BB decoupling (low power)
;p16: homospoil/gradient pulse                       [1 msec]
;p1:  f1 channel -  90 degree high power pulse
;p3:  f2 channel -  90 degree high power pulse
;d0 : incremented delay (2D) = in0/2-p3*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
;cnst2: = J(CH) [125 Hz for methyls]
;inf1: 1/SW(C) = 2 * DW(C)
;in0: 1/ SW(C) = 2 * DW(C)
;nd0: 1
;NS: 4 * n
;DS: 16
;td1: number of experiments
;FnMODE: Echo-AntoEcho
;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
;			  40 :    20.1

;for z-only gradients:
;gpz1: 40%
;gpz2: 20.1%
;gpz3: 31%

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

error: pathspec 'hmqcet.cw' did not match any file(s) known to git