# Re: [NAMD] Using as collective variable the minimum of a set of distances

From: Giacomo Fiorin (giacomo.fiorin_at_gmail.com)
Date: Mon Jan 30 2017 - 17:07:07 CST

Hi Sebastian, as Jérôme suggested there is no current C++ implementation of
what you are trying to do. However, you can always add a Tcl function to
be applied over one of the existing colvar components, or of a set of them.

Take a look at the doc links that you already have, plus the following
example:
https://github.com/colvars/colvars/blob/master/examples/10_pathCV.namd

Giacomo

On Mon, Jan 30, 2017 at 5:53 PM, The Cromicus Productions <
thecromicusproductions_at_gmail.com> wrote:

> have
> a DNA molecule formed by two strands, each one with 100 atoms. These atoms
> can be considered as groups of 10, so I have in each strand 10 groups of
> 10 atoms,
> let's call these groups {A1,A2,... A10} and {B1, B2,... B10}.
> I want to study the minimum distance between adjacent groups: {A1,B1},
> {A2,B2}, ... and {A10, B10}.
> I cannot use the average of these distances because that can make {A1,B1}
> be constant
> and I want the two strands to separate perfectly, without getting glued in
> any position.
> That's why I want to do min{d(A1,B1),d(A2,B2),...,d(A10,B10)}.
> I guess that makes distanceInv not an option, right? Can I do this using
> scripted functions?
>
>
>
>
> On Sun, Jan 29, 2017 at 11:25 AM, Jérôme Hénin <jerome.henin_at_ibpc.fr>
> wrote:
>
>> Hi Sebastian,
>>
>> You could use distanceInv to define the minimum distance between the
>> groups (12 3 4) and (5 6 7 8). If that does not work for you, you can write
>> a similar average using a scripted function of distance components. That
>> is, define a colvar having as components d(1,5), d(2,6), d(3,7) and d(4,8),
>> and a Tcl scripted variable (http://colvars.github.io/colv
>> ars-refman-namd/colvars-refman-namd.html#x1-530005.5) implementing this
>> expression :
>> http://colvars.github.io/colvars-refman-namd/colvars-refman-
>> namd.html#x1-250005.1.6
>> and its derivatives.
>>
>> Best,
>> Jerome
>>
>> On 29 January 2017 at 00:07, The Cromicus Productions <
>> thecromicusproductions_at_gmail.com> wrote:
>>
>>> Hi everyone,
>>>
>>> I'm interested in studying the separation of two strands of DNA
>>> and to do this I want to define as collective variable
>>> the minimum of the distances between the strands. That is,
>>> if the DNA is
>>> 1 2 3 4
>>> 5 6 7 8
>>> I want to define my variable as the minimum of d(1,5), d(2,6), d(3,7)
>>> and d(4,8).
>>> Any idea if this is possible and how to do it?
>>> I tried before to work with the center of mass but I don't know why
>>> the tips of the molecule don't separate from each other.
>>>
>>> Thanks a lot!
>>>
>>> Sebastian
>>>
>>
>>
>

This archive was generated by hypermail 2.1.6 : Sun Dec 31 2017 - 23:21:02 CST