[gmx-users] Gmx distance

Justin Lemkul jalemkul at vt.edu
Sat Nov 3 17:25:43 CET 2018



On 11/2/18 11:36 AM, rose rahmani wrote:
> but this is output of -oall. its not a single value?!

You are asking in your command for all interatomic distances between the 
groups (presumably, because you haven't shown your selection). This 
command won't yield what you're hoping to see and my advice does not 
apply for this type of situation (which doesn't seem to even match your 
original statement of your problem).

>    gmx distance -f md2.xtc -oall dist.xvg -n index.ndx
> # gmx distance is part of G R O M A C S:
> #
> #
> ¸<8d><9a><9a><91>í<9a><9b>ð<8d><9e><91><98><9a>ò<9e><98><9a><91><8b><9e>þ<85><8a><8d><9a>ü<86><9e><91>ì<94><86><9d><99a>8a><<
> #
> @    title "Distance"
> @    xaxis  label "Time (ps)"
> @    yaxis  label "Distance (nm)"
> @TYPE xy
>
>      1.000    0.229    0.229    0.446    0.582    0.446    0.229    0.446
> 0.583    0.447    0.229    0.447    0.227    0.228    0.229    0.446
> 0.582    0.446    0.228    0.446    0.583    0.447    0.228    0.447
> 0.227    0.227    0.228    0.446    0.582    0.446    0.227    0.446
> 0.583    0.447    0.227    0.447    0.227    0.228    0.229    0.446
> 0.582    0.446    0.228    0.446    0.583    0.447    0.228    0.447
> 0.227    0.228    0.229    0.446    0.582    0.446    0.228    0.446
> 0.583    0.447    0.228    0.447    0.227    0.229    0.229    0.446
> 0.582    0.446    0.229    0.446    0.583    0.447    0.229    0.447
> 0.227    0.229    0.229    0.446    0.582    0.446    0.229    0.446
> 0.583    0.447    0.229    0.447    0.227    0.228    0.229    0.446
> 0.582    0.446    0.228    0.446    0.583    0.447    0.228    0.447
> 0.227    0.228    0.229    0.446    0.582    0.446    0.228    0.446
> 0.583    0.447    0.228    0.447    0.227    0.227    0.228    0.446
> 0.582    0.446    0.227    0.446    0.583    0.447    0.227    0.447
> 0.227    0.228    0.229    0.446    0.582    0.446    0.228    0.446
> 0.583    0.447    0.228    0.4
> .
> .
> .
>
> and this is -o of g_dist;
>   g_dist -f md2.xtc -s md2.tpr -n index -o all.xvg
> #
> # g_dist is part of G R O M A C S:
> #
> # GRowing Old MAkes el Chrono Sweat
> #
> @    title "Distance"
> @    xaxis  label "Time (ps)"
> @    yaxis  label "Distance (nm)"
> @TYPE xy
> @ view 0.15, 0.15, 0.75, 0.85
> @ legend on
> @ legend box on
> @ legend loctype view
> @ legend 0.78, 0.8
> @ legend length 2
> @ s0 legend "|d|"
> @ s1 legend "d\sx\N"
> @ s2 legend "d\sy\N"
> @ s3 legend "d\sz\N"
>     0.0000000    0.2176011   -0.0120678   -0.0465498    0.2122209
>     1.0000000    0.2124534   -0.0301750   -0.0463870    0.2051198
>     2.0000000    0.1923753   -0.0158403   -0.0510135    0.1848106
>     3.0000000    0.1885315   -0.0107298   -0.0488160    0.1817856
>     4.0000000    0.2044982   -0.0052650   -0.0490329    0.1984630
>     5.0000000    0.2033602   -0.0002742   -0.0429537    0.1987720
>     6.0000000    0.2050487    0.0013833   -0.0444658    0.2001646
>     7.0000000    0.2002475    0.0041072   -0.0415003    0.1958568
>     8.0000000    0.2006473    0.0033450   -0.0511889    0.1939790
>     9.0000000    0.2032918   -0.0000119   -0.0330052    0.2005947
>    10.0000000    0.2255659    0.0003929   -0.0415857    0.2216990
>    11.0000000    0.2243811    0.0118313   -0.0344751    0.2214010
>    12.0000000    0.2347855    0.0078275   -0.0383532    0.2314994
>    13.0000000    0.2371541    0.0081918   -0.0388267    0.2338107

Here, you have what you want (I assume), and the first column after the 
time is all you need. It's the distance, which also can't be negative 
because it is the magnitude of the vector length and is unsigned.

-Justin

> .
> .
> .
>
>
> On Thu, Nov 1, 2018 at 11:39 PM Justin Lemkul <jalemkul at vt.edu> wrote:
>
>>
>> On 11/1/18 2:25 PM, rose rahmani wrote:
>>> I don't know how? I mean x,y,z(s1, s2,s3) in dist.xvg can easily be
>>> multiplied by (-), but how should i modify second column,i don't know how
>>> s0 is calculated by g_distance to modify it??
>> The output of -oall is a single value, the actual distance, which I
>> assume is what you are talking about in your previous message. You can
>> parse that column in any scripting language you like and
>>
>> [ pseudocode, not functional ]
>> if (value < 0)
>> {
>>       value *= -1
>> }
>>
>> -Justin
>>> On Wed, 31 Oct 2018, 19:38 Justin Lemkul, <jalemkul at vt.edu> wrote:
>>>
>>>> On 10/31/18 12:06 PM, rose rahmani wrote:
>>>>> Hi,
>>>>>
>>>>> I want to calculate distances between fixed tube in the middle of the
>> box
>>>>> and amino acids(all are same type)around it. But gmx distance gives me
>>>> the
>>>>> relative distance i mean AA can be front or back( can be 0.5 or -0.5
>> from
>>>>> tube) of  tube but still |-0.5|=0.5 nm far from it. How can i have the
>>>>> absolute value of distances?
>>>>> Would you please help me?
>>>> Write a simple post-processing script that multiplies any negative value
>>>> by -1.
>>>>
>>>> -Justin
>>>>
>>>> --
>>>> ==================================================
>>>>
>>>> Justin A. Lemkul, Ph.D.
>>>> Assistant Professor
>>>> Virginia Tech Department of Biochemistry
>>>>
>>>> 303 Engel Hall
>>>> 340 West Campus Dr.
>>>> Blacksburg, VA 24061
>>>>
>>>> jalemkul at vt.edu | (540) 231-3129
>>>> http://www.thelemkullab.com
>>>>
>>>> ==================================================
>>>>
>>>> --
>>>> Gromacs Users mailing list
>>>>
>>>> * Please search the archive at
>>>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
>>>> posting!
>>>>
>>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>>>
>>>> * For (un)subscribe requests visit
>>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
>>>> send a mail to gmx-users-request at gromacs.org.
>>>>
>> --
>> ==================================================
>>
>> Justin A. Lemkul, Ph.D.
>> Assistant Professor
>> Virginia Tech Department of Biochemistry
>>
>> 303 Engel Hall
>> 340 West Campus Dr.
>> Blacksburg, VA 24061
>>
>> jalemkul at vt.edu | (540) 231-3129
>> http://www.thelemkullab.com
>>
>> ==================================================
>>
>> --
>> Gromacs Users mailing list
>>
>> * Please search the archive at
>> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
>> posting!
>>
>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>
>> * For (un)subscribe requests visit
>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
>> send a mail to gmx-users-request at gromacs.org.

-- 
==================================================

Justin A. Lemkul, Ph.D.
Assistant Professor
Virginia Tech Department of Biochemistry

303 Engel Hall
340 West Campus Dr.
Blacksburg, VA 24061

jalemkul at vt.edu | (540) 231-3129
http://www.thelemkullab.com

==================================================



More information about the gromacs.org_gmx-users mailing list