;NOAH-3 (SCN): me-HSQC + COSY + NOESY
;Topspin 3 version 2017/09/09
;WaveMaker supported version
;with adiabatic refocussing and optional mult. editing in HSQC
;Ref: E. Kupce and T. Claridge, Angew.Chem.Int.Ed.Eng. 2017, v.56, pp. 11779-11783.
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

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


"p2=p1*2"
"p4=p3*2" 
"d2=0.5s/cnst2" 
"d3=0.25s/cnst2"
"d0=3u"
"d10=3u"
"in0=inf1/2"
"in10=inf1*cnst10"  
"l0=td1/6"

"DELTA=p16+d16+p2/2+4u+d0-p3*2/3.14159"
"DELTA1=d3-p14/2"
"DELTA2=d3+p14/2"
"DELTA3=p16+d16"
"DELTA5=DELTA2-p16-p3-de-8u+p1*2/3.14159" 
"DELTA6=DELTA3+4u+d10" 
"DELTA8=d8-DELTA3-3m-aq-p3-p16-62u"  ; adjusts noe mixing time

"acqt0=0"
baseopt_echo

1 ze
  30m
2 30m 
3 4m  do:f2
4 50u UNBLKGRAD  ; purge pulses
  4u pl2:f2
  (p3 ph1):f2
  4u pl1:f1
  p16:gp3*-1
  4u
  (p1 ph1)
  4u
  p16:gp0*-1.37
  4u
  (p1 ph2)
  4u
  p16:gp0*0.77
  50u BLKGRAD
  d1 st0

  (p1 ph1)
  DELTA1 
  (p14:sp3 ph6):f2 
  (p2 ph1):f1 
  DELTA2 pl2:f2 UNBLKGRAD
  (p1 ph2):f1 
  (p3 ph3):f2  
  DELTA 
  (p14:sp3 ph6):f2 
  4u
  p16:gp1*EA
  d16
  d0 
  (p2 ph4)   
  d0
  4u
  p16:gp1*EA
  d16
  (p14:sp3 ph1):f2 

#ifdef EDIT
    DELTA 
    (p2 ph1):f1 
    (p14:sp3 ph6):f2 
    d2
    (p2 ph1):f1 
    (p14:sp3 ph6):f2 
    d2 pl2:f2
#else
    DELTA pl2:f2
#endif /*EDIT*/

  (p3 ph5):f2
  (p1 ph1):f1 
  DELTA1 
  (p14:sp3 ph6):f2 
  (p2 ph1):f1 
  p16:gp2
  DELTA5 pl2:f2
  4u       
  (p3 ph1):f2
  4u pl12:f2
  goscnp ph30 cpd2:f2      ; acquire C-13 HSQC
  4u do:f2
  4u pl2:f2  
  (p3 ph1):f2  
  p16:gp0*0.77
  2m st           
  (p1 ph28) 
  DELTA6  
  (p2 ph1)   
  4u 
  p16:gp3
  d16 
  d10        
  (p1 ph1)
  4u
  p16:gp3*EA
  d16 
  goscnp ph28   ; acquire H-H COSY
  4u
  (p3 ph1):f2
  4u
  p16:gp4
  DELTA8 st    
  p1 ph5
  DELTA3         
  de
  4u
  (p2 ph5) 
  4u
  p16:gp3*EA
  d16 
  go=2 ph29    ; acquire phase sensitive H-H NOESY

  30m wr #0 if #0 zd igrad EA

  lo to 3 times 2 
 
  1m id0
  1m id10
  1m ip28*2
  1m ip29*2

  lo to 4 times l0  

  50u BLKGRAD
exit

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

;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
;sp3: f2 channel - shaped pulse 180 degree
;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
;p14: f2 channel - 180 degree shaped pulse for inversion
;p16: homospoil/gradient pulse 
;d0 : incremented delay (2D)                         [3 usec]
;d1 : relaxation delay
;d2: delay for HSQC multiplicity editing 1/2J(XH)    [~3.45 msec]
;d8: delay for NOE buildup
;d11: delay for disk I/O                             [5 msec]
;d16: delay for homospoil/gradient recovery
;aq: acquisition time
;cnst2: = J(CH)
;cnst10: = scaling factor swC/swH for COSY and NOESY
;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 - multiple of NBL
;NBL: = 3 number of blocks (NOAH modules)
;FnMODE: echo-antiecho
;cpd2: decoupling according to sequence defined by cpdprg2
;pcpd2: f2 channel - 90 degree pulse for decoupling sequence
; ~~~~~~~ use 'wvm -a' command to create these shapes ~~~~~~
;sp3:wvm:wu180C13: cawurst-20(300 ppm, 0.5 ms)
;cpd2:wvm:wudec: cawurst_d-20(220 ppm, 1.4 ms)

;use gradient ratios:	
;			  80 : 20.1*2  for C-13
;			  80 :  8.1*4  for N-15

;for z-only gradients:
;gpz0: 17 %
;gpz1: 80 %
;gpz2: 40.2% 
;gpz3: 23%
;gpz4: 33%

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

;EDIT: for C-13 multiplicity editing start experiment with 
;             option -DEDIT (eda: ZGOPTNS)
