[Chimera-users] Surfaces and transparency

Esser, Lothar (NIH/NCI) [E] esserlo at mail.nih.gov
Tue Apr 28 10:23:05 PDT 2020


Hi, 
  Your example works of course. In my case the protein complex is intricate and several chains contribute to one surface. I just don't want to break it up. Looks like I have to use the work around with colordef using alpha channels. Just with 22 different color definitions that need to have their alpha channel changed per frame, it seems a bit tricky. 

Thanks, 
Lothar




-----Original Message-----
From: Elaine Meng <meng at cgl.ucsf.edu> 
Sent: Tuesday, April 28, 2020 11:28 AM
To: Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov>
Cc: chimera-users at cgl.ucsf.edu BB <chimera-users at cgl.ucsf.edu>
Subject: Re: [Chimera-users] Surfaces and transparency

Hi Lothar,
It is as expected because zone coloring is custom coloring by vertex.  If you use zone coloring you have to make the atom colors transparent first, as you said.

If you don't use zone coloring but simply specify colors by chains directly, the transparency will work, as in your example.  
> color col_chain_A #0:.A 
> Etc. 


I don't know what's going on when you can't recolor because it works for me both using the surface category as the specification, as in the first set of example commands below, or using different specifications, as in the second set of example commands below. I can color the chain and the surface as many times as I want, or even specify only the atoms, or ribbon, or surface:

open 1zik
surfcat cata :.a
surfcat catb :.b
surf cata
surf catb
trans 50,s
color green cata
color white,s cata
color red,r cata
...

It also works to recolor using an atomspec that is not the same as the surface category, e.g.

color orange :lys
color magenta,s :.a
color blue,s :1-5

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco


> On Apr 27, 2020, at 4:10 PM, Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov> wrote:
> 
> Hi, Elaine, 
> 
> Yes, this is trivial. But I rarely want a tan colored surface. 
> Surface #0
> Scolor #0 zone #0 range 3
> 
> Trans 50,s #0
> 
> Does not work for me. I tried to color a molecule with 6 chains by chain. I define a different color for each chain with colordef, color each chain (color mycolor #:.A etc.)  and followed by scolor #0 zone #0 range 3 
> That works to get the surface colored nicely. However I can't get it transparent easily. 
> 
> Your trick with surfcat is rather interesting in its process. 
> I can do 
> Open model.pdb  # it has six chains. 
> Then colordef six different colors
> And then
> Surcat mysurf #0
> Surface mysurf 
> 
> Which gives me a uniformly tan surface but the script goes on to 
> color col_chain_A #0:.A 
> Etc. 
> and interestingly the surface changes its color to reflect the chain color - exactly what I needed. 
> Trans 50,s mysurf
> makes it all nice and transparent. Great. (Even though I don't understand why it works *after* the surface was generated)
> But I can never change the color again. Say I think I was wrong with one color. I can change the model but I can't seem to get 
> color new_color_A #0:.A 
> to work. No automatic update. The chain of course changes color but not the surface. 
> Surface mysurf also does not update it. 
> However I can do 
> surfcat mysurf1 #0
> Surface mysurf1
> That works. 
> However all this is rather cumbersome - I am likely doing something unintended. 
> I wanted to animate a change in color of one chain but having a large number of surfcats new_nameX to do seems expensive. 
> 
> So while we are at it, surfaces with electrostatic potential or hydrophobicity or bfactors cannot be made transparent ? 
> 
> Thanks, 
> Lothar
> 
> 
> -----Original Message-----
> From: Elaine Meng <meng at cgl.ucsf.edu> 
> Sent: Monday, April 27, 2020 6:31 PM
> To: Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov>
> Cc: chimera-users at cgl.ucsf.edu BB <chimera-users at cgl.ucsf.edu>
> Subject: Re: [Chimera-users] Surfaces and transparency
> 
> Hi Lothar,
> I don't understand... or at least I'm not seeing the problem:
> 
> open 3nha
> surface
> trans 50,s 
> 
> (with or without #0, and "surface :adp" instead of "surface") all work fine for me.  All I can say is to check the Model Panel to make sure your surface is really #0.  If you have a reproducible series of commands where it doesn't work (and you are NOT using custom surface coloring by vertex), then you could report it using menu: Help... Report a Bug.
> 
> I hope this helps,
> Elaine
> -----
> Elaine C. Meng, Ph.D.                       
> UCSF Chimera(X) team
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> 
> 
>> On Apr 27, 2020, at 1:43 PM, Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov> wrote:
>> 
>> Hi, Elaine,
>> 
>> That's a neat trick. It only works with surfcat. 
>> 
>> If I do
>> 
>> surface #0
>> trans 50,s #0
>> No matter what I do the transparency does not change. 
>> 
>> But with
>> Surfcat mystuff
>> Surface mystuff
>> Trans 50,s
>> 
>> It works as advertised. Also, I noticed that in the first case with an ineffective "trans 50,s" on the command line, the menu Actions->Surface->Transparency->50% did work. 
>> It's only that I rarely use the menu .... partly because changes in transparency may be animated by a script. 
>> 
>> Thanks.
>> Lothar
>> 
>> -----Original Message-----
>> From: Elaine Meng <meng at cgl.ucsf.edu>
>> Sent: Monday, April 27, 2020 12:28 PM
>> To: Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov>
>> Cc: chimera-users at cgl.ucsf.edu BB <chimera-users at cgl.ucsf.edu>
>> Subject: Re: [Chimera-users] Surfaces and transparency
>> 
>> Hi Lothar,
>> It is not related to the VDW parameters, but to automatic classification of sets of atoms and excluding them from what is (by default) enclosed in a surface.  For example, people usually don't expect their ligands, solvent, or metal ions to be lumped together with the macromolecule, so there are automatically defined groupings:
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/surface.html#s
>> urfcats>
>> 
>> You can use "surfcat" to group the atoms any way you want, however.  
>> E.g. commands
>> 
>> surfcat mystuff :adp,mg
>> surface mystuff
>> 
>> The ion is shown as "sphere" (full VDW radius) and if colored separately may show "through" the surface unless you make it smaller, and surface is "chunky" unless you increase vertex density.
>> 
>> repr bs :mg
>> surface mystuff vertexDensity 10
>> 
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/msms.html>
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/representation.html#
>> surfaces>
>> 
>> The transparency command works fine for the molecular surface EXCEPT when the surface  has custom coloring by vertex (electrostatic potential, for example).  For custom coloring by vertex you would have to specify the transparency at the time of coloring.
>> 
>> For example, either of these works fine for the surface that I showed with the commands above, as it was just shown in the initial tan color:
>> 
>> trans 50,s
>> trans 50,s #0
>> 
>> However, you can color by atomic patch and have it retain its transparency, e.g. the following command applies heteroatom coloring to the atoms in mystuff (ADP, MG although they were already colored that way) as well as the corresponding atomic patches in the molecular surface:
>> 
>> color byhet mystuff
>> 
>> Or something like this  will also color both the atoms and the corresponding patches in the molecular surface while the surface retains transparency:
>> 
>> color orange :adp
>> 
>> I hope this helps,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.                       
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry University of California, San 
>> Francisco
>> 
>>> On Apr 26, 2020, at 11:20 AM, Esser, Lothar (NIH/NCI) [E] <esserlo at mail.nih.gov> wrote:
>>> 
>>> Hi,
>>> In making surfaces around ligands and making them transparent, I ran into some problems:
>>> 
>>> Using open/fetch 3NHA I have a molecule in front of me with ADP Mg bound.
>>> Creating a surface around ADP is easy but it won’t cover Mg at all. It seems that single ions like Mg and also single water molecules don’t get surfaces around them. Is this because of default vdW values that need to be manually adjusted ?
>>> 
>>> Let’s say I have a surface around ADP and want to make it 
>>> transparent, I thought
>>> 
>>> Transparency 50,s #0
>>> 
>>> Should work but it did not. There are some work arounds using transparent colors through the use of colordef.
>>> However, I had planned to color the surface by atom and used
>>>  scolor #0 zone #0   
>>> which worked but I could not get it transparent with transparency 
>>> statements. However, I can make atoms transparent then use
>>> 
>>> scolor #0 zone #0   #which makes the surface also transparent and hides the ball-and-stick model.
>>> To make it show up I can use transparency 0,a #0 and again the stick model appears under the transparent surface.
>>> 
>>> Is there a simpler way ? A way that can be applied to other surfaces that were for instance colored with say potential, hydrophobicity, bfactor key etc ?
>>> 
>>> Thanks
>>> Lothar




More information about the Chimera-users mailing list