From: Giacomo Fiorin (giacomo.fiorin_at_gmail.com)
Date: Fri Apr 27 2018 - 12:41:46 CDT

To clarify the problem: the rotation that "measure fit" computes is defined
by the condition that it minimizes the RMSD from the reference
coordinates. While there is always one global minimum for the RMSD by
definition, there can be different local minima: on occasion, two local
minima may coincide.

There is no magic solution to this problem: you must choose sets of atoms
for which the optimal rotation is well defined, i.e. molecules that retain
their structure to some extent, like folded proteins.

Giacomo

On Fri, Apr 27, 2018 at 1:31 PM, Ashar Malik <asharjm_at_gmail.com> wrote:

> Like I said -- no such thing as "correct".
> But if they agree with what you expect - that is good enough.
>
> On Sat, Apr 28, 2018 at 5:25 AM, Sadegh Faramarzi Ganjabad <
> safaramarziganjabad_at_mix.wvu.edu> wrote:
>
>> Ashar,
>>
>> Yes I get the results and compare them with individual RMSD values I get
>> from the RMSD plugin. The values are correct.
>>
>> Thanks,
>> Sadegh Faramarzi,
>> Research Assistant
>> West Virginia University, Department of Chemistry
>> Email:safaramarziganjabad_at_mix.wvu.edu
>>
>> On Fri, Apr 27, 2018 at 1:23 PM, Ashar Malik <asharjm_at_gmail.com> wrote:
>>
>>> Please note that calculation of RMSD is a sub-optimal process. You can
>>> never truly know if the solution is good enough.
>>> Since this is just a warning and not an error, I am guessing you do get
>>> a result? which I think you should. Is that result reasonable? If it is you
>>> can ignore the warning.
>>>
>>> On Sat, Apr 28, 2018 at 4:38 AM, Sadegh Faramarzi Ganjabad <
>>> safaramarziganjabad_at_mix.wvu.edu> wrote:
>>>
>>>> Hello,
>>>>
>>>> Thank you all for your comments. I have 385 lipids, but the error
>>>> happened even for smaller number of residues. It seems deleting selections
>>>> solves the problem. Now it does not take too much of memory, although it
>>>> gives that error
>>>>
>>>> Matrix: Warning: no convergence (0.00000000<2177.16064453 after 1000
>>>> iterations).
>>>>
>>>> Best,
>>>> Sadegh Faramarzi,
>>>> Research Assistant
>>>> West Virginia University, Department of Chemistry
>>>> Email:safaramarziganjabad_at_mix.wvu.edu
>>>>
>>>> On Fri, Apr 27, 2018 at 10:21 AM, Udaya Dahal <dahal.udaya_at_gmail.com>
>>>> wrote:
>>>>
>>>>> If you want to delete all atom selection after each run, just use
>>>>> foreach sel [atomselect list] {$sel delete}
>>>>>
>>>>> otherwise you have to explicitly delete variables as Brian mentioned.
>>>>>
>>>>> Regards,
>>>>>
>>>>> On Fri, Apr 27, 2018 at 9:59 AM, Brian Radak <brian.radak_at_gmail.com>
>>>>> wrote:
>>>>>
>>>>>> +1 to Giacomo.
>>>>>>
>>>>>> For the record (although you should really read the documentation!)
>>>>>> the syntax for deleting a selection freeing up memory is:
>>>>>>
>>>>>> <selection value> delete
>>>>>>
>>>>>> as in this pseudocode:
>>>>>>
>>>>>> set compare [atomselect top "residue 1"]
>>>>>> for # iterate frames {
>>>>>> $compare frame $frame
>>>>>> <measure>
>>>>>> }
>>>>>> $compare delete
>>>>>>
>>>>>> I would hazard a guess that VMD attempts to clean up all such objects
>>>>>> whenever it exits, but it will almost always be much better to delete them
>>>>>> explicitly.
>>>>>>
>>>>>> On Fri, Apr 27, 2018 at 8:01 AM, Giacomo Fiorin <
>>>>>> giacomo.fiorin_at_gmail.com> wrote:
>>>>>>
>>>>>>> Any atom selection created in VMD will take up memory. I'm not sure
>>>>>>> if that's the cause in your case (how many POPC molecules are there?), but
>>>>>>> you should remove the selections that you don't use any more. The
>>>>>>> documentation of the atomselect command contains the syntax for that.
>>>>>>>
>>>>>>> Also, the "get" method for an atomselection returns the requested
>>>>>>> property for each atom in the selection. Try printing the result of "get
>>>>>>> residue".
>>>>>>>
>>>>>>> Giacomo
>>>>>>>
>>>>>>> On Fri, Apr 27, 2018 at 12:30 AM, Sadegh Faramarzi Ganjabad <
>>>>>>> safaramarziganjabad_at_mix.wvu.edu> wrote:
>>>>>>>
>>>>>>>> Hello all,
>>>>>>>>
>>>>>>>> I am trying to calculate RMSD of individual lipids in a
>>>>>>>> protein-lipid system. I found this code that aligns a single residue and
>>>>>>>> gets the RMSD of the entire trajectory.
>>>>>>>>
>>>>>>>> # Prints the RMSD of the protein atoms between each timestep
>>>>>>>> # and the first timestep for the given molecule id (default: top)
>>>>>>>> proc print_rmsd_through_time {{mol top}} {
>>>>>>>> # use frame 0 for the reference
>>>>>>>> set reference [atomselect $mol "residue X" frame 0]
>>>>>>>> # the frame being compared
>>>>>>>> set compare [atomselect $mol "residue X"]
>>>>>>>>
>>>>>>>> set num_steps [molinfo $mol get numframes]
>>>>>>>> for {set frame 0} {$frame < $num_steps} {incr frame} {
>>>>>>>> # get the correct frame
>>>>>>>> $compare frame $frame
>>>>>>>>
>>>>>>>> # compute the transformation
>>>>>>>> set trans_mat [measure fit $compare $reference]
>>>>>>>> # do the alignment
>>>>>>>> $compare move $trans_mat
>>>>>>>> # compute the RMSD
>>>>>>>> set rmsd [measure rmsd $compare $reference]
>>>>>>>> # print the RMSD
>>>>>>>> puts "RMSD of $frame is $rmsd"
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> but when I iterate this code for all lipid residues it takes a lot of memory and my computer freezes. I'm not sure why. Here is the code I'm using
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> set selmode [[atomselect top "resname POPC"] get residue]
>>>>>>>> #gets stdin selmode
>>>>>>>> foreach r $selmode {
>>>>>>>>
>>>>>>>> # selection
>>>>>>>> set reference [atomselect top "residue $r" frame 0]
>>>>>>>> set compare [atomselect top "residue $r"]
>>>>>>>> set num_steps [molinfo top get numframes]
>>>>>>>> set output [open "rmsd_$r.dat" w]
>>>>>>>> # rmsd calculation loop
>>>>>>>> for {set frame 0} {$frame < $num_steps} {incr frame} {
>>>>>>>> # get the correct frame
>>>>>>>> $compare frame $frame
>>>>>>>>
>>>>>>>> # compute the transformation
>>>>>>>> set trans_mat [measure fit $compare $reference]
>>>>>>>> # do the alignment
>>>>>>>> $compare move $trans_mat
>>>>>>>> # compute the RMSD
>>>>>>>> set rmsd [measure rmsd $compare $reference]
>>>>>>>> # print the RMSD
>>>>>>>> #puts "$r"
>>>>>>>> puts $output "$rmsd"
>>>>>>>> }
>>>>>>>>
>>>>>>>> close $output
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Does anybody know a better way of doing this?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Sadegh Faramarzi,
>>>>>>>>
>>>>>>>> Research Assistant
>>>>>>>> West Virginia University, Department of Chemistry
>>>>>>>> Email:safaramarziganjabad_at_mix.wvu.edu
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Giacomo Fiorin
>>>>>>> Associate Professor of Research, Temple University, Philadelphia, PA
>>>>>>> Contractor, National Institutes of Health, Bethesda, MD
>>>>>>> http://goo.gl/Q3TBQU
>>>>>>> https://github.com/giacomofiorin
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Best,
>>> /A
>>>
>>
>>
>
>
> --
> Best,
> /A
>

-- 
Giacomo Fiorin
Associate Professor of Research, Temple University, Philadelphia, PA
Contractor, National Institutes of Health, Bethesda, MD
http://goo.gl/Q3TBQU
https://github.com/giacomofiorin