# Re: [AMBER] Problem measuring angle in CPPTRAJ

From: Matthew Guberman-Pfeffer <matthew.guberman-pfeffer.uconn.edu>
Date: Tue, 2 Nov 2021 22:16:12 -0400

Thanks, Dan! You were right, the vector was pointing in the opposite direction to what I expected.

Best,
Matthew

> On Nov 1, 2021, at 10:05 AM, Daniel Roe <daniel.r.roe.gmail.com> wrote:
>
> *Message sent from a system outside of UConn.*
>
>
> Hi,
>
> Sorry for the delay in responding. I've been out with an illness for a while.
>
> One thing to keep in mind with 'corrplane' vectors is that there are
> *two* vectors that can be perpendicular to the plane passing through a
> group of atoms; they point in opposite directions. So I'm guessing
> what is happening here is that your 'corrplane' vector is pointing in
> the opposite direction, which is why you're getting an angle greater
> than 90 deg. One way to visualize this is to write out and view the
> vector pseudo-trajectory:
>
> vector V1 corrplane :1283&@CG1,ND11,CD21,NE21,CD11
> run
> # Write vector pseudo trajectory in mol2 format
> writedata vector.mol2 vectraj trajfmt mol2 V1
>
> You can correct for vectors that point the opposite way you expect by
> calculating 180-X for each value X that is greater than 90 degrees.
>
> Hope this helps,
>
> -Dan
>
> On Sat, Oct 30, 2021 at 4:14 PM Matthew Guberman-Pfeffer
> <matthew.guberman-pfeffer.uconn.edu> wrote:
>>
>> Dear Amber Community,
>>
>> I am using the below CPPTRAJ script to measure the angle between the planes of imidazole side chains coordinated to the iron center of heme groups. For the attached structure, I get angles within 1.5° of the reported values for five of the six hemes (residue IDs 1280, 1274, 1277, 1271, and 1268), but for the sixth one (res ID 1283), I get an angle that is ~100° instead of the reported ~79°. I measured the angle with a different program (Maestro of the Schrodinger Suite), and found the angle to be 79°. I am wondering if you can please help me understand why I am getting a wrong angle for the pair of imidazoles in resid 1283, but not resid 1280, 1274, etc.? Just so it is clear, the attached structure is the as-prepared-with-tleap CryoEM structure, with everything but the hemes of interest stripped off because of the limit on the size of postings to the list.
>>
>> parm OnlyHemes.pdb
>> trajin OnlyHemes.pdb
>>
>> vector His1 corrplane :1283&@CG1,ND11,CD21,NE21,CD11
>> vector His2 corrplane :1283&@CG2,ND12,CD22,NE22,CE12
>> run
>>
>> vectormath vec1 His1 vec2 His2 dotangle out HisHisAng1283test.dat name HisHisAng1283
>> run
>>
>>
>>
>>
>>
>> Best,
>> Matthew
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org