TCL script (Molecular Chemistry)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting TCL script (Molecular Chemistry)
# 1  
Old 04-17-2012
TCL script (Molecular Chemistry)

Ok,
what about:

Code:
array set simulation_frames { ... }
foreach { frames } [array get simulation_frames] { 
writepdb pdb_$frames.pdb
}

Now, my question is simply, what strategy could I use to import my numbers into the array { ... }

I could manually copy them, and that would work, but is there another way?

Last edited by chrisjorg; 04-17-2012 at 08:36 PM..
# 2  
Old 04-17-2012
There are some very well educated people who post on this site. Personally I have never heard of this product. Please post what hardware, Operating System and relevant package software you are running.
Can you post links to manuals and examples of the syntax for the package?

Is this the correct package? :
https://ctbp.ucsd.edu/summer_school0...tml/node3.html

The link points to tuition for an amazing package "VMD Molecular Graphics" for producing visual graphics of complex molecules.

Last edited by methyl; 04-17-2012 at 07:57 PM.. Reason: moved and renamed this interesting thread to Shell Programming for a better chance of finding an expert
This User Gave Thanks to methyl For This Post:
# 3  
Old 04-17-2012
Never mind, I solved it.
Yes, VMD 1.9 uses tcl scripting.
That is indeed the right package!


Code:
set sel [atomselect top all]
set f [ open file.dat r ]

array set arr [read $f]
foreach { frames } [array get arr] {
$sel frame $frames
$sel writepdb pdb_$frames.pdb
}
close $f


Last edited by methyl; 04-17-2012 at 08:54 PM.. Reason: please use code tags
This User Gave Thanks to chrisjorg For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

TCL script help

Hi All , I am having a file as stated below File 1 chain = chan6 group = grp0 input = '/pad_pc10' output = '/pad_pb7' length = 9900 chain = chan2 group = grp0 input = '/pad_pa4' output = '/pad_pb12' length = 10000 chain = chan7 group = grp0 input = '/pad_pb2' output =... (1 Reply)
Discussion started by: kshitij
1 Replies

2. Shell Programming and Scripting

Help with TCL script

I need to read a file, the file has a table in it. From the table I need to choose all the rows for which AVG 2 value is greater than 0.050 and write them on to a separate file. Please help me with the TCL script for this. Thanks in Advance (0 Replies)
Discussion started by: tonystark
0 Replies

3. Programming

Tcl script

Dear Users I'm struck by while the following tcl script. foreach l { set w($l) {} set fsum 0 foreach ftemp $f($l) { set fsum lappend w($l) $fsum } } It shows me error as "missing operand at _@_ in expression "0.10308400000000001 + _@_* 0.4 * 1" ... (0 Replies)
Discussion started by: bala06
0 Replies

4. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

5. Shell Programming and Scripting

TCL TK SCRIPT Help Please

Hi Seniors, Need a help from your end. I am new to scripting and still in the learning process of scripting. I have written a script on TCL TK. This is the script that i have written. if { $EssEntityType == "rss_user" && $EssAction == "Insert" } { puts $fp " Ess Action :$EssAction" ... (0 Replies)
Discussion started by: tech90210
0 Replies

6. Shell Programming and Scripting

Molecular biologist requires help re: search / replace script

Monday April 07, 2008 Hello - I was wondering if someone could help me? I have some basic knowledge of awk, etc., and can create simple scripts (e.g. a search_replace.awk file) that can be called from the command line: $ awk -f search_replace.awk <file to be searched> I have a... (11 Replies)
Discussion started by: gstuart
11 Replies
Login or Register to Ask a Question