From: Sam Wallace (sam.wallace_at_adelaide.edu.au)
Date: Sun Nov 13 2011 - 04:58:37 CST

Hi John & other VMD users.

It's ok, I've managed to make a script that seems to do the job. I
copied/modified some of Axel's code from his topotools plugin
I apologise in advance if anyone finds my code is messy and unoptimised,
I'm still getting the hang of commenting, neatness and efficiency.

the first function duplicates a trajectory with an arbitrary number of
additional atoms
the second function takes the first extra atom from a trajectory and
assigns coordinates to the centre of mass of a valid string of selection
text
it is then possible to measure the radial distribution function from the
centre of mass of a selection over a whole trajectory

It is very likely that this script will run into issues for some
configurations, I suspect vmd will have some memory issues with very large
trajectories.
I've tested it with modest sized ones ~300mb (10000 atoms, 2500 frames),
but I wouldn't be surprised if it'd crash with ones over 1gb.

The functions are available in the link below

http://dl.dropbox.com/u/10332930/VMD/com_rdf.tcl

-Sam

On 12 November 2011 02:36, John Stone <johns_at_ks.uiuc.edu> wrote:

> Hi,
> At present, there really isn't a good way to "expand" an existing
> trajectory by adding new particles to it, at least not within VMD or
> by using catdcd. You could write some code to do this however if
> you're handy. Other than writing some special code, I don't have
> a better suggestion at this moment. Maybe someone else has an idea
> besides writing custom code.
>
> Cheers,
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Thu, Nov 10, 2011 at 09:08:39AM +1030, Sam Wallace wrote:
> > Hi
> >
> > I'm trying to create a tcl script to measure a radial distribution
> > function from the centre of mass of an arbitrary selection.
> >
> > I've read through the mailing list and this message seemed the most
> helpful
> > http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/16854.html
> > in particular this part
> >
> > >method b): you create a fake molecule that contains
> > >only one atom per solute but the rest as is and then
> > >write a script that copies over the coordinates and
> > >replaces the coordinates for the one solute atom
> > >per molecule with the center of mass of the whole
> > >molecule. that would be a bit time consuming, but
> > >not very complicated if you build this script step by
> > >step.
> >
> > If I'm understanding this method correctly, it would require modifying
> > the input structures and running the simulations again. What I'm
> > hoping to do is modify the existing trajectories
> >
> > I've made a script that will create a new molecule with 1 atom, and
> > the same number of frames as the original trajectory, and it then sets
> > the position of that atom to the centre of mass of an arbitrary
> > selection over the trajectory.
> > I've looked at the TopoTools plugin and the mergemols procress, but it
> > only handles single frames.
> >
> > So my question(s) are.
> > 1) Is there some simple function or method of adding a dummy atom to
> > an existing trajectory?
> > 2) Is there a method to merge the atoms of two trajectories together?
> >
> > Thanks,
> >
> > -Sam
> >
> > --------------------------------------------------------------
> > Sam Wallace, Ph.D Student
> > School of Chemistry and Physics, University of Adelaide
> > Adelaide, South Australia 5005, Australia
> > Phone: +61-(0)8-8303-4332
> > Fax: +61-(0)8-8303-4358
> > Email: sam.wallace_at_adelaide.edu.au
> > "I suppose you wouldn't have a problem with me saying the fermi-dirac
> > distribution is a soup kitchen"
>
> --
> NIH Resource for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> http://www.ks.uiuc.edu/Research/vmd/ Fax: 217-244-6078
>