;NOAH-5 (MSBCN): 15N-HMQC + 13C-ed-HSQC + 13C-HMBC + COSY + ps-NOESY
;Topspin 3 version 2013/10/03
;WaveMaker supported version;
;with adiabatic refocussing for mult. editing in C-13 HSQC and HMBC
;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"
"p22=p21*2"
"d2=0.5s/cnst2" 
"d3=0.25s/cnst2"
"d14=0.5s/cnst13"
"d21=0.25s/cnst4"
"d0=3u"
"d10=3u"
"d20=3u"
"in0=inf1/2"
"in10=inf1*cnst10"  
"in20=in0*cnst20"    
"l0=td1/10"

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

"acqt0=0"
baseopt_echo

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

5 p1 ph7  
  d21 
  (center (p2 ph1):f1 (p22 ph1):f3)   
  d21 UNBLKGRAD
  (p1 ph7):f1
  (p21 ph3):f3
  4u
  p16:gp1*-1*EA
  DELTA4 
  (p22 ph3):f3
  d20
  p16:gp1*EA
  d16
  (p2 ph4)
  p16:gp1*EA
  d16 
  d20
  (p22 ph5):f3
  4u 
  p16:gp1*-1*EA
  DELTA4 
  (p21 ph5):f3
  d21
  (center (p2 ph1):f1 (p22 ph1):f3)
  4u
  p16:gp5
  DELTA6 4u pl16:f3
  4u 
  goscnp ph30 cpd3:f3  ; acquire 15N HMQC 
  4u do:f3

  4u pl3:f3
  4u pl2:f2
  (p21 ph1):f3
  (p3 ph1):f2
  50u  
  p16:gp0*1.77
  2m st

  (p1 ph1)
  DELTA1 
  (p14:sp3 ph1):f2 
  (p2 ph1):f1 
  DELTA2 pl2:f2 
  (p1 ph2):f1 
  (p3 ph3):f2
  DELTA  
  (p14:sp3 ph1):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 ph1):f2 
    d2
    (p2 ph1):f1 
    (p14:sp3 ph1):f2 
    d2 pl2:f2
#else
    DELTA pl2:f2
#endif /*EDIT*/

  (p3 ph5):f2
  (p1 ph1):f1 
  DELTA1 
  (p14:sp3 ph1):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
  4u 
  p16:gp0*0.77
  2m st           
  (p1 ph3) 
  d2               
  (p3 ph3):f2 
  d14              
  (p3 ph5):f2
  DELTA  
  (p14:sp3 ph1):f2 
  4u
  p16:gp1*EA
  d16
  d0 
  (p2 ph1)
  d0
  4u
  p16:gp1*EA
  d16
  (p14:sp3 ph1):f2 
  DELTA pl2:f2
  (p3 ph6):f2
  4u
  p16:gp2
  d16 
  goscnp ph29  ; acquire C-13 HMBC
  4u 
  (p3 ph1):f2
  2m st
  d10        
  (p1 ph1)    
  4u 
  p16:gp2*EA
  d16 
  goscnp ph31   ; acquire H-H COSY
  4u
  (p3 ph1):f2
  50u 
  p16:gp4  
  DELTA8 st      ; noe mixing time 
  p1 ph5
  p16:gp2*EA
  d16 
  go=2 ph30     ; acquire H-H NOESY

  30m wr #0 if #0 zd igrad EA

  lo to 3 times 2 
 
  1m id0
  1m id10
  1m id20
  1m ip6*2 
  1m ip29*2

  lo to 4 times l0  

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
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)
;pl3 : f3 channel - power level for pulse (default)
;pl12: f2 channel - power level for CPD/BB decoupling
;pl16: f3 channel - power level for CPD/BB decoupling
;sp3: f2 channel - adiabatic 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
;p21: f3 channel -  90 degree high power pulse
;p22: f3 channel - 180 degree high power 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)
;cnst13: = nJ(CH)
;cnst4: = 1J(NH)
;cnst10: = scaling factor swC/swH for COSY and NOESY
;cnst20: = scaling factor swC/swN for 15N HMQC
;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: = 5 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(260 ppm, 0.5 ms)
;cpd2:wvm:wudec: cawurst_d-20(220 ppm, 1.4 ms)

;use gradient ratio:
;			  80 : 20.1*2  for C-13 (gp1 : gp2)
;			  80 :  8.1*4  for N-15 (gp1 : gp5)

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

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

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