From: Ryan McGreevy (ryanmcgreevy_at_ks.uiuc.edu)
Date: Thu Nov 19 2015 - 08:41:56 CST

That's because you are making two different atom selections (allsel and
allframe) and then you are using the selection of all atoms (allsel) to
write a pdb. You should instead use allframe, which contains only the
atoms you want. It doesn't look like you need allsel at all, just allframe.

On Thu, Nov 19, 2015, 1:46 AM Albert <mailmd2011_at_gmail.com> wrote:

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