From: Ali Alizadeh (ali.alizadehmoj_at_gmail.com)
Date: Wed Dec 11 2013 - 17:29:26 CST

Dear Axel,

I decided to start from a pdb file and then I find my trajectory file. I've
written a simple tcl code for calculation of COMs of water molecules.

My box includes 500 water molecules. I think it is correct I'm not sure. I
want to save these coordinates in a new pdb file

but I do not know how I can do this, Can you give me some advice?

set file [open "COM.dat" w]

for {set x 1} {$x <=500} {incr x} {
puts $x
set sel [atomselect top "resid $x"]
puts $sel
set selcom [measure center $sel]
puts $selcom
puts $file $selcom

}

close $file

On Mon, Dec 9, 2013 at 10:43 PM, Ali Alizadeh <ali.alizadehmoj_at_gmail.com>wrote:

> Dear Axel,
>
> Okay,
>
>
> On Mon, Dec 9, 2013 at 11:09 AM, Axel Kohlmeyer <akohlmey_at_gmail.com>wrote:
>
>> You have to do what your data requires.
>> --
>> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
>> International Centre for Theoretical Physics, Trieste. Italy.
>> ------------------------------
>> *From: * Ali Alizadeh <ali.alizadehmoj_at_gmail.com>
>> *Date: *Mon, 9 Dec 2013 10:43:57 -0800
>> *To: *Axel Kohlmeyer<akohlmey_at_gmail.com>
>> *Cc: *Vmd l<vmd-l_at_ks.uiuc.edu>
>> *Subject: *Re: vmd-l: Atomic trajectory to COM trajectory,
>>
>> Dear Axel,
>>
>> I have a question, Is it necessary to use wrap command for wrapping my
>> trajectory before I start scripting?
>>
>>
>> On Mon, Dec 9, 2013 at 8:26 AM, Ali Alizadeh <ali.alizadehmoj_at_gmail.com>wrote:
>>
>>>
>>> Dear Axel,
>>>
>>> Thank you for your complete and useful reply. I'll try to write each
>>> separately and then combine them.
>>>
>>>
>>> On Mon, Dec 9, 2013 at 8:21 AM, Axel Kohlmeyer <akohlmey_at_gmail.com>wrote:
>>>
>>>> On Mon, Dec 9, 2013 at 4:55 PM, Ali Alizadeh <ali.alizadehmoj_at_gmail.com>
>>>> wrote:
>>>> > Dear Axel,
>>>> >
>>>> > Thank you very much for your reply.
>>>> >
>>>> > I know I am ready for scripting but If possible I need some guides. I
>>>> have
>>>> > found I can calculate the COM of molecules but I do not know how I can
>>>> >
>>>> > save them and write in to standard trajectory.
>>>>
>>>> here is the recipe in 'vmd shorthand':
>>>> you need to build a new molecule with "mol new atoms ###" where ### is
>>>> the number of molecules, create a selection for this molecule
>>>> containing all atoms with atomselect, and then loop over the existing
>>>> trajectory, collect the COMs in a list of xyz coordinate triples,
>>>> create a new frame in the new molecule with "animate dup", then step
>>>> the selection to that frame and assign the coordinate list to the {x y
>>>> z} property.
>>>>
>>>> once the loop is complete, you can save the new molecule as a .dcd or
>>>> similar file. for easier processing, you may assign some other
>>>> properties (type, name, mass, etc.) to the atoms in the molecule and
>>>> write out a .psf file as well.
>>>>
>>>> more detailed explanations for all those steps are in the users guide
>>>> and some examples for parts of these tasks are in some of the
>>>> available tutorials as well. each step by itself is fairly simple, the
>>>> complications come from having to combine and properly assemble all of
>>>> them. you are better off first writing small test scriptlets where you
>>>> practice each feature and piece separately until you are confident to
>>>> know what you are doing. any more detailed guide would be the same as
>>>> writing the script directly.
>>>>
>>>> axel.
>>>>
>>>> >
>>>> >
>>>> > On Mon, Dec 9, 2013 at 6:32 AM, Axel Kohlmeyer <akohlmey_at_gmail.com>
>>>> wrote:
>>>> >>
>>>> >> Possible? Yes.
>>>> >> Automatic? No.
>>>> >>
>>>> >> It would require quite a bit of custom vmd scripting. Not very
>>>> difficult,
>>>> >> but you would have to combine different pieces of scripting that
>>>> have been
>>>> >> discussed before.
>>>> >>
>>>> >> Axel.
>>>> >> --
>>>> >> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
>>>> >> International Centre for Theoretical Physics, Trieste. Italy.
>>>> >> ________________________________
>>>> >> From: Ali Alizadeh <ali.alizadehmoj_at_gmail.com>
>>>> >> Sender: owner-vmd-l_at_ks.uiuc.edu
>>>> >> Date: Mon, 9 Dec 2013 16:39:30 +0330
>>>> >> To: Vmd l<vmd-l_at_ks.uiuc.edu>
>>>> >> Subject: vmd-l: Atomic trajectory to COM trajectory,
>>>> >>
>>>> >>
>>>> >> Dear All users,
>>>> >>
>>>> >> I have done an NVT ensemble with LAMMPS package. I have saved its
>>>> >> trajectory in trr format.
>>>> >>
>>>> >> Now, I want to convert that atomic trajectory to trajectory of
>>>> center of
>>>> >> mass of molecules. Is it
>>>> >>
>>>> >> possible? Does any body have experience? I want to do this for
>>>> calculation
>>>> >> of density and g(r)
>>>> >>
>>>> >> values of COMs in VMD. Can I save the coordinates of atomic
>>>> trajectory of
>>>> >> atoms as COM
>>>> >>
>>>> >> trajectory?
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Sincerely
>>>> >>
>>>> >> Ali Alizadeh
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Sincerely
>>>> >
>>>> > Ali Alizadeh
>>>>
>>>>
>>>>
>>>> --
>>>> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
>>>> International Centre for Theoretical Physics, Trieste. Italy.
>>>>
>>>
>>>
>>>
>>> --
>>> Sincerely
>>>
>>> Ali Alizadeh
>>>
>>
>>
>>
>> --
>> Sincerely
>>
>> Ali Alizadeh
>>
>
>
>
> --
> Sincerely
>
> Ali Alizadeh
>

-- 
Sincerely
Ali Alizadeh