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

From Jmol
Jump to navigation Jump to search
(Plico turn module)
 
m
 
(6 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.
+
'''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.0 beta    2/14/2014 for Jmol 14
+
#  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))
 +
    }
 +
}
 +
 
 +
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 ALT-LEFT-CLICK by plicoTurn
+
# Bound to SHIFT-LEFT-CLICK by plico_turn
function turnCargo1MB() {
+
function turn_cargo_2_mb() {
print "turnCargo1MB()"#TBD
+
    var iChain = {atomIndex=_atomPicked}.chain
 +
    var r = {atomIndex=_atomPicked}.resno
 +
    if ({atomIndex=_atomPicked}.group != "PRO") {
 +
        make_turn(r, iChain, -60, 120, 80, 0) # II
 +
    }
 +
}
  
    # If O atom picked
+
# Bound to ALT-SHIFT-LEFT-CLICK by plico_turn
    if ({atomIndex=_atomPicked}.atomName = "O") {
+
function turn_cargo_1i_mb() {
        gChain = {atomIndex=_atomPicked}.chain
+
    var iChain = {atomIndex=_atomPicked}.chain
        var cMidx = getScBBidx (_atomPicked, gChain)
+
    var r = {atomIndex=_atomPicked}.resno
       
+
    if ({atomIndex=_atomPicked}.group = "PRO") {
        var caMidx = getNwardBBidx (cMidx, gChain)
+
         toggle_pro_cis_trans(r, iChain, true)
        var nMidx = getNwardBBidx (caMidx, gChain)
+
         make_turn(r, iChain, -57, 120, -90, 0) # VIa1
        var ncMidx = getNwardBBidx (nMidx, gChain)
+
    }
         var nPidx = getCwardBBidx (cMidx, gChain)
+
    else {
        var caPidx = getCwardBBidx (nPidx, gChain)
+
         make_turn(r, iChain, 60, 30, 90, 0) # I'
        var cPidx = getCwardBBidx (caPidx, gChain)
 
         var cnPidx = getCwardBBidx (cPidx, gChain)
 
       
 
        save state gState
 
        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, -60) # nWard Psi
 
        selectNwardIdx(nMidx, 0)
 
        setDihedralIdx(cMidx, caMidx, nMidx, ncMidx, -40) # nWard Phi
 
       
 
        handleCollisions2( 0)
 
        if (countcollisions(({})) > 0) {
 
            var p = prompt("Unable to handle all collisions!")
 
            restore state gState
 
        }
 
 
     }
 
     }
 
}
 
}
  
# 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 cMidx = getScBBidx (_atomPicked, gChain)
+
    var r = {atomIndex=_atomPicked}.resno
       
+
    if ({atomIndex=_atomPicked}.group = "PRO") {
        save state gState
+
         toggle_pro_cis_trans(r, iChain, true)
        var caMidx = getNwardBBidx (cMidx, gChain)
+
         make_turn(r, iChain, -57, 135, -75, 160) # VIb
        var nMidx = getNwardBBidx (caMidx, gChain)
+
    }
        var ncMidx = getNwardBBidx (nMidx, gChain)
+
    else {
         var nPidx = getCwardBBidx (cMidx, gChain)
+
         make_turn(r, iChain, -60, -120, 120, 0) # VIII
        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
 
         }
 
         }
 
     }
 
     }
Line 87: Line 129:
  
 
# Top level of Turn
 
# Top level of Turn
function plicoTurn() {
+
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
 +
        }
 +
    }
  
    # Load tug functions if not already
+
     if (kNTCommon < 6) {
     if (kTug < 3) {
+
         script $SCRIPT_PATH$plicoNTcommon.spt
         script "<SCRIPT_PATH>tug.spt"
+
         if (kNTcommon < 6) {
         if (kTug < 3) {
+
             prompt ("A newer version of plicoNTcommon.SPT is required")
             prompt ("A newer version of TUG.SPT is required")
 
 
             quit
 
             quit
 
         }
 
         }
Line 99: Line 149:
 
      
 
      
 
     gPlico = "TURN"
 
     gPlico = "TURN"
     plicoPrelim()
+
     plico_prelim(true, true)
   
+
 
    select GLY and Oxygen
+
     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 ***|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