;written by beat vogeli 2006
;3D MQ(1HN,13Ca)+SQ(1HN)-HNCA for measurement of 3J(HN,Ha)

;p1 = 90 deg 1H pulse @pl1
;p7 = 90 deg 15N pulse @pl7
;p4 = selective 180 deg (23.7*2us) 13CO and 13CA 
;p5 = selective 90 deg (53u) 13CA

;Gradient Pulses
;p20    500u     ;gpz0=+30  sine.50
;p21    250u     ;gpz1=-15  sine.50
                 ;gpz2=-10  sine.50
                 ;gpz3=+30  sine.50
;p22    300u     ;gpz4=+25  sine.50
;p23    3400u    ;gpz6=+50  rectangular.1
                 ;gpz7=-50  rectangular.1
;p24    144.75u  ;gpz0=-50  rectangular.1
;p25    200u     ;gpz0=+50  rectangular.1

"d10=in10*0.5"
"d11=50m"
"d12=2.6m"
"d13=13.7m"
"d16=13.01m" ; J(CaCb) refocusing
"d17=13.5m"
"d18=p25-p24"
"d19=0.5*p5-0.5*p1"
"d20=d17+in10*0.5-20u-200u-p23+2*p4"
"d25=p11*0.5-p15*0.5"
"d26=p7-p1"
"d27=p7-p4"
"d28=p4-p1"
"d29=p14*0.5-p7"
"d30=10u"
"d21=d30"
"d31=d16-3u"
"d24=p1*3.141/2+p7*2+d21*2"
"d22=d29+30u"
"d23=d29-30u" ; J(HN) evolution correction

"l1=1"
"l3=32" ; 1/2 of number of points
"l4=76"

1       ze
        1m setnmr2^0 setnmr8^4
2       d11
        1m setnmr2^0  
3       3m setnmr8^4
4       3m setnmr2^0  
5       3m
6       1m do:f2 do:f4
7       10u pl4:f5
        d1 setnmr2^0  
        1m setnmr2|0  
        10u pl1:f1
        10u pl7:f2
        10u pl5:f4
;------- Clean residual N and Ca -----------------------
        (p7 ph20):f2
        (p5 ph20):f4
        20u        
        p20:gp0
        200u
;------- INEPT HN -----------------------
        (p1 ph20):f1
        d12
        (d26 p1*2 ph20 d26):f1 (p7*2 ph20):f2
        d12
        (p1 ph1):f1                
;------- Z-filter Gradient -----------------------
        20u
        p22:gp2
        200u
;------- INEPT NCa -----------------------
        (p7 ph20):f2 
        3u
        d13 pl6:f4 pl14:f5
        (p7*2 ph20):f2 (d27 p4*2 ph20 d27):f4
        3u
        d13 pl5:f4
        (p7 ph21):f2 
;------- Z-filter Gradient -----------------------
        20u
        p20:gp0
        200u
        (d19 p1 ph2 d19):f1 (p5 ph3):f4
;------- CT-(Ca,HN)MQ-Evolution -----------------------
        3u
        10u 
        (d22 p7*2 ph20 d23):f2 (p14:sp4 ph20):f5
        d16
        (d25 p15:sp5 ph20 d25):f4 (p11:sp1 ph7):f1
        3u
        d31 pl5:f4
        (d22 p7*2 ph20 d23):f2 (p14:sp4 ph20):f5
        3u
        d30
        (p5 ph20):f4 (d19 d24 p1*2 ph20):f1 
;------- (HN)SQ-Evolution -----------------------
        d21 
        (p7*2 ph20):f2
        d21
        (p1 ph20):f1 
;------- Z-filter Gradient -----------------------
        20u
        p21:gp1
        100u
        (p7 ph21):f2
;------- CT-(f2)-SQ Evolution -----------------------
        d10 
        (p1*2 ph20 d28 d28):f1 (p4*2 ph20):f5
        d17  pl6:f4
        (p7*2 ph20):f2 (d27 p4*2 ph20 d27):f4
        d20
;------- Coherence-Encoding Gradient -----------------------
        if "l1==1" goto 88
        20u
        p23:gp6
        200u
        goto 89
88      20u
        p23:gp7
        200u
;------- First Backtransfer Element -----------------------
89      (p1 ph20):f1 (p7 ph20):f2
        d12
        (d26 p1*2 ph20 d26):f1 (p7*2 ph20):f2
        d12
        (p1 ph21):f1 
        if "l1==1" goto 78
        (p7 ph4):f2
        goto 79
78      (p7 ph5):f2
;------- Second Backtransfer Element -----------------------
79      d12
        (d26 p1*2 ph20 d26):f1 (p7*2 ph20):f2
        d12
        (p1 ph20):f1
;------- Coherence-Encoding Gradient -----------------------
        d18 pl17:f2
        20u pl18:f4
        p24:gp4
        100u
        (p1*2 ph20):f1
        20u
        p25:gp5
        100u
;------- Acquisition -----------------------
        go=2 ph0 cpds2:f2 cpds3:f4
        10u do:f2 do:f4
        1m setnmr2^0  
        d11 wr #0 if #0 zd 
        10u iu1
        lo to 3 times 2
        10u ru1
        10u id10
        10u dd20
        lo to 3 times l3
        10u ip3
        10u rd10
        10u rd20
        lo to 3 times 2
        10u ip0
        10u ip0
        10u id30
        10u dd16
;------- kappa = 1 -----------------------
        10u id21
;------- kappa = 2 -----------------------
;        10u id21
        lo to 3 times l4
1m do:f2
1m setnmr2^0 setnmr8^4
1m
exit    
        

ph20=0
ph21=1
ph22=2
ph23=3

;------- subspectrum A -----------------------
ph2= 0 0 2 2
ph3= 0 2
;------- subspectrum B -----------------------
;ph2= 1 1 3 3
;ph3= 1 3

ph1= 1 1
ph4= 1
ph5= 3
ph7= 0 2

ph0= 0 2 2 0