From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue Aug 12 2014 - 14:18:33 CDT

On Tue, Aug 12, 2014 at 1:47 PM, Natal Kanaan <kanaan_at_zedat.fu-berlin.de> wrote:
> Thanks a lot to all of you for all the input.
> I got into this averaged-position feature because I was trying to do what
> I asked about yesterday: what I really would like to do is to re-label the
> water molecules according to the distance to my protein, but I can't make

that is a completely different issue and i don't understand how
averaging positions would help with that.

now some comments on the "distance from protein" issue:

- you have to use Tcl scripting and failing to know Tcl scripting,
learn Tcl first from the well done tutorial on www.tcl.tk. pay
particular attention to creating, using and manipulating lists.

- *then* look through the Tcl scripting interface chapter in the VMD
user's guide (not the other way around).

- your "label by distance from protein" is a bit ambiguous, because
the protein is an extended structure, so where do you take the
reference point to compute the distance from. ...and if you want to
use the "surface", you first have to determine what *is* the surface
and then still it will be ambiguous, since there can be molecules at
the same distance relative to the surface in multiple place.
..and finally, you also have the issue of the fact that a water
molecule has multiple sites and thus an orientation relative to the
protein, so you have to make a consistent choice how to compute that
as well.

overall, you should discuss this with your adviser or somebody else
(local!) that can advise you on these issues. as you see, this is far
from a simple problem and your somewhat random probing around is not
likely to yield success soon or at all.

> it. Any further comments would be great and thanks a lot for your time and
> help.
> Natal
>
>> On Tue, Aug 12, 2014 at 1:01 PM, Natal Kanaan <kanaan_at_zedat.fu-berlin.de>
>> wrote:
>>> Hi,
>>> yes, I already wrapped the dcd before, so I thought the problem was
>>> solved. Maybe I need to write a new dcd aligned or something like that?
>>
>> averaged positions only make sense for structures/atoms that stay in
>> place, e.g. in a crystal. every part that can more more or less freely
>> will lead to all kinds of deformations and unphysical structures from
>> when being averaged over.
>>
>> consider the simple example of a rotating hydrogen molecule. if it
>> rotates, you will get as the averaged position (over a long enough
>> trajectory) both atoms at the center of mass location of the molecule.
>>
>> so, for your analysis, you have to carefully consider what it really
>> is that you want to look at. diffusing/librating/rotating water
>> molecules will not likely give any meaningful average.
>>
>> axel.
>>
>>
>>> Thanks a lot,
>>> Natal
>>>
>>>> I assume ran a periodic simulation, so you're also going to have to
>>>> deal
>>>> with PBC unit cell coordinate wrapping issues. This is best done by
>>>> having
>>>> a look at the "pbctools" VMD plugin and doing preprocessing on your
>>>> structure
>>>> prior to averaging coordinates.
>>>>
>>>> Cheers,
>>>> John Stone
>>>> vmd_at_ks.uiuc.edu
>>>>
>>>> On Tue, Aug 12, 2014 at 06:42:05PM +0200, Natal Kanaan wrote:
>>>>> Thanks for your quick reply Josh & John,
>>>>> I got the averaged.pdb but it is a very weird structure which really
>>>>> can't
>>>>> be used. Do you ever had that problem?
>>>>> Thanks,
>>>>> Natal
>>>>>
>>>>> > Hi Natal,
>>>>> >
>>>>> > Is this running windows? If so, you are probably running into the
>>>>> > limitations of how much memory VMD can address (32-bit applications
>>>>> can
>>>>> > only access 4GB or so of RAM), as your DCDs are probably combined
>>>>> larger
>>>>> > than this limit. There are two solutions to this problem: only take
>>>>> a
>>>>> > subset of the frames (using step as an argument to the addfile
>>>>> command:
>>>>> > http://www.ks.uiuc.edu/Research/vmd/current/ug/node138.html), or go
>>>>> to
>>>>> a
>>>>> > 64-bit system with sufficient RAM to load all the trajectories at
>>>>> once.
>>>>> >
>>>>> > In terms of writing a pdb with the average structure, this should in
>>>>> > principle work:
>>>>> >
>>>>> > set sel [atomselect $mol "whatever text you need to get the
>>>>> selection
>>>>> > you want here"]
>>>>> > $sel set {x y z} [measure avpos $sel]
>>>>> > $sel writepdb averagestructure.pdb
>>>>> >
>>>>> > Be aware that the second line will change atomic coordinates for the
>>>>> > current frame, so instead of it being part of your trajectory, its
>>>>> now
>>>>> > the average position.
>>>>> >
>>>>> > -Josh Vermaas
>>>>> >
>>>>> > On 8/12/14, 7:30 AM, Natal Kanaan wrote:
>>>>> >> Dear all,
>>>>> >> I'm trying to write a pdb structure which is an average of several
>>>>> >> trajectories. Searching in the list, I found a script similar to
>>>>> the
>>>>> one
>>>>> >> below, but I don't know how to really write this new-averaged-pdb
>>>>> >> structure:
>>>>> >>
>>>>> >> set mol [mol new ../model8_final/setup/model8_ionized.psf type psf
>>>>> >> waitfor
>>>>> >> all]
>>>>> >> mol addfile model8_R3_parte1.dcd type dcd waitfor all
>>>>> >> mol addfile model8_R3_parte2.dcd type dcd waitfor all
>>>>> >> mol addfile model8_R3_parte3.dcd type dcd waitfor all
>>>>> >> mol addfile model8_R3_parte4.dcd type dcd waitfor all
>>>>> >> set sel [atomselect $mol all]
>>>>> >> measure avpos $sel
>>>>> >>
>>>>> >> Any kind of help would be really appreciated. Another issue is
>>>>> that,
>>>>> as
>>>>> >> I
>>>>> >> have a lot of data, if I just source this script directly in vmd,
>>>>> it
>>>>> >> ends
>>>>> >> up being "killed". I already tried with:
>>>>> >>
>>>>> >> vmd -dispdev text -e xx.tcl
>>>>> >>
>>>>> >> but it is also killed.
>>>>> >> Thanks a lot in advance for your help,
>>>>> >> Natal
>>>>> >>
>>>>> >
>>>>>
>>>>
>>>> --
>>>> NIH Center 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/
>>>>
>>>
>>>
>>
>>
>>
>> --
>> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
>> College of Science & Technology, Temple University, Philadelphia PA, USA
>> International Centre for Theoretical Physics, Trieste. Italy.
>>
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.