[chimerax-users] 2D Residue Plot

Tom Goddard goddard at sonic.net
Fri Mar 11 14:15:24 PST 2022


Hi Fiona, Avi,

  I wrote the ChimeraX interface plotting code.  It tries to show you a view perpendicular to the plane of the interface.  A look at the Python code reveals that it determines the view direction so that it looks from the average position (centroid) of all the interface residue atoms on one chain to the average position of all the interface residue atoms on the other chain.  Of course the interface is often not planar, but this is the heuristic it uses.  As you found that does not specify the rotation about the view direction and in your case the two similar structures are getting a different rotation.

  So how does the code determine that rotation?  It starts with the view direction I just described call it v, then it determines two perpendicular axes one being a1 = cross_product(v, y) and one being a2 = cross_product(a1, v).  Here y means the y-axis of the ChimeraX scene coordinates.  If the view direction is approximately the same for the interfaces of your two structures then I would expect the rotations to also be nearly the same, unless by bad luck that view direction is close to the scene (ie molecule) y-axis in which case a small variation in view direction would lead to a big variation in rotation.

  There is no option to tweak the rotation.  But based on the above a trick might get you better rotational alignment.  If your structures are models #1 and #2 in ChimeraX and they are aligned, then rotate both of them to a new orientation and try to show the interfaces again.  To rotate them, use the turn command, for example to rotate about the screen z by 45 degrees,

		turn z 45 model #1,2

This is different from a mouse rotation.  Mouse rotation just moves the ChimeraX camera.  This turn command actually changes the scene coordinate positions of the atoms.  This will make interface view direction different relative to the scene “y” axis in the above interface orientation calculation and you will get a different rotation in the plot.

  Give it a try.  If some different rotations don’t make the interface plots match then I would suspect that the view direction for the interfaces for your two structures are actually quite different and that is what is causing the different rotations.  In that case I can probably show you some Python code  to rotate one of them manually.  The code that determines the rotation is in the layout_projection() method in this file in Mac ChimeraX

	ChimeraX.app/Contents/lib/python3.9/site-packages/chimerax/interfaces/resplot.py
 
    def layout_projection(self):
        c = self.contact
        r1, r2 = (self.residues1, self.residues2)
        xyz1, xyz2 = [r.atoms.scene_coords.mean(axis = 0) for r in (r1,r2)]
        zaxis = xyz2 - xyz1
        center = 0.5 * (xyz1 + xyz2)
        from chimerax.geometry import orthonormal_frame
        f = orthonormal_frame(zaxis, origin = center)
        finv = f.inverse()
        return finv

We’d have to add a rotation into the returned transform to monkey with it manually.

	Tom


> On Mar 11, 2022, at 1:17 PM, Fiona Aguilar via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
> 
> Hi Elaine, 
> 
> Thank you again for your response! Would it be possible to put us in touch with the programmer to see if there is any chance this could be modified somehow? 
> 
> Thank you, 
> Fiona Aguilar
> 
> On 3/11/22, 4:13 PM, "Elaine Meng" <meng at cgl.ucsf.edu> wrote:
> 
>    Oh, now I see that choosing the residue plot option changes the orientation of the 3D model (to best spread out the interface residues in the XY plane, I'm guessing), and then slices in 2D to give the plot.  I was checking whether the 3D matched the 2D, which it does at that point, without realizing the 3D view had been reoriented automatically.
> 
>    Maybe the programmer who created the tool can comment further, but I suspect you are right that each interface is positioned with some algorithm to spread out its residues, and if the interfaces of  superimposed complexes are somewhat different, the diagram orientations may also be visibly different. 
> 
>    Sorry for the inconvenience,
>    Elaine
>    -----
>    Elaine C. Meng, Ph.D.                       
>    UCSF Chimera(X) team
>    Department of Pharmaceutical Chemistry
>    University of California, San Francisco
> 
> 
>> On Mar 11, 2022, at 12:55 PM, Avinoam Aryeh Singer via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>> 
>> Hi Elaine,
>> 
>> I appreciate the quick response. I think that the orientation of the 2D slice is invariant, since rotating the 3D model produces the same 2D plot. The proteins are nearly identical, but slice depth is an interesting aspect that I hadn't considered. I was mostly wondering whether there's an option that gives me more control over the 2D plot, but I'm sensing that there is not.
>> 
>> Best,
>> Avi​
>> From: Elaine Meng <meng at cgl.ucsf.edu>
>> Sent: Friday, March 11, 2022 3:40 PM
>> To: Avinoam Aryeh Singer
>> Cc: chimerax-users at cgl.ucsf.edu; Fiona Aguilar
>> Subject: Re: [chimerax-users] 2D Residue Plot
>> 
>> Hi Avi,
>> As I understand it, the orientation is exactly a 2D slice of the current position and thus, superimposed complexes should be shown in the comparable positions.  Could it be that it is just difficult to tell because of the slightly different shapes of your proteins at the slice position? It is possible that the slice is taken at slightly different depths if the set of interface residues is a little different.
>> 
>> I could not reproduce the problem.  I tested by opening two similar complexes, superimposing them, using the "interfaces" command on each to get a chain diagram, and then using the edge context menu of the chain diagram to get the residue plots, see attached.  However, probably my two complexes are more similar to each other than your two complexes.
>> 
>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/interfaces.html>
>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/interfaces.html#residue-plot>
>> 
>> I hope this helps,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.                       
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry
>> University of California, San Francisco
>> 
>> 
>> <Screen Shot 2022-03-11 at 12.33.45 PM.png>
>> 
>> 
>>> On Mar 11, 2022, at 11:43 AM, Avinoam Aryeh Singer via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>>> 
>>> Hey there,
>>> 
>>> I was wondering whether there was a way to control the angle of the 2D residue plot generated from the "Interfaces" tool, such that creating plots from two aligned proteins will give me comparable plots. As you can see in the image below, the two structures are slightly rotated relative to one another, despite being aligned. 
>>> 
>>> Thanks!
>>> 
>>> Avi Singer
>>> 
>>> ​<pastedImage.png>
>>> 
>> 
>> _______________________________________________
>> ChimeraX-users mailing list
>> ChimeraX-users at cgl.ucsf.edu
>> Manage subscription:
>> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
> 
> 
> 
> 
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
> 




More information about the ChimeraX-users mailing list