From: Robert Coridan (coridan_at_uiuc.edu)
Date: Fri Feb 01 2008 - 11:48:19 CST

Thanks for the quick response!

I do have a problem with this script, though. There is another question on
the vmd-l mailing list that asks this question without a vmd-related
response. I get stuck when trying to use the 'writepdb' functionality in
VMD 1.8.6. Here's the input/output:

(VMD) 1 % set mol1 [molinfo top]
0
>Main< (VMD) 2 % set old [atomselect $mol1 all]
atomselect0
>Main< (VMD) 3 % $old writepdb new.pdb
atomsel: writepdb failed.

In the text window, there is an error:

ERROR) Molecule's structure has not been initialized.

Am I forgetting to do something? I have loaded the dcd trajectory and I can
access and see all of the frames. Any advice would be a big help.

Thanks!

On Feb 1, 2008 8:55 AM, Axel Kohlmeyer <akohlmey_at_cmm.chem.upenn.edu> wrote:

> On Fri, 1 Feb 2008, Robert Coridan wrote:
>
> RC> Hi--
>
> hi robert,
>
> RC> I'm following along with the "User-Defined Forces in NAMD" tutorial,
> RC> where you can assign a force that creates a vacuum "bubble" in a
> RC> water box. I am wondering if there is any way to calculate the RDF
> RC> from the center of the bubble ({0,0,0} in the simulation).
>
> there should be multiple. what i would do is the following:
>
> load your trajectory and then execute the following script code
> (completely untested):
>
> set mol1 [molinfo top]
> set old [atomselect $mol1 all]
> $old writepdb new.pdb
>
> # now edit new.pdb so it contains an extra line with
> # an ATOM record for an atom with name X and resname X
> # at 0.00 0.00 0.00
>
> set mol2 [mol new new.pdb]
> set new [atomselect $mol2 {not name X}]
> set x [atomselect $mol2 {name X}]
> animate delete $mol2
> set numf [molinfo $mol1 get numframes]
> for {set i 0}{$i < $numf}{incr i} {
> animate dup $mol2
> $old frame $i
> $new frame $i
> $x frame $i
> $new set {x y z} [$old get {x y z}]
> $x set {x y z} {0.0 0.0 0.0}
> }
>
> mol delete $mol1
> animate write psf new.psf $mol2
> animate write dcd new.dcd $mol2
>
> and now you should have a psf/dcd combo that
> you can use with the RDF plugin (just use "name X")
> for the first selection.
>
> cheers,
> axel.
>
>
> RC>
> RC> Thanks!
> RC>
>
> --
> =======================================================================
> Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
> Center for Molecular Modeling -- University of Pennsylvania
> Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
> tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
> =======================================================================
> If you make something idiot-proof, the universe creates a better idiot.
>