From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Tue Apr 09 2013 - 20:06:05 CDT

I was writing by memory and didn't actually test the code first
(whoops). The reason my implementation only writes one frame is because
I goofed the syntax for the animate delete call, and it dies after
writing the first pdb. The script should read:

mol new test.psf
set nowater [atomselect top "not water"]
for {set i 0} {$i < 10} {incr i} {
    animate read dcd CIN-SUM-every10.dcd beg $i end $i waitfor all
    $nowater writepdb WT_$i.pdb
    animate delete *all*
}
exit

That'll teach me from not looking up syntax first. :(
-Josh

On 04/09/2013 07:50 PM, Yarrow Madrona wrote:
> Hi Josh,
>
> Thanks for your help. For some reason your script only writes out the
> first pdb and not the rest. This is what I am using:
>
> mol new test.psf
> set nowater [atomselect top "not water"]
> set nf [molinfo top get numframes]
> for {set i 0} {$i < 10} {incr i} {
> animate read dcd CIN-SUM-every10.dcd beg $i end $i waitfor all
> $nowater writepdb WT_$i.pdb
> animate delete
> }
> exit
>
>
>
>
>
>
>> Another option is to run VMD in text mode. Make a simple script
>> (script.tcl) like this:
>>
>> mol new psffile.psf
>> set nowater [atomselect top "not water"]
>> for { set i 0 } { $i < 70000 } { incr i } {
>> animate read dcd dcdfile.dcd beg $i end $i waitfor all
>> $sel writepdb $i.pdb
>> animate delete
>> }
>> exit
>>
>> This will go through each frame one by one and write it to its own pdb,
>> while never keeping more than 1 frame in memory. You can then run it
>> from the command line with something like:
>>
>> vmd -dispdev text -e script.tcl (see
>> http://www.ks.uiuc.edu/Research/vmd/current/ug/node207.html for more on
>> using the command line to start vmd, including the extra step required
>> on windows)
>>
>> -Josh
>>
>> On 04/09/2013 01:12 AM, peter.schmidtke_at_fr.netgrs.com wrote:
>>> Hey,
>>>
>>> Consider using ambertools ptraj for instance, which could do the pdb
>>> export.
>>>
>>> Best regards.
>>>
>>> Peter
>>>
>>> -----Message d'origine-----
>>> De : owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] De la part
>>> de Yarrow Madrona
>>> Envoyé : mardi 9 avril 2013 01:43
>>> À : VMD mailing list
>>> Objet : Re: vmd-l: how to convert dcd to pdbs in command line
>>>
>>> Hello,
>>>
>>> I am trying to convert a dcd to a series of pdb's without opening the
>>> VMD GUI. The reason is that I don't have enough ram to store the DCD
>>> (70,000
>>> frames) into memory. VMD always crashes unless I use a truncated DCD. I
>>> would like to use all frames since the frames will be analyzed by
>>> another software (Caver3.0). Is there a way to tell vmd to write out all
>>> PDBs in the command line (preferably without water although I can remove
>>> those later)?
>>>
>>> Thank you
>>>
>>>
>>> --
>>> Yarrow Madrona
>>>
>>> Graduate Student
>>> Molecular Biology and Biochemistry Dept.
>>> University of California, Irvine
>>> Natural Sciences I, Rm 2403
>>> Irvine, CA 92697
>>>
>>>
>>>
>>>
>>
>