[ Graphics learning | Nice image | Image rotation | Mol translation | Image annotation | Image | Color background example | Image center | Color by bfactor | Color by hydrophobicity | Color by accessibility | Color by charge ]
display, undisplay, color, center, delete, connect ;
nouns:
wire, cpk, ball, stick, xstick, surface, skin, ribbon, label, residue, atom ;
selections : e.g.
a_1. # the first object
a_1.1 # the first molecule
a_1.1/5:10 # residues from 5 to 10
a_1.1//ca,c,n # the backbone atoms
Sphere(a_1.1 a_2. 10.) # atoms around a_1.1 in a_2.
colors: white, black, blue, green, etc. (see file icm.clr ).
output image formats: png , tif (default) , targa, gif , rgb .
Now start from the command word and type what you need, and use controls to
rotate, translate, label, zoom, mark and color.
Example:
read pdb "1crn"
display ribbon
color ribbon a_/4:8 blue
display xstick a_1.1/10 green
center a_/6:12
display residue label a_/6:12
display string "Crambin" 36 red
write image rgb "crn" # use IRIX imgview to check the image
write image window=2*View(window) # hi-res picture
More advanced topics: connect , graphics objects .
- image display. Display your molecule or molecule the way you like.
Running the
nicemacro (e.g. nice "1est") is a good start. - start ICM with option -24 (see
options). Graphics will start blinking upon rotations, etc., but this is OK. - make sure that the
l_antiAliasvariable is set toyes(applies only to some platforms). - background. Change background color with
Ctrl-EandCtrl-Qto your liking. SetIMAGE.generateAlphatonois you want to preserve the background, rather than make it transparent. - fog. It is a great visual effect. Use it!
Switch on the depth-cueing effect, i.e. fog with
Ctrl-D(depth). Move the bright front clipping planes withCtrl-MidMBand move the back clipping plane closer with vertical movements withMidMBat the right margin of your graphics window (the mapping of the mouse controls to effects is defined by the icm.clr file). You may color the fog withcolor volumecolor command and modifyfogStartto increase or decrease the unfogged slice of the molecule. - grobs. Make them smooth with
select g_..and pressingCtrl-Xand unselecting with theEscbutton. To shine light from outside sometimes you need to saydisplay reverse. - quality of graphic elements. set
IMAGE.quality=12or15.This parameter determines the number of triangles in shapes like spheres and cylinders. The default value is only 5. because at routine interactive work you prefer speed to quality. - image resolution. Let us count pixels. Your screen window is usually about 600x600 pixels
which corresponds to 2x2inch picture at 300dpi resolution, or 1x1 inch at 600dpi. Therefore,
if you want to generate image at high resolution use two tricks:
- make your window as large as possible;
- use the write image command with option
window={ Xsize Ysize } and select a factor 2 or 3 to generate 2 or 3 times large image respecively, e.g.write image png window= 2 * View(window)
windowoption will not save the text labels. It is preferable to add text labels outside ICM anyway. - The picture is ready. Enjoy the attention.
center to this molecule and use the connect a_molselection
command to 'connect' your mouse
to just this molecule and leave everything else unchanged.
You will see that
E.g.
read pdb "2ins"
center a_b
connect a_b # use mouse LB to rotate and translate
To achieve the second goal from a script, learn about these elementary operations
Memorizing and resetting position of an ICM object
To memorize rotation and translation of an object or a group of molecules in an object, use the Value function and memorize the values of six positional variables for each molecule which have names
tvt1,avt1,bvt1,tvt2,avt2,tvt3 and can be selected as v_molecules//?vt* .
build string "AAA;GGG;WE-sep-RR" # (or read pdb and convertObject )
v1 = Value( v_1,2//?vt* )# MEMORIZE 6-var per molecule.
connect a_1,2 # move the connected 2 molecules around
set v_1,2//?vt* v1 # RESET the values
Translating the selected molecules
build string "AAA;GGG;WEGG"
translate a_1,2 add {0., 0., 1.}
for i=1,10
translate a_1,2 add i*{0.,0.,0.2} # incremental translation
endfor
Calculating translation vectors
Follow these steps:
- choose one representative atom (e.g. the first virtual atom
a_1//vt1 )) - memorize its coordinates using the
Xyzfunction (e.g.r1 = Xyz( a_1//vt1 )) - set you molecules to another position (e.g.
connect) - memorize the position again (e.g.
r2 = Xyz( a_1//vt1 )) - calculate the difference:
vtr = Rarray( r2 - r1 ). TheRarrayfunction will convert a 3x1 matrix to a 3-dim. vector
build string "AAA;GGG;WEGG"
for i=1,10
translate a_1 0.1*i*vtr
endfor
Rotating selected molecules around specified axes.
First one needs to do the following:
- find the rotation axis with the
Rmsdfunction (described in asectionbelow ) - find the rotation matrix with the Rot(R_center,R_axis,r_angle) function.
- apply the
rotatecommand.
Making grob gradually disappear in the backround
One needs to use
Color (grob) function.
See examples in the description of the color grob command.
BACKSPACE key when the cursor is in the graphics
window (see
keyboard and mouse controls
).
imgview, convert it to
the PostScript format and print it. You may also save image directly in PostScript format,
either as a bitmap snapshot or as a vectorized high-quality model of linear, triangular and
string primitives, as they are rendered on your display. See
write image
and
write postscript
for details.
color background white # or
color background black # or
color background aquamarine
Note that numeric values may also be used, for example:
display string "background\ncolor test" 0.4, 0.9
ncolor = 127
for icolor = 1, ncolor, 1
color background icolor
display string "color number " + String (icolor)
delete label 2
endfor
delete label
display string "the end"
color background black
See also icm.clr file, set color .
See also Image , make image , set background image.
center
command.
color can use any real array
as a set of individual color numerical specifications. The smallest
number corresponds to the red color, the largest number to the blue
one. Function Bfactor( as_ ) returns the real array of B-values for each selected atom.
Examples:
read pdb "1crn"
color a_1crn.//* Bfactor(a_1crn.//*)
read object "4pti"
display a_//!h* white
display surface a_1.1 a_1.1
s_method = "surface" # s_method = "xstick" or "cpk" is also possible
# hydrophobic
color $s_method yellow a_/ala,val,phe,ile,leu,pro,met/!c,n,o,hn
# polar
color $s_method pink a_/ser,thr,tyr,cys,asn,gln,his,trp,gly
# charged (+)
color $s_method blue a_/lys,arg/nz,hz*,nh*,hh*
# charged (-)
color $s_method red a_/asp,glu/oe*,od*
display string yellow "hydrophobic: yellow" 25, -0.9, 0.9
display string pink "polar: pink" 25, -0.9, 0.6
display string blue "charged(-)" 25, -0.9, 0.8
display string red "charged(+)" 25, -0.9, 0.7
See also
How to color atoms according to their charges.
Area is required.
Example:
read object "crn"
show surface area # calculate the surface energy contribution
# (hence, the accessibilities are also calculated)
assign sstructure a_/* "_"
# remove current secondary structure assignment
# for "tube" representation
display ribbon
# calculate smoothed relative accessibilities
# and color the tube according
# to the accessibilities of the residues
color ribbon a_/* Smooth(Area(a_/*)/Area(a_/* type) 5)
# plot residue accessibility profile
plot Count(1 Nof(a_/*)) Smooth(Area(a_/*)/Area(a_/* type) 5) display
Charge .
For example:
read object "crn"
display surface
color a_//* Charge(a_//*)
Another example is selected residues coloring:
display a_*./asp,glu/o?* cpk red
display a_*./lys,arg/nz,n?* cpk blue