VMD Tcl/Tk, Output results to the text file.

In a long time, I just copy the result in Tcl/Tk console in VMD. But for some calculation like getting resid for many atoms selection, the console is very slow. To achieve the purpose, BASH is much easier than other programming language. > or >> could output results to text file. In Tcl/Tk, the following command could do the same thing. output.dat is the file’s name. w simply means write content in the file, there are several different commands for this operation. w is the most common one. You may google this. The second is the command to generate output results. You can change to what you want. REMEMBER to close the file after the output.

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

set outfile [open output.dat w]
puts $outfile [measure bond {143 387} first 0 last 42]
close $outfile

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

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