Tuesday, November 8, 2011

Calculating phi/psi values in VMD

First source the following script:
--- start ---
proc all_dihed_angle { a1 a2 a3 a4 } {
  # Delete all existing Dihdral labels so that the one we add has index 0.
  label delete Dihedrals

  # Use the top molecule
  set molid [molinfo top]

  # Add the dihedral monitor
  label add Dihedrals $molid/$a1 $molid/$a2 $molid/$a3 $molid/$a4

  # Get all values
  return [label graph Dihedrals 0]
}
--- end ---

Then run this script:

mol new enzfibsol.psf
mol addfile md7.dcd first 0 last 10 waitfor all
set phifile [open "cellulose_dihed_phi.tcl" w]
set psifile [open "cellulose_dihed_psi.tcl" w]

set oxygen [atomselect top "resname BGLC and resid 436 and name O1"]
set ox [$oxygen get index]
set h1 [expr {$ox-1}]
set c1 [expr {$ox-2}]
set c4 [expr {$ox-9}]
set h4 [expr {$ox-8}]

puts $phifile [all_dihed_angle $h1 $c1 $ox $c4]
puts $psifile [all_dihed_angle        $c1 $ox $c4 $h4]

close $phifile
close $psifile
quit

No comments:

Post a Comment