From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Thu Aug 25 2022 - 17:37:03 CDT

On Thu, Aug 25, 2022 at 6:15 PM <michaelmorgan937_at_gmail.com> wrote:

> Thanks. Can I do it in VMD (adding an additional atom to trajectory)? The
> trajectory file was generated by CHARMM.
>

Yes, but the only way I can think of requires some elaborate scripting. The
core issue is that VMD doesn't support adding atoms once a trajectory is
loaded or even during loading.

The basic procedure would be something like the following:

- load your psf file and the dcd file into it. take note how many frames
there are. create an atom selection for all atoms
- now create an "empty" new molecule with "mol new atoms 1" and add one
empty frame to use with "animate dup top"
- create an atomselection for that and set all properties you want to set
(name, type, resname, resid, x, y, z)
- load the topotools package (package require topotools)
- use the TopoTools::mergemols command (
https://urldefense.com/v3/__https://sites.google.com/site/akohlmey/software/topotools/documentation*h.xb14nfp111d4__;Iw!!DZ3fjg!6OEgHVAS2F8iyB5FEmGKxOd4kVy5ZIV25MMbf0P5BoVuAz5Fvd5TNgCKBKJ3JAxskijVvt7s8TOlpBXjMw$ )
to create a third molecule that combines both. this will contain only one
frame with the data from the first frame of each of the first two molecules
- create an atomselection in this third molecule for the atoms from the
first molecule and another for the extra atom.
- now you can do a loop over all frames of the trajectory (except the
first!), reposition the atom selection in the first molecule to that frame,
then do animate dup on the third molecule to append a new, empty frame and
then copy x, y, z and from the first molecule to the third with the atom
selections and set the coordinates for the reference point through the
second atom selection.
you also need to copy over the box information.

if this is all done, you can write out a new .psf and .dcd file from the
third molecule and use that for your analysis.

If you are not very familiar with the command line and the VMD Tcl
scripting interface, it will take some time to learn and study the user's
guide and make some experiments with simpler examples.

Axel.

> *From:* Axel Kohlmeyer <akohlmey_at_gmail.com>
> *Sent:* Wednesday, August 24, 2022 5:17 PM
> *To:* michaelmorgan937_at_gmail.com
> *Cc:* Vmd l <vmd-l_at_ks.uiuc.edu>
> *Subject:* Re: vmd-l: rdf with respect to a specific point
>
>
>
> The way to do this is to add this position as an additional atom to your
> trajectory.
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!6OEgHVAS2F8iyB5FEmGKxOd4kVy5ZIV25MMbf0P5BoVuAz5Fvd5TNgCKBKJ3JAxskijVvt7s8TOPyDRYVg$
> College of Science & Technology, Temple University, Philadelphia PA, USA
> International Centre for Theoretical Physics, Trieste, Italy
>
>
>
> On Wed, Aug 24, 2022, 15:02 <michaelmorgan937_at_gmail.com> wrote:
>
> Dear all,
>
>
>
> I have a DCD file and I would like to perform rdf analysis around a
> specific xyz point (which is not occupied by any atom). Can I use the g(r)
> plugin for the purpose? It seems in the
> plugin I need specify two selections but how to specify this empty
> position? If cannot do it with g(r), what’s other choice in VMD?
>
>
>
> Thank you very much.
>
>
>
> Michael M.
>
>
>
>
>
>
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!6OEgHVAS2F8iyB5FEmGKxOd4kVy5ZIV25MMbf0P5BoVuAz5Fvd5TNgCKBKJ3JAxskijVvt7s8TOPyDRYVg$  
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.