From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed May 03 2006 - 17:52:21 CDT

Hi,
  Try this script:

##
## Write PDB files from a trajectory, using specified frame range
##
## Example:
## writepdbsfromtraj top all 0 -1 1 /tmp/mytraj%04d.pdb

proc writepdbsfromtraj { molid seltext first last step fileformat } {
  set numframes [molinfo $molid get numframes]
  set sel [atomselect $molid $seltext]

  if { $last < 0 } {
    set last $numframes
  }

  for {set frame $first} {$frame < $numframes} {incr frame $step} {
    $sel frame $frame
    $sel update
    puts "Frame: $frame"

    set filename [format $fileformat $frame]
    $sel writepdb $filename
  }

  $sel delete
}

On Wed, May 03, 2006 at 05:19:21PM -0400, Raul Araya Secchi wrote:
>
> Dear VMD users:
>
> This may sound trivial, but ....
>
> I have a dcd file with 600 frames, and I want to pick 50 frames and
> save each one as an independent pdb file, but the only result I get is
> one bif pdb file with all my selected frames in it. So how can I make
> vmd save each frame in one pdb file??
>
> Please Help....
>
> Raul Araya
> CGB_Universidad Catolica de Chile

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078