Difference between revisions of "User:Remig/plico/turn"

From Jmol
Jump to navigation Jump to search
(Add proline cis/trans)
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Turn''' allows the user to make type I and II reverse turns and beta-hairpins in polypeptides with a single mouse click on the corner oxygen where you want the turn.  ALT-CLICK creates a type I turn and SHIFT-CLICK makes a type II.  Either on a proline N rotates the omega bond 180 for a cis/trans transition.
+
'''Turn''' allows the user to make type I and II reverse turns and beta-hairpins in polypeptides with a single mouse click on the corner oxygen where you want the turn.  ALT-CLICK creates a type I turn and SHIFT-CLICK makes a type II.  Either on a proline N rotates the omega bond 180 for a cis/trans transition. Note that GLY oxygens and PRO nitrogens are haloed to indicate the usual sites of action.
  
 
'''Turn''' is a member of the Plico suite of protein folding tools described [[User:Remig/plico|here]]. It may be installed and accessed as a macro with the file:
 
'''Turn''' is a member of the Plico suite of protein folding tools described [[User:Remig/plico|here]]. It may be installed and accessed as a macro with the file:
 
<pre>Title=PLICO Turn
 
<pre>Title=PLICO Turn
Script=script <path to your scripts folder>/turn.spt;plicoTurn
+
Script=script <path to your scripts folder>/turn.spt;plico_turn
 
</pre>
 
</pre>
 
saved as plicoTurn.macro in your .jmol/macros folder as described in [[Macro]].
 
saved as plicoTurn.macro in your .jmol/macros folder as described in [[Macro]].
  
Copy and paste the following to a text editor and save to your scripts folder as turn.spt, replacing the text "<SCRIPT_PATH>" with the path to your scripts:
+
A copy of the Plico script [[User:Remig/plico/tug|tug.spt]] must be in the same directory as this script.
 +
 
 +
Copy and paste the following to a text editor and save to your scripts directory as turn.spt:
 
<pre>#  turn - Jmol script by Ron Mignery
 
<pre>#  turn - Jmol script by Ron Mignery
#*****Replace <SCRIPT_PATH> with path to your scripts folder before use***
+
#
#  v1.1 beta    2/14/2014 for Jmol 14 - add proline cis/trans
+
#  v1.6 beta    4/12/2016 -require latest common includes
 
#
 
#
 
#  Apply a type I or type II turn to a polypeptide
 
#  Apply a type I or type II turn to a polypeptide
#
+
#   or do cis <- trans on proline
 +
# TPEE NPTY motifs
 +
function toggle_pro_cis_trans(r, iChain, toCis) {
 +
    var aCA = get_atom_rcn( r, iChain, "CA")
 +
    var aN = get_atom_rcn( r, iChain, "N")
 +
    var aCp = get_atom_rcn( r-1, iChain, "C")
 +
    var aCAp = get_atom_rcn( r-1, iChain, "CA")
 +
    if (aCAp >= 0) {
 +
        select {(resno < r) and chain=iChain and thisModel}
 +
        var cis =(toCis ? toCis : (abs(angle(aCA, aN, aCp, aCAp)) < 30))
 +
        set_dihedral_atoms(aCA, aN, aCp, aCAp, (cis ? 180 : 0))
 +
    }
 +
}
  
# Bound to ALT-LEFT-CLICK by plicoTurn
+
function make_turn(r, iChain, nphi, npsi, cphi, cpsi) {
function turnCargo1MB() {
+
     for (i = 0; i < 2; i++) {
print "turnCargo1MB()"#TBD
+
         var aCp = get_atom_rcn( r-1, iChain, "C")
 
+
         var aN = get_atom_rcn( r, iChain, "N")
    # If O atom picked
+
         var aCA = get_atom_rcn( r, iChain, "CA")
     if ({atomIndex=_atomPicked}.atomName = "O") {
+
         var aC = get_atom_rcn( r, iChain, "C")
        gChain = {atomIndex=_atomPicked}.chain
+
         var aO = get_atom_rcn( r, iChain, "O")
         var cMidx = getScBBidx (_atomPicked, gChain)
+
         var aNn = get_atom_rcn( r+1, iChain, "N")
       
+
         if (aNn) {
         var caMidx = getNwardBBidx (cMidx, gChain)
+
            select {(resno <= r) and not aC and not aO and chain=iChain
         var nMidx = getNwardBBidx (caMidx, gChain)
+
                and thisModel}
         var ncMidx = getNwardBBidx (nMidx, gChain)
+
            set_dihedral_atoms(aNn, aC, aCA, aN, (i ? cpsi : npsi))
         var nPidx = getCwardBBidx (cMidx, gChain)
+
         }
         var caPidx = getCwardBBidx (nPidx, gChain)
+
         if (aCp and (aCA.group != "PRO")) {
         var cPidx = getCwardBBidx (caPidx, gChain)
+
            select {(resno < r) and chain=iChain and thisModel}
        var cnPidx = getCwardBBidx (cPidx, gChain)
+
            set_dihedral_atoms(aC, aCA, aN, aCp, (i ? cphi : nphi))
       
+
         }
        save state gState
+
        color {resno=r} @gAltScheme
        selectNwardIdx(caPidx, 0)
+
         color {(resno=r) and oxygen} pink
        setDihedralIdx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
 
         selectNwardIdx(nPidx, 0)
 
         setDihedralIdx(cPidx, caPidx, nPidx, cMidx, -90) # cWard Phi
 
        selectNwardIdx(caMidx, 0)
 
        setDihedralIdx(nPidx, cMidx, caMidx, nMidx, -60) # nWard Psi
 
         selectNwardIdx(nMidx, 0)
 
         setDihedralIdx(cMidx, caMidx, nMidx, ncMidx, -40) # nWard Phi
 
 
          
 
          
         handleCollisions2( 0)
+
         r++
        if (countcollisions(({})) > 0) {
 
            var p = prompt("Unable to handle all collisions!")
 
            restore state gState
 
            connect
 
        }
 
 
     }
 
     }
 +
   
 +
    after_fold()
 +
}
  
    # Else if PRO N atom picked
+
# Bound to ALT-LEFT-CLICK by plico_turn
     if (({atomIndex=_atomPicked}.atomName = "N")
+
function turn_cargo_1_mb() {
        and ({atomIndex=_atomPicked}.group = "PRO")) {
+
     var iChain = {atomIndex=_atomPicked}.chain
         gChain = {atomIndex=_atomPicked}.chain
+
    var r = {atomIndex=_atomPicked}.resno
        save state gState
+
    if ({atomIndex=_atomPicked}.group = "PRO") {
         var cMidx = getNwardBBidx (_atomPicked, gChain)
+
         toggle_pro_cis_trans(r, iChain, false)
 +
    }
 +
    else {
 +
         make_turn(r, iChain, -60, -30, -90, 0) # I
 +
    }
 +
}
  
        # Rotate 180 on omega       
+
# Bound to SHIFT-LEFT-CLICK by plico_turn
        selectNwardIdx(cMidx, 0)
+
function turn_cargo_2_mb() {
        rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0
+
    var iChain = {atomIndex=_atomPicked}.chain
 +
    var r = {atomIndex=_atomPicked}.resno
 +
    if ({atomIndex=_atomPicked}.group != "PRO") {
 +
        make_turn(r, iChain, -60, 120, 80, 0) # II
 +
    }
 +
}
  
        handleCollisions2( 0)
+
# Bound to ALT-SHIFT-LEFT-CLICK by plico_turn
        if (countcollisions(({})) > 0) {
+
function turn_cargo_1i_mb() {
            var p = prompt("Unable to handle all collisions!")
+
    var iChain = {atomIndex=_atomPicked}.chain
            restore state gState
+
    var r = {atomIndex=_atomPicked}.resno
            connect
+
    if ({atomIndex=_atomPicked}.group = "PRO") {
         }
+
        toggle_pro_cis_trans(r, iChain, true)
 +
        make_turn(r, iChain, -57, 120, -90, 0) # VIa1
 +
    }
 +
    else {
 +
         make_turn(r, iChain, 60, 30, 90, 0) # I'
 
     }
 
     }
 
}
 
}
  
# Bound to SHIFT-LEFT-CLICK by plicoTurn
+
# Bound to SHIFT-CTRL-CLICK by plico_turn
function turnCargo2MB() {
+
function turn_cargo_2i_mb() {
print "turnCargo2MB()"#TBD
+
    var iChain = {atomIndex=_atomPicked}.chain
 +
    var r = {atomIndex=_atomPicked}.resno
 +
    if ({atomIndex=_atomPicked}.group = "PRO") {
 +
        toggle_pro_cis_trans(r, iChain, true)
 +
        make_turn(r, iChain, -57, 120, -60, 0) # VIa2
 +
    }
 +
    else {
 +
        make_turn(r, iChain, 60, -120, -80, 0) # II'
 +
    }
 +
}
  
    # If O atom picked
+
# Bound to ALT-CTRL-SHIFT-LEFT-CLICK by plico_turn
    if ({atomIndex=_atomPicked}.atomName = "O") {
+
function turn_cargo_8_mb() {
        gChain = {atomIndex=_atomPicked}.chain
+
    var iChain = {atomIndex=_atomPicked}.chain
        var caMidx = getNwardBBidx (_atomPicked, gChain)
+
    var r = {atomIndex=_atomPicked}.resno
        var cMidx = getCwardBBidx (caMidx, gChain)
+
    if ({atomIndex=_atomPicked}.group = "PRO") {
       
+
         toggle_pro_cis_trans(r, iChain, true)
        save state gState
+
         make_turn(r, iChain, -57, 135, -75, 160) # VIb
        var caMidx = getNwardBBidx (cMidx, gChain)
+
    }
        var nMidx = getNwardBBidx (caMidx, gChain)
+
    else {
        var ncMidx = getNwardBBidx (nMidx, gChain)
+
         make_turn(r, iChain, -60, -120, 120, 0) # VIII
         var nPidx = getCwardBBidx (cMidx, gChain)
+
    }
        var caPidx = getCwardBBidx (nPidx, gChain)
+
}
         var cPidx = getCwardBBidx (caPidx, gChain)
 
        var cnPidx = getCwardBBidx (cPidx, gChain)
 
       
 
        # Hi to lo since N-terminal is to move
 
        selectNwardIdx(caPidx, 0)
 
        setDihedralIdx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
 
        selectNwardIdx(nPidx, 0)
 
         setDihedralIdx(cPidx, caPidx, nPidx, cMidx, 90) # cWard Phi
 
        selectNwardIdx(caMidx, 0)
 
        setDihedralIdx(nPidx, cMidx, caMidx, nMidx, 120) # nWard Psi
 
        selectNwardIdx(nMidx, 0)
 
        setDihedralIdx(cMidx, caMidx, nMidx, ncMidx, -70) # nWard Phi
 
  
        handleCollisions2( 0)
+
function after_fold() {
        if (countcollisions(({})) > 0) {
+
    to_handle_collisions( 0)
            var p = prompt("Unable to handle all collisions!")
+
    var c = count_collisions(({}))
 +
    if (c > 0) {
 +
        refresh
 +
        if (prompt( format("%d collisions detected - undo fold?", c),
 +
            "Yes|No", true) = "Yes") {
 
             restore state gState
 
             restore state gState
 
             connect
 
             connect
 
         }
 
         }
 
     }
 
     }
 +
}
  
    # Else if PRO N atom picked
+
# Top level of Turn
    if (({atomIndex=_atomPicked}.atomName = "N")
+
function plico_turn() {
        and ({atomIndex=_atomPicked}.group = "PRO")) {
 
        gChain = {atomIndex=_atomPicked}.chain
 
        save state gState
 
        var cMidx = getNwardBBidx (_atomPicked, gChain)
 
  
        # Rotate 180 on omega       
+
    # Load common functions if not already
        selectNwardIdx(cMidx, 0)
+
    if (kCommon < 7) {
         rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0
+
         script $SCRIPT_PATH$plicoCommon.spt
 
+
         if (kCommon < 7) {
        handleCollisions2( 0)
+
             prompt ("A newer version of plicoCommon.SPT is required")
         if (countcollisions(({})) > 0) {
+
             quit
             var p = prompt("Unable to handle all collisions!")
 
             restore state gState
 
            connect
 
 
         }
 
         }
 
     }
 
     }
}
 
  
# Top level of Turn
+
     if (kNTCommon < 6) {
function plicoTurn() {
+
         script $SCRIPT_PATH$plicoNTcommon.spt
 
+
         if (kNTcommon < 6) {
    # Load tug functions if not already
+
             prompt ("A newer version of plicoNTcommon.SPT is required")
     if (kTug < 3) {
 
         script "<SCRIPT_PATH>tug.spt"
 
         if (kTug < 3) {
 
             prompt ("A newer version of TUG.SPT is required")
 
 
             quit
 
             quit
 
         }
 
         }
Line 140: Line 149:
 
      
 
      
 
     gPlico = "TURN"
 
     gPlico = "TURN"
     plicoPrelim()
+
     plico_prelim(true, true)
      
+
 
    select (GLY and Oxygen) or (PRO and Nitrogen)
+
     gEcho = ("___________TURN___________" +
    halo on
+
        "|ALT-CLICK=Type I (or PRO C/T)|CTRL-SHIFT-CLICK=Type II" +
    select all
+
        "|ALT-SHIFT-CLICK=Type I' (VIa1)|ALT-CTRL-CLICK=Type II' (VIa2)" +
    gEcho = ("_______TURN_______| *** Click on O ***|      (or proline N)|ALT-CLICK=Type I" +
+
         "|ALT-CTRL-SHIFT-CLICK=Type VIII (VIb)|SHIFT-DOUBLE-CLICK=exit")
         "|SHIFT-CLICK=Type II|DOUBLE-CLICK=exit")
 
 
     echo @gEcho
 
     echo @gEcho
    gChain = ""
 
    unbind
 
  
 
     bind "ALT-LEFT-CLICK" "_pickAtom";
 
     bind "ALT-LEFT-CLICK" "_pickAtom";
     bind "ALT-LEFT-CLICK" "+:turnCargo1MB";
+
     bind "ALT-LEFT-CLICK" "+:turn_cargo_1_mb";
     bind "SHIFT-LEFT-CLICK" "_pickAtom";
+
     bind "CTRL-SHIFT-LEFT-CLICK" "_pickAtom";
     bind "SHIFT-LEFT-CLICK" "+:turnCargo2MB";
+
    bind "CTRL-SHIFT-LEFT-CLICK" "+:turn_cargo_2_mb";
     bind "DOUBLE" "plicoExit";
+
    bind "ALT-SHIFT-LEFT-CLICK" "_pickAtom";
 +
    bind "ALT-SHIFT-LEFT-CLICK" "+:turn_cargo_1i_mb";
 +
    bind "ALT-CTRL-LEFT-CLICK" "_pickAtom";
 +
    bind "ALT-CTRL-LEFT-CLICK" "+:turn_cargo_2i_mb";
 +
    bind "ALT-CTRL-SHIFT-LEFT-CLICK" "_pickAtom";
 +
     bind "ALT-CTRL-SHIFT-LEFT-CLICK" "+:turn_cargo_8_mb";
 +
   
 +
     bind "SHIFT-DOUBLE" "plico_exit(true)";
 +
    bind "LEFT-CLICK" "+:plico_menu_toggle";
 
}
 
}
  
# End of TURN.SPT
+
# End of TURN.SPT</pre>
</pre>
 

Latest revision as of 17:24, 12 April 2016

Turn allows the user to make type I and II reverse turns and beta-hairpins in polypeptides with a single mouse click on the corner oxygen where you want the turn. ALT-CLICK creates a type I turn and SHIFT-CLICK makes a type II. Either on a proline N rotates the omega bond 180 for a cis/trans transition. Note that GLY oxygens and PRO nitrogens are haloed to indicate the usual sites of action.

Turn is a member of the Plico suite of protein folding tools described here. It may be installed and accessed as a macro with the file:

Title=PLICO Turn
Script=script <path to your scripts folder>/turn.spt;plico_turn

saved as plicoTurn.macro in your .jmol/macros folder as described in Macro.

A copy of the Plico script tug.spt must be in the same directory as this script.

Copy and paste the following to a text editor and save to your scripts directory as turn.spt:

#   turn - Jmol script by Ron Mignery
#
#   v1.6 beta    4/12/2016 -require latest common includes
#
#   Apply a type I or type II turn to a polypeptide
#   or do cis <- trans on proline
# TPEE NPTY motifs
function toggle_pro_cis_trans(r, iChain, toCis) {
    var aCA = get_atom_rcn( r, iChain, "CA")
    var aN = get_atom_rcn( r, iChain, "N")
    var aCp = get_atom_rcn( r-1, iChain, "C")
    var aCAp = get_atom_rcn( r-1, iChain, "CA")
    if (aCAp >= 0) {
        select {(resno < r) and chain=iChain and thisModel}
        var cis =(toCis ? toCis : (abs(angle(aCA, aN, aCp, aCAp)) < 30))
        set_dihedral_atoms(aCA, aN, aCp, aCAp, (cis ? 180 : 0))
    }
}

function make_turn(r, iChain, nphi, npsi, cphi, cpsi) {
    for (i = 0; i < 2; i++) {
        var aCp = get_atom_rcn( r-1, iChain, "C")
        var aN = get_atom_rcn( r, iChain, "N")
        var aCA = get_atom_rcn( r, iChain, "CA")
        var aC = get_atom_rcn( r, iChain, "C")
        var aO = get_atom_rcn( r, iChain, "O")
        var aNn = get_atom_rcn( r+1, iChain, "N")
        if (aNn) {
            select {(resno <= r) and not aC and not aO and chain=iChain
                and thisModel}
            set_dihedral_atoms(aNn, aC, aCA, aN, (i ? cpsi : npsi))
        }
        if (aCp and (aCA.group != "PRO")) {
            select {(resno < r) and chain=iChain and thisModel}
            set_dihedral_atoms(aC, aCA, aN, aCp, (i ? cphi : nphi))
        }
        color {resno=r} @gAltScheme
        color {(resno=r) and oxygen} pink
        
        r++
    }
    
    after_fold()
}

# Bound to ALT-LEFT-CLICK by plico_turn
function turn_cargo_1_mb() {
    var iChain = {atomIndex=_atomPicked}.chain
    var r = {atomIndex=_atomPicked}.resno
    if ({atomIndex=_atomPicked}.group = "PRO") {
        toggle_pro_cis_trans(r, iChain, false)
    }
    else {
        make_turn(r, iChain, -60, -30, -90, 0) # I
    }
}

# Bound to SHIFT-LEFT-CLICK by plico_turn
function turn_cargo_2_mb() {
    var iChain = {atomIndex=_atomPicked}.chain
    var r = {atomIndex=_atomPicked}.resno
    if ({atomIndex=_atomPicked}.group != "PRO") {
        make_turn(r, iChain, -60, 120, 80, 0) # II
    }
}

# Bound to ALT-SHIFT-LEFT-CLICK by plico_turn
function turn_cargo_1i_mb() {
    var iChain = {atomIndex=_atomPicked}.chain
    var r = {atomIndex=_atomPicked}.resno
    if ({atomIndex=_atomPicked}.group = "PRO") {
        toggle_pro_cis_trans(r, iChain, true)
        make_turn(r, iChain, -57, 120, -90, 0) # VIa1
    }
    else {
        make_turn(r, iChain, 60, 30, 90, 0) # I'
    }
}

# Bound to SHIFT-CTRL-CLICK by plico_turn
function turn_cargo_2i_mb() {
    var iChain = {atomIndex=_atomPicked}.chain
    var r = {atomIndex=_atomPicked}.resno
    if ({atomIndex=_atomPicked}.group = "PRO") {
        toggle_pro_cis_trans(r, iChain, true)
        make_turn(r, iChain, -57, 120, -60, 0) # VIa2
    }
    else {
        make_turn(r, iChain, 60, -120, -80, 0) # II'
    }
}

# Bound to ALT-CTRL-SHIFT-LEFT-CLICK by plico_turn
function turn_cargo_8_mb() {
    var iChain = {atomIndex=_atomPicked}.chain
    var r = {atomIndex=_atomPicked}.resno
    if ({atomIndex=_atomPicked}.group = "PRO") {
        toggle_pro_cis_trans(r, iChain, true)
        make_turn(r, iChain, -57, 135, -75, 160) # VIb
    }
    else {
        make_turn(r, iChain, -60, -120, 120, 0) # VIII
    }
}

function after_fold() {
    to_handle_collisions( 0)
    var c = count_collisions(({}))
    if (c > 0) {
        refresh
        if (prompt( format("%d collisions detected - undo fold?", c),
            "Yes|No", true) = "Yes") {
            restore state gState
            connect
        }
    }
}

# Top level of Turn
function plico_turn() {

    # Load common functions if not already
    if (kCommon < 7) {
        script $SCRIPT_PATH$plicoCommon.spt
        if (kCommon < 7) {
            prompt ("A newer version of plicoCommon.SPT is required")
            quit
        }
    }

    if (kNTCommon < 6) {
        script $SCRIPT_PATH$plicoNTcommon.spt
        if (kNTcommon < 6) {
            prompt ("A newer version of plicoNTcommon.SPT is required")
            quit
        }
    }
    
    gPlico = "TURN"
    plico_prelim(true, true)

    gEcho = ("___________TURN___________" +
        "|ALT-CLICK=Type I (or PRO C/T)|CTRL-SHIFT-CLICK=Type II" +
        "|ALT-SHIFT-CLICK=Type I' (VIa1)|ALT-CTRL-CLICK=Type II' (VIa2)" +
        "|ALT-CTRL-SHIFT-CLICK=Type VIII (VIb)|SHIFT-DOUBLE-CLICK=exit")
    echo @gEcho

    bind "ALT-LEFT-CLICK" "_pickAtom";
    bind "ALT-LEFT-CLICK" "+:turn_cargo_1_mb";
    bind "CTRL-SHIFT-LEFT-CLICK" "_pickAtom";
    bind "CTRL-SHIFT-LEFT-CLICK" "+:turn_cargo_2_mb";
    bind "ALT-SHIFT-LEFT-CLICK" "_pickAtom";
    bind "ALT-SHIFT-LEFT-CLICK" "+:turn_cargo_1i_mb";
    bind "ALT-CTRL-LEFT-CLICK" "_pickAtom";
    bind "ALT-CTRL-LEFT-CLICK" "+:turn_cargo_2i_mb";
    bind "ALT-CTRL-SHIFT-LEFT-CLICK" "_pickAtom";
    bind "ALT-CTRL-SHIFT-LEFT-CLICK" "+:turn_cargo_8_mb";
    
    bind "SHIFT-DOUBLE" "plico_exit(true)";
    bind "LEFT-CLICK" "+:plico_menu_toggle";
}

# End of TURN.SPT

Contributors

Remig