VMD-L Mailing List
From: Jérôme Hénin (jhenin_at_ifr88.cnrs-mrs.fr)
Date: Thu Sep 23 2010 - 03:55:43 CDT
- Next message: Zhang, Jiong (MU-Student): "about psfgen patch"
- Previous message: Joshua Adelman: "Re: write pdbs of selected frames of a trajectory"
- In reply to: Joshua Adelman: "Re: write pdbs of selected frames of a trajectory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi guys,
On 22 September 2010 22:52, Joshua Adelman <jla65_at_pitt.edu> wrote:
> Hi Katherine,
>
> Simply make the selection of atoms that you want:
> set A [atomselect <molid> "all" frame <framenumber>]
>
> where <molid> is the molid of the loaded trajectory and <framenumber> is the
> desired frame. Then,
>
> $A writepdb <outputfilename>.pdb
>
> and just repeat to get the desired frames.
The basic idea is right, but this is not the recommended way for
multiple frames. This leads to a memory leak, where multiple
atomselect objects are created and never deleted (and the reference is
lost when variable A gets overwritten).
It's better to create the atom selection just once:
set A [atomselect <molid> "all"]
# and repeat the following:
$A set frame <frame_number>
$A writepdb <outputfilename>.pdb
Cheers,
Jerome
- Next message: Zhang, Jiong (MU-Student): "about psfgen patch"
- Previous message: Joshua Adelman: "Re: write pdbs of selected frames of a trajectory"
- In reply to: Joshua Adelman: "Re: write pdbs of selected frames of a trajectory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]