From: Albert (mailmd2011_at_gmail.com)
Date: Thu Nov 19 2015 - 01:46:40 CST

Thanks a lot for the advice.

I tried:

proc split_multi_frame_structure { whichmol workdir } {
   set allsel [atomselect $whichmol "all"]
   set numframes [molinfo $whichmol get numframes]
   for {set i 0} {$i < $numframes} {incr i} {
     set allframe [atomselect top "sidechain and resid 390 386 358 361
362 368 200 203 120 121 199 116 117 189 113"]
     $allsel frame $i
     set filename [format "%s/%03d.pdb" $workdir $i]
     file delete $filename
     $allsel writepdb $filename
     mol new $filename

   }

}

It export everything to each .pdb file instead of atoms I selected....

Thanks again

On 11/18/2015 05:26 PM, Ryan McGreevy wrote:
> Your problem is in the line:
>
> $allsel frame $i and get [atomselect top "resname UNK or sidechain
> and resid 390 386 358 361 362 368 200 203 120 121 199 116 117 189 113"]
>
> I assume you are trying to make an atom selection for the current
> frame ($i). In that case, you need to do the following:
>
> set allframe [atomselect top "resname UNK or sidechain
> and resid 390 386 358 361 362 368 200 203 120 121 199 116 117 189 113"]
> $allsel frame $i
>