From: Nuno Loureiro Ferreira (nunolf_at_ci.uc.pt)
Date: Thu Jul 19 2007 - 03:47:18 CDT

Hi Neelanjana

Here's an almost working script for what you want.
Overview:
1 - select frames to work with
2 - write them as dcd
3 - use catdcd to concatenate them

The 3rd step is not working. But if in your shell or vmd prompt
you issue the command catdcd -o outfile file1.dcd file2.dcd ..., it works.
Probably someone out there could give a hint about this!!

The script bellow will save frames 2,3, 25, 74, 75, 76 to a single dcd
file (cathed.dcd),
in the same order.

Cheers,
Nuno

P.S. You need to install catdcd b4 trying the script

################################
puts "usage: writeSelFrames"
proc writeSelFrames {} {
    set sel [atomselect top "protein"] ;# atom selection
    # step 1
    set frameList {2 3 25 74 75 76} ;# frame selection
    set trashList {}
    foreach item $frameList {
        $sel frame $item
        $sel update
        # step 2
        $sel writedcd snapshot_${item}.dcd
        lappend trashList snapshot_${item}.dcd
    }
     # step 3
# set cmd "catdcd -o cathed.dcd $trashList"
# eval [exec $cmd]
# foreach item $trashList {file delete $item} ;# deletes single
snashot_*.dcd files
}
#################################

Neelanjana Sengupta wrote:
> Hi VMD experts,
>
> I need to select certain frames (based on some physical criteria of
> the system) of my .dcd file, and write out a new .dcd file from those
> frames, which are NOT continous. (For eg., I need to write frames 2-8,
> 10, 15, 25-30, 74-89 into a single .dcd file, from a 100 frame
> trajectory). Can somebody suggest a method to do this?
>
> Thank you in advance,
> Regards,
> Neelanjana Sengupta
>
> --
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.476 / Virus Database: 269.10.8/904 - Release Date: 16-07-2007 17:42
>