Endonuclease PvuII (1PVI) DNA - GATTACAGATTACA
CAP - Catabolite gene Activating Protein (1BER)
DNA - GATTACAGATTACAGATTACA Endonuclease PvuII bound to palindromic DNA recognition site CAGCTG (1PVI) DNA - GATTACAGATTACAGATTACA TBP - TATA box Binding Protein (1C9B)
CAP - Catabolite gene Activating Protein (1BER)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
TBP - TATA box Binding Protein (1C9B)
 

° 

Color<Atom|Res|Mol|Obj|All>

-

Set/get atom colors


CommandArgument DatatypeDefaultMinMax
Format 1:Color<Atom|Res|Mol|Obj|All> Selection, SELECTION- - -
   first = first color,BOWCOLOR - --
  second = second color, BOWCOLORfirst--
  Segments = Yes | NoSTRING No --
Format 2: Color<Atom|Res|Mol|Obj|All> Selection, SELECTION- - -
   fromFile, STRING---
  filename = Color filenameSTRING - --
Python:Color<Atom|Res|Mol|Obj|All>(selection1,first,second,segments)
resultlist = Color<Atom|Res|Mol|Obj|All>(selection1)
Color<Atom|Res|Mol|Obj|All>2(selection1,noname2,filename)
resultlist = Color<Atom|Res|Mol|Obj|All>2(selection1)
Menu: View > Color
Related:ColorPar, ColorBG , ColorHBo
Required:


The Color command gets or sets the color of the selected atoms, using a single color, a color gradient or colors read from a file.

It is also possible to color proteins by a large number of properties , from sequence conservation to packing quality via the PDBFinderII plugin accessible at Analyze > PDBFinderII properties.

Colors are specified using either their name or their number in the rainbow circle, where 0 is blue, 60 is magenta, 120 is red, 180 is yellow, 240 is green, 300 is cyan and 360 is again blue.

Secondary structure elements get their default colors as long as the Calpha atom also has its default color, otherwise they inherit the color of the Calpha atom. As the default color of the Calpha carbon is normally cyan, this approach would not allow to create a cyan ribbon. YASARA therefore checks if all backbone atoms in the residue have the same color. If this is the case, the ribbon always inherits the Calpha color, even if it's cyan. So to create a cyan ribbon, make sure that all backbone atoms are colored cyan. There is currently no direct way to avoid that the secondary structure elements adopt the color of the Calpha, but you can of course duplicate the object, showing atoms of the first object, and secondary structure of the second object.

When two colors are specified to create a gradient, the color numbers are linearly interpolated. E.g. ColorRes all,magenta,green will create a gradient from magenta (60) over red (120) and yellow (180) to green (240). If you want to go in the other direction, make use of the fact that adding 360 color degrees gives the same color: ColorRes all, 420,green will create a gradient from magenta (60+360) over blue (0+360) and cyan (300) to green (240).

If you absolutely need colors that are not in the rainbow circle, there are three options:

  • Use the 'gray circle' by adding 1000 to the normal color. Instead of blending to the next color in the standard circle, you get a blending to gray. 1000 is blue, 1030 is blue-gray, 1059 is gray, then it steps immediately to the next color in the circle: 1060 is magenta, 1090 is magenta-gray, 1119 is gray, 1120 is red, 1150 is red-gray, 1180 is yellow, 1240 is green and 1300 is cyan.

  • Specify an RGB color directly (e.g. e0ff80 or Black). YASARA's graphics engine uses texture mapping to draw atoms, and OpenGL does not permit to display every color this way, especially dark colors are problematic, for example black does not exist at all. When you request an RGB color, YASARA will pick the closest color it can display, which can occasionally be quite different. That is the price to pay for the 30x speedup of YASARA's graphics engine compared to the normal OpenGL performance.

  • If you need a certain color only in the ray-traced output, you can set it manually in the PovRay scene description: Choose a rather unique color for your atoms on screen (e.g. magenta), disable ambient lighting, save the PovRay file, open the PovRay file in a text editor, search for rgb<1.000,0.000,1.000> (the RGB color code of magenta) and replace it with the desired color. Then all atoms that are magenta on screen will have the desired color in the ray-traced image.

When coloring by B-factor or occupancy, you can customize the gradient colors using the ColorPar command. By default, a B-factor of 0 corresponds to blue (cool, frozen) and 70 to yellow (hot, flexible). An occupancy of 100% maps to blue (normal, not interesting) and 0% to yellow (missing atoms).

Coloring by property value is especially useful in the Twinset, where the results of checks are stored as atomic properties and can thus easily be mapped onto the structure.

When creating a ray-traced figure, you may want to draw attention away from the protein and focus on something else, e.g. a bound ligand. YASARA does not support darkened colors, as atoms get darker in the background anyway and it would be very confusing to have dark atoms in the front as well. Instead, show the protein's secondary structure and make it transparent in the ray-traced image by choosing a SecAlpha value around 20.

If you use 'fromFile', you must specify a color file. There is no special file format required, you can give one color per line or separate them with spaces. Just make sure that the file contains enough colors for all units you select. More details about color gradients can be found in the Essentials section.

Example 1:
ColorObj 1crn,red

Color object 1crn red.


Example 2:
ColorRes Cys,yellow

Color all cysteines yellow.


Example 3:
ColorRes Obj 1crn,red,blue

Color the residues in object 1crn with a gradient, starting with red and going to blue. Each residue gets a unique color.


Example 4:
ColorMol Obj GroEL,blue,cyan

Color the molecules in object GroEL with a gradient, starting with blue and going to cyan. Each molecule gets a unique color.


Example 5:
ColorObj 1crn,Element

Color all atoms in object 1crn by their chemical element.


Example 6:
ColorObj 5,ResType

Color all atoms in object 5 by residue type.


Example 7:
ColorObj 6,Charge

Color all atoms in object 6 by their charge.


Example 8:
ColorObj 7,Occupancy

Color all atoms in object 6 by their occupancy.


Example 9:
ColorRes SecStr Helix,red,blue,Segments=Yes

Color all residues inside a helix with a gradient, starting with red and going to blue. Colors change only at segment boundaries (=non-selected residues, in this case between helices), so that the first helix will be completely red and the last one completely blue.


Example 10:
ColorRes all,fromFile,MyColors

Color all residues, reading one color per residue from file MyColors.col or dat/MyColors.col.


Example 11:
ColorAtom Mol A,fromFile,MyColors

Color all atoms in molecule A, reading one color per atom from file MyColors.col or dat/MyColors.col.


Example 12:
col = ColorAtom 1746

Assign color of atom 1746 to variable 'col'.


Example 13:
col = ColorObj 1crn

Assign average color of object 1crn to variable 'col'.



Example macro 1:

# EXAMPLE Color Residue
Clear
LoadPDB 1c9b
Style Ribbon,Stick
ColorRes All,ResType

Figure: Result of the example macro 1 above.



Example macro 2:

# EXAMPLE Color Atom
Clear
LoadPDB 1crn
ColorAtom All,Blue,Cyan
Style Ribbon
PosObj 1crn,Z=20

Figure: Result of the example macro 2 above.