From: Dive, Aniruddha Mukund (aniruddha.dive_at_wsu.edu)
Date: Tue May 17 2016 - 11:26:04 CDT

Thanks a lot for your kind help.

It worked perfectly well for me.

Regards,

Aniruddha M Dive

PhD student

School of Mechanical and Materials Engg.

Washington State University

________________________________
From: owner-vmd-l_at_ks.uiuc.edu <owner-vmd-l_at_ks.uiuc.edu> on behalf of Norman Geist <norman.geist_at_uni-greifswald.de>
Sent: Monday, May 16, 2016 10:02:49 PM
To: 'Chitrak Gupta'
Cc: VMD Mailing List
Subject: AW: vmd-l: TCL script to track molecules moving within a specified region each time frame

Your main problem might be that you just write out the xyz coords to a file called .gro, which will _NOT_ result in a file having the actual GRO format. What you could do is just write out every frame putting the frame number to the file name and so have individual gro files for all your frames, which seems to be the easiest option for you.

set distance 5
set nearby [atomselect top "chain G and name C1 O2 and within $distance of name CA"]
set nf [molinfo top get numframes]
for {set frame 0} {$frame < $nf} {incr frame 1} {
puts "Info) Frame $frame/$nf"
$nearby frame $frame
$nearby update
$nearby writegro "whatever_${frame}.gro"
}

Later you can easily load all the frames with vmd doing:

vmd whatever_*.gro

Another option might be catdcd to convert the single frames into one trajectory format file.

Norman Geist

Von: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] Im Auftrag von Chitrak Gupta
Gesendet: Montag, 16. Mai 2016 20:54
An: Dive, Aniruddha Mukund <aniruddha.dive_at_wsu.edu>
Cc: vmd-l_at_ks.uiuc.edu
Betreff: Re: vmd-l: TCL script to track molecules moving within a specified region each time frame

That still doesn't sound problematic to me. Does the screen freeze (i.e. does it hang)? And what about the output file it creates? Is that totally blank?

On Mon, May 16, 2016 at 1:57 PM, Dive, Aniruddha Mukund <aniruddha.dive_at_wsu.edu<mailto:aniruddha.dive_at_wsu.edu>> wrote:

Hi Chitrak,

When I load the tcl file it does nothing, does not give me any errors nor does it run and creates an output file. The tcl window remains blank.

Regards,

Aniruddha M Dive

PhD student

School of Mechanical and Materials Engg.

Washington State University

________________________________
From: Chitrak Gupta <chgupta_at_mix.wvu.edu<mailto:chgupta_at_mix.wvu.edu>>
Sent: Monday, May 16, 2016 9:30 AM
To: Dive, Aniruddha Mukund
Cc: vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu>
Subject: Re: vmd-l: TCL script to track molecules moving within a specified region each time frame

Hi Aniruddha,

When you say "the script is not working", what does it do? Does it give an error? If not, what is it?
?

Best,
Chitrak.

On Mon, May 16, 2016 at 3:52 AM, Dive, Aniruddha Mukund <aniruddha.dive_at_wsu.edu<mailto:aniruddha.dive_at_wsu.edu>> wrote:

Hi,

I want to track the molecules moving through a specific region of my simulation box and save the trajectory of those molecules in a .gro format. I am currently using a below tcl script for the same.

set distance 5
set nearby [atomselect top "chain G and name C1 O2 and within $distance of name CA"]
set nf [molinfo top get numframes]
set file [open "dump_dol.gro" w]
for {set frame 0} {$frame < $nf} {incr frame 1} {
$nearby frame $frame
$nearby update
puts $file [$nearby get {x y z}]
puts $file "\n"
}
close $file

But the above script is not working even though the atom selection works perfectly, how do I write the required output trajectory file ?

Kindly help with this issue??

Thanks,

Aniruddha M Dive

PhD student

School of Mechanical and Materials Engg.

Washington State University