From: Tristan Croll (tristan.croll_at_qut.edu.au)
Date: Wed Dec 02 2015 - 20:05:31 CST

Hi Axel,

That's a neat approach. In my case I'm pulling positions from a running IMD simulation so efficiency is critical. I can see how grabbing the coordinates at the start of each timestep as per your approach would cut down the number of operations substantially. Thanks!

Cheers,

Tristan

 
 
Tristan Croll
Lecturer
Faculty of Health
School of Biomedical Sciences
Institute of Health and Biomedical Engineering
Queensland University of Technology
60 Musk Ave
Kelvin Grove QLD 4059 Australia
+61 7 3138 6443
 
This email and its attachments (if any) contain confidential information intended for use by the addressee and may be privileged. We do not waive any confidentiality, privilege or copyright associated with the email or the attachments. If you are not the intended addressee, you must not use, transmit, disclose or copy the email or any attachments. If you receive this email by mistake, please notify the sender immediately and delete the original email.
 
 

> On 3 Dec 2015, at 11:56 AM, Axel Kohlmeyer <akohlmey_at_gmail.com> wrote:
>
>> On Wed, Dec 2, 2015 at 8:20 PM, Tristan Croll <tristan.croll_at_qut.edu.au> wrote:
>> Hi all,
>>
>>
>>
>> At present VMD has the commands:
>>
>> measure bond
>>
>> measure angle
>>
>> measure dihed
>>
>> measure imprp
>>
>>
>>
>> each of which takes as its input a list of atom indices. However, unless I’m
>> missing something, to get the coordinates of a single atom from its index
>> still requires the use of three commands:
>>
>> set sel [atomselect top “index $thisindex”]
>>
>> set pos {*}[$sel get {x y z}]
>>
>> $sel delete
>>
>>
>>
>> Would anyone else find it useful to have a command, say, “measure pos
>> <index>” to do this?
>
> if i need to look up coordinates by index a lot, i usually do the following:
>
> set sel [atomselect top all]
> set pos [$sel get {x y z}]
> $sel del
>
> and then for all future operations on the same coordinate frame pull
> the desired coordinate triplet from $pos with list operations:
>
> set xyz [lindex $pos $idx]
>
> similar code constructs, i.e. lookup tables, can be built for a lot of
> operations to make them more efficient. much better than putting this
> into the VMD code. the topotools plugin uses this approach quite
> extensively and thus we have avoided having to put many operations
> into the VMD core. it still works quite fast for fairly large systems
> (i've processed topology files for systems with 10s of millions of
> atoms with quite decent performance, considering that this code is
> almost exclusively Tcl scripting.
>
> axel.
>
>
>
>
>
>
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Tristan
>
>
>
> --
> 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.