tk/tcl

tk/tcl

tk/tcl

tk/tcl

tk/tcl

tk/tcl

tk/tcl

tk/tcl

VMD scripting language

Photosystem II alignment

This script will align the two structures of photosystem II (2AXT.pdb & 1S5L.pdb) via the alpha carbons of chains A, B, C, D, E and F. It is required that you use VMD and load the Berlin structure (Zouni/Saenger) as molecule 0 and the London structure (Iwata/Barber) as molecule 1. Pdb files are named as 2AXT.pdb and 1S5L.pdb, respectively. The complex selection string in line "set al1 ..." is due to the difference in chain length between the two structures.

001 proc psiialign {} {
002    set alle [atomselect 1 "all"]
003    set al1 [atomselect 0 "alpha and ((chain A and not resid 10 11) 
   or (chain B and not resid 2 3 4 5 482 483 484 485 486 487 488 489) 
   or (chain C and not resid 27 28 29 30 31 32 33 34 35 457 458 459 46
   0 461 462 463 464 465 466 467 468 469 470 471 472 473) or (chain D 
   and not resid 13) or (chain E and not resid 3 4 5 6 7 8) or (chain 
   F and not resid 11 12))"]
004    set al2 [atomselect 1 "alpha and (chain A or chain B or chain C 
   or chain D or chain E or chain F)"]
005    set M [measure fit $al2 $al1]
006    $alle move $M
007 }

type:VMD - tk/tcl   [ download ]

You can see the results here.

Color coded displacement

This script will calculate the displacement between each atom of two different but aligned structures, actually chains. The maximal difference will then be mapped to the alpha carbon so an easier visualization via the backbone illustration is possible. The syntax for the script is "colordisplace chain start end shift". Chain defines (obviously) the chain, start and end the start and end residue to be compared. The shift can be used if the numbering between the two chains is different (e.g. chain E is shifted by 1 aminoacid in the 1S5L structure compared to the 2AXT structure, therefore the syntax would be "colordisplacement E 8 84 -1"). If the structures can not be compared e.g. if an aminoacid is missing some atoms and therefore the amount of atoms between the aminoacids to be compared are different, it will print the corrosponding residue number.

001 <?php
002 proc colordisplace {chain start end shift} {
003 puts "calculating displacements of atoms on residues for a given ch
   ain with shifted residues (opt)"
004 #
005 #  by Ch. Fufezan in 2006 - www.fufezan.net/sci_scripts.php
006 #
007 set selector "chain $chain"
008 set al1 [atomselect 0 "$selector"]
009 set al2 [atomselect 1 "$selector"]
010 #$al1 set beta 0
011 for {set i $start} {$i <$end} {incr i} {
012   set w 0
013   set tmp "chain $chain and resid $i"
014   set aa1 [atomselect 0 "$tmp"]
015   ##-> if wrongly numbered
016   if {$shift != 0} {
017     set numba [expr $i + $shift] 
018     set tmp "chain $chain and resid $numba"
019   }      
020   ##----------------------
021   set aa2 [atomselect 1 "$tmp"]
022   if {$i == $start} {
023     set res1 [$aa1 get {resname resid}]
024     set res2 [$aa2 get {resname resid}]
025     puts "Shift align puts $res1 with $res2"
026   }
027   if {[$aa1 num] - [$aa2 num] != 0} {
028     set a0 [$aa1 num]
029     set a1 [$aa2 num]
030     puts "-> Resid $i 0:$a0 / 1:$a1"
031   } else {
032     set calf "alpha and (chain $chain and resid $i)"
033     set calff [atomselect 0 "$calf"]
034     foreach v0 [$aa1 get {x y z}] v1 [$aa2 get {x y z}] idx1 [$aa1 
   get {index}] {
035       #graphics 0 color red
036       #graphics 0 cylinder $v0 $v1 radius 0.2
037       set dx [expr [lindex $v0 0] - [lindex $v1 0]]
038       set dy [expr [lindex $v0 1] - [lindex $v1 1]]
039       set dz [expr [lindex $v0 2] - [lindex $v1 2]]
040       set displace [expr (sqrt($dx*$dx + $dy*$dy + $dz*$dz))]
041       set enhanced [expr (10 * $displace)]
042       if {$enhanced >= $w} {
043         set w $enhanced
044         $calff set beta $w
045       }
046       set aim "index $idx1"
047       set target [atomselect 0 "$aim"]
048       $target set beta $enhanced
049     }
050   }
051 }
052 }
053 ?>

type:VMD - tk/tcl   [ download ]

You can find some results of this script used to compare the two photosystem II structures 2AXT and 1S5L here.