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

From Jmol
Jump to navigation Jump to search
m
(lc all functions)
Line 12: Line 12:
 
<pre>#  turn - Jmol script by Ron Mignery
 
<pre>#  turn - Jmol script by Ron Mignery
 
#
 
#
#  v1.2 beta    4/2/2014 for Jmol 14
+
#  v1.2 beta    5/16/2014 -lc all functions
 
#
 
#
 
#  Apply a type I or type II turn to a polypeptide
 
#  Apply a type I or type II turn to a polypeptide
 
#
 
#
  
# Bound to ALT-LEFT-CLICK by plicoTurn
+
# Bound to ALT-LEFT-CLICK by plico_turn
function turnCargo1MB() {
+
function turn_cargo_1_mb() {
  
 
     # If O atom picked
 
     # If O atom picked
 
     if ({atomIndex=_atomPicked}.atomName = "O") {
 
     if ({atomIndex=_atomPicked}.atomName = "O") {
 
         gChain = {atomIndex=_atomPicked}.chain
 
         gChain = {atomIndex=_atomPicked}.chain
         var cMidx = getScBBidx (_atomPicked, gChain)
+
         var cMidx = get_sc_bb_idx (_atomPicked, gChain)
 
          
 
          
         var caMidx = getNwardBBidx (cMidx, gChain)
+
         var caMidx = get_nward_bb_idx (cMidx, gChain)
         var nMidx = getNwardBBidx (caMidx, gChain)
+
         var nMidx = get_nward_bb_idx (caMidx, gChain)
         var ncMidx = getNwardBBidx (nMidx, gChain)
+
         var ncMidx = get_nward_bb_idx (nMidx, gChain)
         var nPidx = getCwardBBidx (cMidx, gChain)
+
         var nPidx = get_cward_bb_idx (cMidx, gChain)
         var caPidx = getCwardBBidx (nPidx, gChain)
+
         var caPidx = get_cward_bb_idx (nPidx, gChain)
         var cPidx = getCwardBBidx (caPidx, gChain)
+
         var cPidx = get_cward_bb_idx (caPidx, gChain)
         var cnPidx = getCwardBBidx (cPidx, gChain)
+
         var cnPidx = get_cward_bb_idx (cPidx, gChain)
 
          
 
          
 
         save state gState
 
         save state gState
         selectNwardIdx(caPidx, 0)
+
         select_nward_idx(caPidx, 0)
         setDihedralIdx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
+
         set_dihedral_idx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
         selectNwardIdx(nPidx, 0)
+
         select_nward_idx(nPidx, 0)
         setDihedralIdx(cPidx, caPidx, nPidx, cMidx, -90) # cWard Phi
+
         set_dihedral_idx(cPidx, caPidx, nPidx, cMidx, -90) # cWard Phi
         selectNwardIdx(caMidx, 0)
+
         select_nward_idx(caMidx, 0)
         setDihedralIdx(nPidx, cMidx, caMidx, nMidx, -60) # nWard Psi
+
         set_dihedral_idx(nPidx, cMidx, caMidx, nMidx, -60) # nWard Psi
         selectNwardIdx(nMidx, 0)
+
         select_nward_idx(nMidx, 0)
         setDihedralIdx(cMidx, caMidx, nMidx, ncMidx, -40) # nWard Phi
+
         set_dihedral_idx(cMidx, caMidx, nMidx, ncMidx, -40) # nWard Phi
 
          
 
          
         handleCollisions2( 0)
+
         handle_collisions( 0)
         if (countcollisions(({})) > 0) {
+
         if (count_collisions(({})) > 0) {
 
             var p = prompt("Unable to handle all collisions!")
 
             var p = prompt("Unable to handle all collisions!")
 
             restore state gState
 
             restore state gState
Line 56: Line 56:
 
         gChain = {atomIndex=_atomPicked}.chain
 
         gChain = {atomIndex=_atomPicked}.chain
 
         save state gState
 
         save state gState
         var cMidx = getNwardBBidx (_atomPicked, gChain)
+
         var cMidx = get_nward_bb_idx (_atomPicked, gChain)
  
 
         # Rotate 180 on omega         
 
         # Rotate 180 on omega         
         selectNwardIdx(cMidx, 0)
+
         select_nward_idx(cMidx, 0)
 
         rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0
 
         rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0
  
         handleCollisions2( 0)
+
         handle_collisions( 0)
         if (countcollisions(({})) > 0) {
+
         if (count_collisions(({})) > 0) {
 
             var p = prompt("Unable to handle all collisions!")
 
             var p = prompt("Unable to handle all collisions!")
 
             restore state gState
 
             restore state gState
Line 71: Line 71:
 
}
 
}
  
# Bound to SHIFT-LEFT-CLICK by plicoTurn
+
# Bound to SHIFT-LEFT-CLICK by plico_turn
function turnCargo2MB() {
+
function turn_cargo_2_mb() {
  
 
     # If O atom picked
 
     # If O atom picked
 
     if ({atomIndex=_atomPicked}.atomName = "O") {
 
     if ({atomIndex=_atomPicked}.atomName = "O") {
 
         gChain = {atomIndex=_atomPicked}.chain
 
         gChain = {atomIndex=_atomPicked}.chain
         var caMidx = getNwardBBidx (_atomPicked, gChain)
+
         var caMidx = get_nward_bb_idx (_atomPicked, gChain)
         var cMidx = getCwardBBidx (caMidx, gChain)
+
         var cMidx = get_cward_bb_idx (caMidx, gChain)
 
          
 
          
 
         save state gState
 
         save state gState
         var caMidx = getNwardBBidx (cMidx, gChain)
+
         var caMidx = get_nward_bb_idx (cMidx, gChain)
         var nMidx = getNwardBBidx (caMidx, gChain)
+
         var nMidx = get_nward_bb_idx (caMidx, gChain)
         var ncMidx = getNwardBBidx (nMidx, gChain)
+
         var ncMidx = get_nward_bb_idx (nMidx, gChain)
         var nPidx = getCwardBBidx (cMidx, gChain)
+
         var nPidx = get_cward_bb_idx (cMidx, gChain)
         var caPidx = getCwardBBidx (nPidx, gChain)
+
         var caPidx = get_cward_bb_idx (nPidx, gChain)
         var cPidx = getCwardBBidx (caPidx, gChain)
+
         var cPidx = get_cward_bb_idx (caPidx, gChain)
         var cnPidx = getCwardBBidx (cPidx, gChain)
+
         var cnPidx = get_cward_bb_idx (cPidx, gChain)
 
          
 
          
 
         # Hi to lo since N-terminal is to move
 
         # Hi to lo since N-terminal is to move
         selectNwardIdx(caPidx, 0)
+
         select_nward_idx(caPidx, 0)
         setDihedralIdx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
+
         set_dihedral_idx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
         selectNwardIdx(nPidx, 0)
+
         select_nward_idx(nPidx, 0)
         setDihedralIdx(cPidx, caPidx, nPidx, cMidx, 90) # cWard Phi
+
         set_dihedral_idx(cPidx, caPidx, nPidx, cMidx, 90) # cWard Phi
         selectNwardIdx(caMidx, 0)
+
         select_nward_idx(caMidx, 0)
         setDihedralIdx(nPidx, cMidx, caMidx, nMidx, 120) # nWard Psi
+
         set_dihedral_idx(nPidx, cMidx, caMidx, nMidx, 120) # nWard Psi
         selectNwardIdx(nMidx, 0)
+
         select_nward_idx(nMidx, 0)
         setDihedralIdx(cMidx, caMidx, nMidx, ncMidx, -70) # nWard Phi
+
         set_dihedral_idx(cMidx, caMidx, nMidx, ncMidx, -70) # nWard Phi
  
         handleCollisions2( 0)
+
         handle_collisions( 0)
         if (countcollisions(({})) > 0) {
+
         if (count_collisions(({})) > 0) {
 
             var p = prompt("Unable to handle all collisions!")
 
             var p = prompt("Unable to handle all collisions!")
 
             restore state gState
 
             restore state gState
Line 112: Line 112:
 
         gChain = {atomIndex=_atomPicked}.chain
 
         gChain = {atomIndex=_atomPicked}.chain
 
         save state gState
 
         save state gState
         var cMidx = getNwardBBidx (_atomPicked, gChain)
+
         var cMidx = get_nward_bb_idx (_atomPicked, gChain)
  
 
         # Rotate 180 on omega         
 
         # Rotate 180 on omega         
         selectNwardIdx(cMidx, 0)
+
         select_nward_idx(cMidx, 0)
 
         rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0
 
         rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0
  
         handleCollisions2( 0)
+
         handle_collisions( 0)
         if (countcollisions(({})) > 0) {
+
         if (count_collisions(({})) > 0) {
 
             var p = prompt("Unable to handle all collisions!")
 
             var p = prompt("Unable to handle all collisions!")
 
             restore state gState
 
             restore state gState
Line 128: Line 128:
  
 
# Top level of Turn
 
# Top level of Turn
function plicoTurn() {
+
function plico_turn() {
  
 
     # Load common functions if not already
 
     # Load common functions if not already
     if (kCommon < 1) {
+
     if (kTug < 3) {
 
         script $SCRIPT_PATH$tug.spt
 
         script $SCRIPT_PATH$tug.spt
         if (kCommon < 1) {
+
         if (kTug < 3) {
             prompt ("A newer version of plicoCommon.SPT is required")
+
             prompt ("A newer version of tug.SPT is required")
 
             quit
 
             quit
 
         }
 
         }
Line 140: Line 140:
 
      
 
      
 
     gPlico = "TURN"
 
     gPlico = "TURN"
     plicoPrelim()
+
     plico_prelim(TRUE)
 
      
 
      
 
     select (GLY and Oxygen) or (PRO and Nitrogen)
 
     select (GLY and Oxygen) or (PRO and Nitrogen)
Line 152: Line 152:
  
 
     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 "SHIFT-LEFT-CLICK" "_pickAtom";
     bind "SHIFT-LEFT-CLICK" "+:turnCargo2MB";
+
     bind "SHIFT-LEFT-CLICK" "+:turn_cargo_2_mb";
     bind "DOUBLE" "plicoExit";
+
     bind "DOUBLE" "plico_exit";
 
}
 
}
  
# End of TURN.SPT
+
# End of TURN.SPT</pre>
</pre>
 

Revision as of 16:25, 16 May 2014

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 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;plicoTurn

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.2 beta    5/16/2014 -lc all functions
#
#   Apply a type I or type II turn to a polypeptide
#

# Bound to ALT-LEFT-CLICK by plico_turn
function turn_cargo_1_mb() {

    # If O atom picked
    if ({atomIndex=_atomPicked}.atomName = "O") {
        gChain = {atomIndex=_atomPicked}.chain
        var cMidx = get_sc_bb_idx (_atomPicked, gChain)
        
        var caMidx = get_nward_bb_idx (cMidx, gChain)
        var nMidx = get_nward_bb_idx (caMidx, gChain)
        var ncMidx = get_nward_bb_idx (nMidx, gChain)
        var nPidx = get_cward_bb_idx (cMidx, gChain)
        var caPidx = get_cward_bb_idx (nPidx, gChain)
        var cPidx = get_cward_bb_idx (caPidx, gChain)
        var cnPidx = get_cward_bb_idx (cPidx, gChain)
        
        save state gState
        select_nward_idx(caPidx, 0)
        set_dihedral_idx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
        select_nward_idx(nPidx, 0)
        set_dihedral_idx(cPidx, caPidx, nPidx, cMidx, -90) # cWard Phi
        select_nward_idx(caMidx, 0)
        set_dihedral_idx(nPidx, cMidx, caMidx, nMidx, -60) # nWard Psi
        select_nward_idx(nMidx, 0)
        set_dihedral_idx(cMidx, caMidx, nMidx, ncMidx, -40) # nWard Phi
        
        handle_collisions( 0)
        if (count_collisions(({})) > 0) {
            var p = prompt("Unable to handle all collisions!")
            restore state gState
            connect
        }
    }

    # Else if PRO N atom picked
    if (({atomIndex=_atomPicked}.atomName = "N")
        and ({atomIndex=_atomPicked}.group = "PRO")) {
        gChain = {atomIndex=_atomPicked}.chain
        save state gState
        var cMidx = get_nward_bb_idx (_atomPicked, gChain)

        # Rotate 180 on omega        
        select_nward_idx(cMidx, 0)
        rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0

        handle_collisions( 0)
        if (count_collisions(({})) > 0) {
            var p = prompt("Unable to handle all collisions!")
            restore state gState
            connect
        }
    }
}

# Bound to SHIFT-LEFT-CLICK by plico_turn
function turn_cargo_2_mb() {

    # If O atom picked
    if ({atomIndex=_atomPicked}.atomName = "O") {
        gChain = {atomIndex=_atomPicked}.chain
        var caMidx = get_nward_bb_idx (_atomPicked, gChain)
        var cMidx = get_cward_bb_idx (caMidx, gChain)
        
        save state gState
        var caMidx = get_nward_bb_idx (cMidx, gChain)
        var nMidx = get_nward_bb_idx (caMidx, gChain)
        var ncMidx = get_nward_bb_idx (nMidx, gChain)
        var nPidx = get_cward_bb_idx (cMidx, gChain)
        var caPidx = get_cward_bb_idx (nPidx, gChain)
        var cPidx = get_cward_bb_idx (caPidx, gChain)
        var cnPidx = get_cward_bb_idx (cPidx, gChain)
        
        # Hi to lo since N-terminal is to move
        select_nward_idx(caPidx, 0)
        set_dihedral_idx(cnPidx, cPidx, caPidx, nPidx, 0) # cWard Psi
        select_nward_idx(nPidx, 0)
        set_dihedral_idx(cPidx, caPidx, nPidx, cMidx, 90) # cWard Phi
        select_nward_idx(caMidx, 0)
        set_dihedral_idx(nPidx, cMidx, caMidx, nMidx, 120) # nWard Psi
        select_nward_idx(nMidx, 0)
        set_dihedral_idx(cMidx, caMidx, nMidx, ncMidx, -70) # nWard Phi

        handle_collisions( 0)
        if (count_collisions(({})) > 0) {
            var p = prompt("Unable to handle all collisions!")
            restore state gState
            connect
        }
    }

    # Else if PRO N atom picked
    if (({atomIndex=_atomPicked}.atomName = "N")
        and ({atomIndex=_atomPicked}.group = "PRO")) {
        gChain = {atomIndex=_atomPicked}.chain
        save state gState
        var cMidx = get_nward_bb_idx (_atomPicked, gChain)

        # Rotate 180 on omega        
        select_nward_idx(cMidx, 0)
        rotateSelected {atomIndex=_atomPicked} {atomIndex=cMidx} 180.0

        handle_collisions( 0)
        if (count_collisions(({})) > 0) {
            var p = prompt("Unable to handle all collisions!")
            restore state gState
            connect
        }
    }
}

# Top level of Turn
function plico_turn() {

    # Load common functions if not already
    if (kTug < 3) {
        script $SCRIPT_PATH$tug.spt
        if (kTug < 3) {
            prompt ("A newer version of tug.SPT is required")
            quit
        }
    }
    
    gPlico = "TURN"
    plico_prelim(TRUE)
    
    select (GLY and Oxygen) or (PRO and Nitrogen)
    halo on
    select all
    gEcho = ("_______TURN_______|  *** Click on O ***|      (or proline N)|ALT-CLICK=Type I" +
        "|SHIFT-CLICK=Type II|DOUBLE-CLICK=exit")
    echo @gEcho
    gChain = ""
    unbind

    bind "ALT-LEFT-CLICK" "_pickAtom";
    bind "ALT-LEFT-CLICK" "+:turn_cargo_1_mb";
    bind "SHIFT-LEFT-CLICK" "_pickAtom";
    bind "SHIFT-LEFT-CLICK" "+:turn_cargo_2_mb";
    bind "DOUBLE" "plico_exit";
}

# End of TURN.SPT

Contributors

Remig