# Re: [AMBER] Vector math: a couple of questions

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Wed, 4 Oct 2017 12:54:11 -0400

On Wed, Oct 4, 2017 at 12:43 PM, George Tzotzos <gtzotzos.me.com> wrote:
> If I want to calculate angle deviations from a specific reference structure can I set up the reference first e.g.
>
> reference X-ray.pdb parm X-ray.pdb [A]
>
> and then use
>
> vectormath reference [A] vec1 VA vec2 VB out vec.dat dotangle

Not exactly. What you would first do is calculate the vector from the
reference using 'crdaction' (since a reference is just really a COORDS
data set):

reference ref.pdb [A]
crdaction [A] vector VA <vector keywords>

Then you can calculate your vector from whatever trajectory:

trajin mytraj.nc
vector VB <vector keywords>
vectormath vec1 VA vec2 VB <vectormath keywords>

Hope this helps,

-Dan

>
> Many thanks for your help
>
> George
>
>> On 4 Oct 2017, at 18:30, Daniel Roe <daniel.r.roe.gmail.com> wrote:
>>
>> Hi,
>>
>> On Tue, Oct 3, 2017 at 2:42 PM, George Tzotzos <gtzotzos.me.com <mailto:gtzotzos.me.com>> wrote:
>>> vectormath vec1 v1 vec2 v2 dotangle out dotproduct.dat name acos(|V1|*|V2|)
>>>
>>> Where v1 and v2 are masks of the type :res_start-res_end
>>
>> The 'vec1' and 'vec2' keywords are for specifying previously
>> calculated or read in vector data sets. So you could for example
>> create the vector data beforehand with the 'vector' command:
>>
>> vector VA :1 :10
>> vector VB :11 :20
>> vectormath vec1 VA vec2 VB out vec.dat dotangle
>>
>> Hope this helps,
>>
>> -Dan
>>
>> PS - Out of curiosity, where does it say that v1 and v2 should be
>> masks? That's incorrect and I need to fix it.
>>
>>>
>>> I’d like to use the corresponding vectors of an X-ray structure as a reference doing something. I’ve tried various permutations using something like
>>>
>>> parm solv.prmtop
>>> parm X-ray.pdb
>>> trajin traj.nc
>>> reference X-ray.pdb parm X-ray.pdb [A]
>>>
>>> and then vectormath to no avail.
>>>
>>> I’d be grateful for any suggestions
>>>
>>> George
>>>
>>>
>>> _______________________________________________
>>> AMBER mailing list
>>> AMBER.ambermd.org
>>> http://lists.ambermd.org/mailman/listinfo/amber
>>
>>
>>
>> --
>> -------------------------
>> Daniel R. Roe
>> Laboratory of Computational Biology
>> National Institutes of Health, NHLBI
>> 5635 Fishers Ln, Rm T900
>> Rockville MD, 20852
>> https://www.lobos.nih.gov/lcb <https://www.lobos.nih.gov/lcb>
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org <mailto:AMBER.ambermd.org>
>> http://lists.ambermd.org/mailman/listinfo/amber <http://lists.ambermd.org/mailman/listinfo/amber>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber

```--
-------------------------
Daniel R. Roe
Laboratory of Computational Biology
National Institutes of Health, NHLBI
5635 Fishers Ln, Rm T900
Rockville MD, 20852
https://www.lobos.nih.gov/lcb
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
```
Received on Wed Oct 04 2017 - 10:00:05 PDT
Custom Search