From: Bennion, Brian (Bennion1_at_llnl.gov)
Date: Wed Apr 10 2013 - 11:52:03 CDT

Hello,
These are the steps that will get you the quickest results until the caver folks have native DCD import functionality (which they said might come this year).

First, use catdcd to remove the water molecules from the original DCD files. You will need to make an index file and new psf file for the reduced number of atoms. Just load the original psf, and one frame from the original DCD file.

Second, load the new smaller psf and dcd files into vmd all at once.

Third align the molecule with the attached script

Fourth, write out individual pdbs from this realigned trajectory that is already loaded into the vmd session.

Usage:
align 0 0 "name CA"
This will align all the frames to the first structure of the first trajectory.

No need for the gui interface.

proc align { rmolid smolid2 seltext } {
  set ref [atomselect $rmolid $seltext frame 0]
  set sel [atomselect $smolid2 $seltext]
  set all [atomselect $smolid2 all]
  set n [molinfo $smolid2 get numframes]

  for { set i 1 } { $i < $n } { incr i } {
    $sel frame $i
    $all frame $i
    $all move [measure fit $sel $ref]
  }
$ref delete
$all delete
 $sel delete
return
}
-----Original Message-----
From: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] On Behalf Of Yarrow Madrona
Sent: Wednesday, April 10, 2013 8:41 AM
To: Josh Vermaas
Cc: Yarrow Madrona; vmd-l_at_ks.uiuc.edu
Subject: Re: vmd-l: how to convert dcd AND ALIGN molecules then to pdbs in command line

Thank you Josh,

I have also realized that I really need to align all molecules before converting to PDBs however, I cannot find a command for doing this. I wrote a log file "log align.log" while I aligned the molecules over the trajectory for a smaller dcd file. However when I look in the log file it only says:

menu rmsdtt off
menu rmsdtt on

followed by a buch of rotate commands.

There is nothing referencing my selection (resname HEME). Do you know how to do the alignment in a script?

I'm sorry for asking so many questinos. I know some python scripting but tcl is new to me.

-Yarrow

> 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
>>>>
>>>>
>>>>
>>>>
>>>
>>
>
>

--
Yarrow Madrona
Graduate Student
Molecular Biology and Biochemistry Dept.
University of California, Irvine
Natural Sciences I, Rm 2403
Irvine, CA 92697