From: Nicholas Musolino (musolino_at_mit.edu)
Date: Thu Apr 08 2010 - 15:50:04 CDT

Dear VMD mailing list,

I have created a VMD script in which I change the coordinates (position/orientation) of a small molecule, along with two dihedral internal coordinates, in proximity to a surface. You could think of it as VMD-based docking.

My approach so far has been to write separate, single-frame DCD files for each of these configurations, and then apply catDCD afterwards to combine all these single-frame files into a single DCD file after I'm done with VMD.

What I would like to do is open for writing a *single DCD file* within VMD, and simply append frames to that. Is there any way to do this? Can I create a trajectory and "declare" new frames within VMD, and then use "animate write dcd ..."? I tried this latter approach but couldn't get it to work.

My current approach becomes unworkable if I have more than ~1000 configurations, because catdcd can't accept too many arguments, nor can BASH commands like ls, rm, etc.

Thanks in advance for any help anyone can offer!

Nicholas Musolino

### Current approach: works, but creates large numbers of temporary DCD files
### Basic approach in VMD
set timestep 0
for {set u 0} {\$u <= 1.0} {set u [expr \$u+\$u_increment] } {
  for {set v 0} {\$v <= 1.0} { set v [expr \$v + \$v_increment]} {
    for { set psi1_count 1 } { \$psi1_count <= \$number_psi1_points } { incr psi1_count } {
      for { set psi2_count 1 } { \$psi2_count <= \$number_psi2_points } { incr psi2_count } {
        #
        # Manipulate coordinates of molecule here, based on current values of u, v, psi1, psi2
        #
        $allsel writedcd [ concat ${dcdoutputfile}_$timestep.dcd ]
        incr timestep
        }
    }
  }
}

#### After VMD exits, combine using catdcd

---------------------------------------------------------------------------
Nicholas Musolino
Ph.D. candidate, Department of Chemical Engineering, MIT
musolino_at_mit.edu | 617-253-6675 | Room E19-528