Tcl/Tk script of VMD for radius of gyration calculation.

When I leaned MD simulation at the beginning, VMD is the greatest tool for me. I was not good at command line tools, so I preferred to use nice GUI program. This script is to calculate the radius of gyration. I find it from my previous note, the source is unknown. Sorry about the author. Please read the annotation in the script, it’s easy to use.

Now I am using AMBERTOOLS everyday, and VMD is just a assistant tool to observe the structure. Command line tools are much more efficient for big data. If you still favor GUI, please begin to learn command line tools, they are the real great things!

############################################################

puts -nonewline "\n Select the polymer (e.g fragment 1): "
gets stdin selmode
set sel [atomselect top "$selmode"]
###the above is to select atoms. input format should be "resname SSH " and the like.

puts -nonewline "\n Name output file? : "
gets stdin fname
set outf [open "$fname" w]
#get number of frames
set n [molinfo top get numframes]
###set up output file name.

for {set i 0} {$i < $n} {incr i} {
molinfo top set frame $i
set radgyr [measure rgyr $sel]
puts $outf "$radgyr"
}
close $outf
puts "Done."
###calculate radgyr for each frame.

############################################################

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s