Copyright © 2005, Molsoft LLC Nov 24 2008
|
[ Abs | Acc | Acos | Acosh | Align | Angle | Area | Asin | Asinh | Ask | Askg | Atan | Atan2 | Atanh | Atom | Augment | Axis | Bfactor | Boltzmann | Box | Bracket | Cad | Ceil | Cell | Charge | Chemical | Cluster | Color | Consensus | Corr | Cos | Cosh | Count | Date | Deletion | Det | Disgeo | Distance | Eigen | Energy | Error | Error soap | Exist | Existenv | Extension | Exp | Field | File | Find | Floor | Formula | Getarg | Getenv | Gradient | Grob | Group | Header | Histogram | Iarray | IcmSequence | Image | Index | Indexx | Insertion | Info | Info image | Integer | Integral | Interrupt | Label | Length | LinearFit | LinearModel | Link | Log | Map | Mass | Moment | Match | Matrix | Max | MaxHKL | Mean | Min | Money | Mod | Mol | Name | Namex | Next | Nof | Norm | Normalize | NotInList | Obj | Occupancy | Path | Parray | Pattern | Pi | Potential | Power | Predict | Probability | Profile | Property | Putarg | Putenv | Radius | Random | Rarray | Real | Remainder | Reference | Replace | Res | Resali | Resolution | Rfactor | Rfree | Rmsd | Rot | Sarray | Score | Select | Sequence | Shuffle | Sign | Sin | Sinh | Site | Slide | Smiles | Smooth | Sql | Sqrt | Sphere | SoapMessage | Sort | Split | Srmsd | String | Sstructure | Sum | Symgroup | Table | Tan | Tanh | Tensor | Temperature | Time | Tointeger | Tolower | Toreal | Torsion | Tostring | Toupper | Tr123 | Tr321 | Trace | Trans | Transform | Transpose | Trim | Trim sequence | Turn | Type | Unique | Unix | Value | Value soap | Vector | Version | Volume | View | Warning | Xyz ] ICM-shell functions are an important part of the ICM-shell environment. They have the following general format: FunctionName ( arg1, arg2, ... ) and return an ICM-shell object of one of the following types: integer, real, string, logical, iarray, rarray, sarray, matrix, sequence, profile, alignments, maps, graphics objects, a.k.a. grob and selections.The order of the function arguments is fixed in contrast to that of commands. The same function may perform different operations and return ICM-shell constants of different type depending on the arguments types and order. ICM-shell objects returned by functions have no names, they may be parts of algebraic expressions and should be formally considered as 'constants'. Individual 'constants' or expressions can be assigned to a named variable. Function names always start with a capital letter. Example: show Mean(Random(1.,3.,10))
absolute value function. Abs ( real ) - returns real absolute value. Abs ( integer ) - returns integer absolute value. Abs ( rarray ) - returns rarray of absolute values. Abs ( iarray ) - returns iarray of absolute values.
Abs ( map )
- returns map of absolute values of the source map.
a=Abs(-5.) # a=5.
print Abs({-2.,0.1,-3.}) # prints rarray {2., 0.1, 3.}
if (Abs({-3, 1}=={3 1}) print "ok"
accessibility selection function. It returns residues or atoms with relative solvent accessible area greater than certain threshold. Important: The surface area must be calculated before this function call. The Acc function just uses surface values, it does not reevaluate them. Therefore, make sure that the show area command (or show energy, minimize , etc. with the "sf" surface term turned on), has been executed before you use the Acc function. If you specify the threshold explicitly, it must range from 0.0 to 1.0, otherwise it is set to 0.25 for residue selections and 0.1 for atom selections. Acc ( rs_ , [ r_Threshold ] ) - returns residue selection, containing a subset of specified residues `rs_ for which the ratio of their current accessible surface to the standard exposed surface is greater than the specified or default threshold (0.25 by default). ICM stores the table of standard residue accessibilities in an unfolded state calculated in the extended Gly-X-Gly dipeptide for all amino acid residue types. It can be displayed by the show residue type command, or by calling function Area( s_residueName ), and the numbers may be modified in the icm.res file. The actual solvent accessible surface, calculated by a fast dot-surface algorithm, is divided by the standard one and the residue gets selected if it is greater than the specified or default threshold. ( r_Threshold parameter is 0.25 by default). Acc ( as_select, [ r_Threshold ] ) - returns atom selection, containing atoms with accessible surface divided by the total surface of the atomic sphere in a standard covalent environment greater than the specified or default threshold (0.1). Accessibility at this level does not make as much sense as at the residue level. The standard surface of the atom was determined for standard amino-acid residues. Note that hydrogens were NOT considered in this calculation. Therefore, to assign surface areas to the atoms use show surface area a_//!h* a_//!h* command or the show energy "sf" command. You may later propagate the accessible atomic layer by applying Sphere( as_ , 1.1), where 1.1 is larger than a typical X-H distance but smaller than the distance between two heavy atoms. (the optimal r_Threshold at the atomic level used as the default is 0.1, note that it is different from the previous ). Examples:
# let us select interface residues
read object s_icmhome+"complex"
# display all surface residues
show surface area
display Acc( a_/* )
# now let us show the interface residues
display a_1,2
color a_1 yellow
color a_2 blue
show surface area a_1 a_1 # calculate surface of
# the first molecule only
# select interface residues
# of the first molecule
color red Sphere(a_2/* a_1/* 4.) & Acc(a_1/*)
read object "crn"
show energy "sf"
display
display cpk Acc(a_//* 0.1) # display accessible atoms
show surface area # prior to invoking Acc function
# surface area should be calculated
color Acc(a_/*) red # color residues with relative
# accessibility > 25% red
arccosine trigonometric function Returns angles in degrees. Acos ( real | integer ) - returns the real arccosine of its real or integer argument. Acos ( rarray ) - returns the rarray of arccosines of rarray elements. Examples:
print Acos(1.) # equal to 0.
print Acos(1) # the same
print Acos({-1., 0., 1.}) # returns {180. 90. 0.}
inverse hyperbolic cosine function. Acosh ( real | integer ) - returns the real inverse hyperbolic cosine of its real or integer argument. Acosh ( rarray ) - returns the rarray of inverse hyperbolic cosines of rarray elements. Examples:
print Acosh(1.) # returns 0
print Acosh(1) # the same
print Acosh({1., 10., 100.}) # returns {0., 2.993223, 5.298292}
[ sequence | structural alignment | sub_alignments ] family of the alignment functions. These function return an alignment icm-shell object and perform
Align ( [ sequence1, sequence2 ] [ area ] [ M_scores ] ) - returns ZEGA- alignment. If no arguments are given, the function aligns the first two sequences in the sequence list. For sequence alignments, the ZEGA-statistics of structural significance ( Abagyan, Batalov, 1997) is given and can be additionally evaluated with the Probability function. The reported pP value is -Log(Probability,10). Returned variables:
Simple pairwise sequence alignment Align( ) Align( seq1 seq2 ) - returns an alignment. The alignMethod preference allows you to perform two types of pairwise sequence alignments: "ZEGA" and "H-align". If you skip the arguments, the first two sequence are aligned. Example: read sequences s_icmhome+"sh3.seq" # read 3 sequences print Align(Fyn,Spec) # align two of them Align( ) # the first two a=Align( sequence[1] sequence[3] ) # 1st and 3rd if(r_out > 5.) print "Sequences are struct. related" Aligning with custom residue weights or weights according to surface accessible area Align( seq1 seq2 area ) Option area will use relative residue accessibilities to weight the residue-residue substitution values in the course of the alignment (see also accFunction ). The weights must be positive and less than 2.37 . Try to be around or less than 1. since relative accessibilities are always in [0.,1.] range. Values larger than 2.37 do not work well anyway with the existing alignment matrices and gap parameters. Use the Trim function to adjust the values, e.g. Trim( myweights , 0.1,2.3 ) ). E.g. read pdb "1lbd" show surface area make sequence Info> sequence 1lbd_m extracted 1lbd_m # see the relative areas read pdb sequence "1fm6.a/" # does not have areas Info> 1 sequence 1fm6_a read from /data/pdb/fm/pdb1fm6.ent.Z ali3d = Align( 1lbd_m 1fm6_a area )This can also be used to assign custom weights with the following commands set area seq1 R_weights # must be > 0. and less than 2.37 Align( seq1 seq2 area ) Introducing positional restraints into the alignment matrix Align( seq1 seq2 M_positionalScores ) If sequence similarity is in the "twilight zone" and the alignment is not obvious, the regular comp_matrix{residue substitution matrix} is not sufficient to produce a correct alignment and additional help is needed. This help may come in a form of the positional information, e.g. histidine 55 in the first sequence must align with histidine 36 in the second sequence, or the predicted alpha-helix in the first sequence preferably aligns with alpha-helix in the second one. In this case you can prepare a matrix of extra scores for each pair of positions in two sequences, e.g.
seq1 = Sequence("WEARSLTTGETGYIPSA")
seq2 = Sequence("WKVEVNDRQGFVPAAY")
Align()
# Consensus W.#. .~~.~G%#P^
The alignSS macro shows a more elaborate example in which extra scores are prepared to encourage alignments of the same secondary structure elements. Warning. The alignment procedure is rather subtle and may be sensitive to the gap parameters and the comparison matrix. Avoid matrix values comparable with gap opening penalty.
See also: Probability( ali .. ) for local alignment reliability.
Two types of structural alignments or mixed sequence/structural alignments
can be performed with the Align function.
See also: align ms1 ms2 function
Deriving an alignment from tethers between two 3D objects
build string "se ala his leu gly trp ala" "a" # obj. a build string "se his val gly trp gly ala" "b" # obj. b set tether a_2./1:3 a_1./2:4 align # impose tethers show Align(a_2.1) # derive alignment from tethers write Align(a_2.1) "aa" # save it to a file
Align ( ali_, seq_1, seq_2 ) - returns a pairwise sub- alignment of the input alignment ali_, reorders of sequences in the alignment according to the order of arguments. Extracting a multiple alignment of a subset of sequences from a multiple alignment Align ( ali_, I_seqNumbers ) - returns a reordered and/or partial alignment . Sequences are taken in the order specified in I_seqNumbers. Examples:
# 14 sequences
read alignment msf s_icmhome + "azurins"
# extract a pairwise alignment by names
aa = Align(azurins,Azu2_Metj,Azur_Alcde)
# reordered sub-alignment extracted by numbers
bb = Align(azurins,{2 5 3 4 10 11 12})
Resorting alignment in the order of sequence input with the Align ( ali_, I_seqNumbers ) function. Load the following macro and apply it to your alignment. Example:
macro reorderAlignmentSeq( ali_ )
nn=Name(ali_) # names in the alignment order
ii=Iarray(Nof(nn))
j=0
for i=1,Nof(sequence) # the original order
ipos = Index( nn, Name(sequence[i] ) )
if ipos >0 then
j=j+1
ii[j] = ipos
endif
endfor
ali_new = Align( ali_ ii )
keep ali_new
endmacro
calculates planar angle in degrees. Returns real value. Angle ( as_atom ) - returns the planar angle defined by the specified atom and two previous atoms in the ICM-tree. For example, Angle(a_/5/c) is defined by C-Ca-N atoms of the 5-th residue. You may type: print Angle( # and then click the atom of interest. Angle ( as_atom1 , as_atom2 , as_atom3 ) - returns the planar angle defined by three atoms. Angle ( R_3point1 , R_3point2 , R_3point3 ) - returns the planar angle defined by the three points. Angle ( R_vector1 , R_vector2 ) - returns the planar angle between the two vectors. Examples: d=Angle( a_/4/c ) # d equals N-Ca-C angle print Angle( a_/4/ca a_/5/ca a_/6/ca ) # virtual Ca-Ca-Ca planar angle The rotation angle corresponding to a transformation vector is returned as r_out by the Axis( R_12 ) function.
calculates surface area. A quick guide: Area( grob ) ⇒ r Area( as_ | rs_ ) ⇒ R_atomAreas|R_resAreas # needs surface calculation beforehand Area( rs_ type ) ⇒ R_maxAreas_in_GLY_X_GLY Area( as_ R_typeEyPerArea energy ) ⇒ R_atomEnergies Area( seq ) ⇒ R_relAreasPerResidue Area( s_icmResType ) ⇒ r Area( rs_ rs_2 ) ⇒ M_contactAreas
Note that if an atom selection is provided as an argument the surface area needs to be computed beforehand with the show area or show energy "sf" command. The detailed description can be found below:
With option energy returns the product of the individual atomic accessibilities by the atomic surface energy density. The values of the density depend on the surfaceMethod preference and are stored in the icm.hdt file. The "contant tension" value of the preference is a trivial case in which all areas are multiplied by the surfaceTension parameter. For the "atomic solvation" and "apolar" styles, the densities depend on atom types. Normally the atomic solvation densities are taken from the icm.hdt file where the density values are listed for each hydration atom type for "atomic solvation" and "apolar" styles. However, you can provide your own array of n values R_userSolvationDensities with the number of elements less or equal to the number of types to overwrite the first n types. Examples:
set area a_//* 0.
surfaceMethod = "apolar"
show energy "sf" # only heavy atoms
Area( a_/15:30/* ) # areas of this atoms
#
# Now let us redefine the first three solvation parameters
# of icm.hdt and calculated E*A contributions of selected atoms
#
Area( a_/15:30/* {10., 20. 30.} energy)
Area ( rs_ ) - returns rarray of pre-calculated solvent accessible areas for selected residues `rs_ . These accessibilities depend on conformation. Area ( rs_ type ) - returns rarray of maximal standard solvent accessible areas for selected residues `rs_ . These accessibilities are calculated for each residue in standard extended conformation surrounded by Gly residues. Those accessibilities depend only on the sequence of the selected residues and do NOT depend on its conformation. To calculate normalized accessibilities, divide Area( rs_ ) by Area( rs_ type ) Example: read object "1crn" show surface area a=Area(a_/* ) # absolute conformation dependent residue accessilities b=Area(a_/* type ) # maximal residue accessilities in the extended conformation c = a/b # relative (normalized) accessibilities Area ( resCode ) ⇒ r_standard_area
- returns the real value of solvent accessible area for the specified residue type in the standard
"exposed" conformation surrounded by the Gly residues, e.g. Area("ala").
It is the same value as the Area( .. type ) function.
- returns an array of relative areas per residue stored with the sequence by the make sequence command from molecules in which the areas had been computed beforehand. Note that the sequence keeps only a very limited accuracy areas. Example: read pdb "1crn" show area surface make sequence # 1crn_a now has relative areas group table Sarray( a_/* residue) Area(1crn_a) Area(a_/*)/Area(a_/* type) name="t" show t
Important : "pre-calculated" above means that before invoking
this function, you should calculate the surface by
show area surface
,
show area skin
or
show energy "sf"
commands.
build # build a molecule according to the sequence
# from file def.se (default)
show area surface # calculate surface area
a = Area(a_//o*) # individual accessibilities of oxygens
stdarea = Area("lys") # standard accessibility of lysine
# More curious example
read object "crn"
show energy "sf" # 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 tube representation accordingly
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
See also: Acc( ) function.
Area ( rs_1 rs_2 ) - returns rarray of areas of contact between selected residues. You can do it for intramolecular residue contacts, in which case both selections should be the same, i.e. Area(a_1/* a_1/*) ; or, alternatively, you can analyze intermolecular residue contacts, for example, Area(a_1/A a_2/A). See also the Cad function, and example in plot area in which a contact matrix is calculated via interatomic Ca-Ca distances. The table of the pairwise contact area differences is written to the s_out string which can later be read into a proper table via: read column group name="aa" input=s_out and sorted by the area (see below). Example:
read object "crn" # good old crambin
s=String(Sequence(a_/A))
PLOT.rainbowStyle="blue/rainbow/red"
plot area Area(a_/A, a_/A) comment=s//s color={-50.,50.} \
link transparent={0., 2.} ds
read object "complex"
plot area Area(a_1/A, a_2/A) grid color={-50.,50.} \
link transparent={0., 2.} ds
arcsine trigonometric function Returned values are in degrees. Asin ( real | integer) - returns the real arcsine of its real or integer argument. Asin ( rarray ) - returns the rarray of arcsines of rarray elements. Examples:
print Asin(1.) # equal to 90 degrees
print Asin(1) # the same
print Asin({-1., 0., 1.}) # returns {-90., 0., 90.}
inverse hyperbolic sine function. Asinh ( real) - returns the real inverse hyperbolic sine of its real argument. Asinh ( rarray) - returns the rarray of inverse hyperbolic sines of rarray elements. Examples:
print Asinh(1.) # returns 0.881374
print Asinh(1) # the same
print Asinh({-1., 0., 1.}) # returns {-0.881374, 0., 0.881374}
interactive input function. Convenient in macros. Ask( s_prompt, i_default ) - returns entered integer or default. Ask ( s_prompt, r_default ) - returns entered real or default. Ask ( s_prompt, l_default ) - returns entered logical or default. Ask ( s_prompt, s_default [simple] ) - returns entered string or default. Option simple suppressed interpretation of the input and makes quotation marks unnecessary. Examples:
windowSize=Ask("Enter window size",windowSize)
s_mask=Ask("Enter alignment mask","xxx----xxx")
grobName=Ask("Enter grob name","xxx")
display $grobName
show Ask("Enter string, it will be interpreted by ICM:", "")
#e.g. Consensus( myAlignm )
show Ask("Enter string:", "As Is",simple)
#your input taken directly as a string
See also: Askg
interactive input function that generates a GUI dialog. Return entered text Askg( s_prompt, i_default ) ⇒ s_returnsTheInputString E.g. Askg( "Enter your name", "" ) # empty default Askg( "Enter your name", "Michael" ) Return the pressed button. Askg( s_Question, "Reply1/Reply2/.." simple ) ⇒ s_theReply Makes a GUI dialog with the question and several alternatives separated by a slash. This dialog returns one of the string selected ,e.g. "Yes", "No" , or "Cancel" for the "Yes/No/Cancel" argument. Example:
s = Askg("Do you like bananas?","Yes/No/Fried only",simple)
if s=="Fried only" print "Impressive"
Creating a special chemical dialog for library enumeration.This one is very specialized and is used in combi-chem generator. Askg( chem_scaffold , enumerate ) ⇒ s_makeLib_React_Args Askg( chem_reaction , enumerate ) ⇒ s_makeLib_React_Args prompts for arguments for the enumerate library or make reaction commands to create a combinatorial library. To use this function you need to have the chemical array objects with Markush-scaffolds or reactions, plus the building blocks loaded into ICM. The function returns a string with the agruments for the enumerate library or make reaction commands. E.g. args = Askg( scaff1 enumerate ) enumerate library scaff1 $args Askg( s_dialogDeclaration ) ⇒ "yes"/"no" Generates a dialog from GUI dialog description text. Values from each input field can be accessed either by : $field_num or Getarg( i_field_num gui )
buf = "#dialog{\"Select InSilco Models\"}\n"
buf += "#1 l_Passive_GUT_Absorption (yes)\n"
buf += "#2 l_ToxCheck (no)\n"
buf += "#3 l_hERG_QSAR (yes)\n"
buf += "#4 s_Comment_Here ()\n"
Askg(buf)
print $1, $2, Getarg( 3 gui ), $4
Using Askg in shell, html-docs and table tool panels. These variants of the Askg function can also be used as a part of an ICM script in dialogs generated from built-in html documents, or in actions associated with tables. See also : gui programming
arctangent trigonometric function Returned values are in degrees. Atan ( real | integer ) - returns the real arctangent of its real or integer argument. Atan ( rarray ) - returns the rarray of arctangents of rarray elements. Examples:
print Atan(1.) # equal to 45.
print Atan(1) # the same.
print Atan({-1., 0., 1.}) # returns {-45., 0., 45.}
arctangent trigonometric function. Returned values are in degrees. Atan2 ( r_x, r_y ) - returns the real arctangent of r_y/r_x in the range -180. to 180. degrees using the signs of both arguments to determine the quadrant of the returned value. Atan2 ( R_x R_y ) - returns the rarray of arctangents of R_y/R_x elements as described above. Examples:
print Atan2(1.,-1.) # equal to 135.
print Atan2({-1., 0., 1.},{-0.3, 1., 0.3}) # returns phases {-106.7 0. 73.3}
inverse hyperbolic tangent function. Atanh ( real ) - returns the real inverse hyperbolic tangent of its real argument. Atanh ( rarray ) - returns the rarray of inverse hyperbolic tangents of rarray elements. Examples:
print Atanh(0.) # returns 0.
print Atanh(1.) # returns error
print Atanh({-0.9999, 0., .9999}) # returns { -4.951719, 0., -4.951719 }
transforms the input selection to atomic level necessary since some of the commands/functions require specific level of selection. Atom ( as_Obj_or_Mol_or_Res_selection ) - returns selection converted to the atomic level. Atom ( vs_ ) - returns atom selection (i.e. selection of atomic level) to which the selected variables vs_ belong. Examples:
asel=Acc(a_2/his) # select accessible His residues of
# the second molecule
show Atom(asel) # show atoms of these residues
show Atom( v_//phi ) # carbonyl Cs
See also: the Res, Mol, adn Obj functions.
creates augmented affine 4x4 space transformation matrix. Augment( R_12transformationVector ) - rearranges the transformation vector into an augmented affine 4x4 space transformation matrix . The augmented matrix can be presented as a1 a2 a3 | a4 a5 a6 a7 | a8 a9 a10 a11 | a12 ------------+---- 0. 0. 0. | 1.where {a1,a2,...a12} is the R_12transformationVector . This matrix is convenient to use because it combines rotation and translation. To find the inverse transformation simply inverse the matrix: M_inv = Power(Augment(R_12direct),-1)) R_12inv = Vector(M_inv)To convert a 4x4 matrix back to a 12-transformation vector, use the Vector( M_4x4 ) function. See also: Vector (the inverse function), symmetry transformations, and transformation vector. Augment ( R_6Cell ) - returns 4x4 matrix of oblique transformation from fractional coordinates to absolute coordinates for given cell parameters {a b c alpha beta gamma}. This matrix can be used to generate real coordinates. It also contains vectors A, B and C. See also an example. Example:
display a__crn. # load and display crambin: P21 group
obl = Augment(Cell( )) # extract oblique matrix
A = obl[1:3,1] # vectors A, B, C
B = obl[1:3,2]
C = obl[1:3,3]
g1=Grob("cell",Cell( )) # first cell
g2=g1+ (-A) # second cell
display g1 g2
Augment( R_3Vector ) - appends 1. to a 3D vector x,y,z (resulting in x,y,z,1. ) to allow direct arithmetics with augmented 4x4 space transformation matrixes. Augment( M_XYZblock ) - adds 1.,1.,..1. column to the Nx3 matrix of with x,y,z coordinates to allow direct arithmetics with augmented 4x4 space transformation matrixes.
calculates rotation/screw axis corresponding to a transformation Axis( { M_33Rot | R_12transformation } ) - returns rarray with x,y,z components of the normalized rotation/screw axis vector. Additional information calculated and returned by the function: See also: How to find and display rotation/screw transformation axis
crystallographic temperature factors or custom atom parameters. Bfactor ( [ as_ | rs_ ] [ simple ] ) - returns rarray of b-factors for the specified selection of atoms or residues. If selection of residue level is given, the average residue b-factors are returned. B-factors can also be shown with the command show pdb. Option simple returns a normalized b-factor. This option is possible for X-ray objects containing b-factor information. The read pdb command calculates the average B-factor for all non-water atoms. The normalized B-factor is calculated as (b-b_av)/b_av . This is preferable for coloring ribbons by B-factor since these numbers only depend on the ratios to the average. We recommend to use the following commands to color by b-factor: color ribbon a_/ Trim(Bfactor( a_/ simple ),-0.5,3.)//-0.5//3. # or color a_// Trim(Bfactor( a_// simple ),-0.5,3.)//-0.5//3. # for atomsThis scheme will give you a full sense of how bad a particular part of the structure is. See also: set bfactor. Examples:
avB=Min(Bfactor(a_//ca)) # minimal B-factor of Ca-atoms
show Bfactor(a_//!h*) # array of B-factors of heavy atoms
color a_//* Bfactor(a_//*) # color previously displayed atoms
# according to their B-factor
color ribbon a_/A Bfactor(a_/A) # color the whole residue by mean B-fac.
returns the real Boltzmann constant = 0.001987 kcal/deg. Example: deltaE = Boltzmann*temperature # energy
the 3D graphics box function. This box can be displayed with the display box command or by left-double-clicking on a grob, and interactively moved and resized with the mouse. One can select atoms inside a box by this operation: as_ & Box( ) Box ( [ display ] ) - returns the 6- rarray with {Xmin ,Ymin ,Zmin ,Xmax ,Ymax ,Zmax } parameters of the graphics box as defined on the screen. With the display keyword, the function returns {0. 0. 0. 0. 0. 0.} if the box is not displayed (by default it returns the last 6 values). Box ( center ) - returns the 6- rarray with Xcenter,Ycenter,Zcenter,Xsize,Ysize,Zsize parameters of the graphics box as defined on the screen. Box ( as_ [ r_margin ] ) - returns the 6- rarray with Xmin,Ymin,Zmin,Xmax,Ymax,Zmax parameters of the box surrounding the selected atoms. The boundaries are expanded by r_margin (default: 0.0 ).
NOTE: the above option is only available in versions 3.6 and above.
Examples: build string "se ala his" # a peptide display box Box(a_/2 1.2) # surround the a_/2 by a box with 1.2A margin color a_//* & Box( ) Box ( { g_ | m_ | R_6box } [ r_margin ] ) - returns the 6- rarray with Xmin,Ymin,Zmin,Xmax,Ymax,Zmax parameters of the box surrounding the selected grob or map. The boundaries are expanded by r_margin (default: 0.0 ).
bracket the grid potential map by value or by space. Bracket ( m_grid [ r_vmin r_vmax ] ) - returns the truncated map . The map will be truncated by value. The values beyond r_vmin and r_vmax will be set to r_vmin and r_vmax respectively. Bracket ( m_grid [ R_6box ] ) - returns the modified map . All the values beyond the specified box will be set to zero. Example: make map potential "gh,gc,gb,ge,gs" a_1 Box() m_ge = Bracket(m_ge, Box( a_1/15:18,33:47 )) # redefine m_ge See also: Rmsd( map ) and Mean( map ), Min( map ), Max( map ) functions.
Contact Area Difference function to measure geometrical difference between two different conformations of the same molecule. Cad, as opposed to Rmsd, is contact based and can measure the difference in a wide range of model accuracies. Roughly speaking it measures the surface weighted fraction of native contacts. Can be used to evaluate the differences between several NMR models, the accuracy of models by homology and the accuracy of docking solutions. Cad can measure the geometrical difference between two conformations in several different ways:
Cad ( rs_A1 [ rs_A2] rs_B1 [ rs_B2] [ distance ] ) - returns the real contact area difference measure (described in Abagyan and Totrov, 1997) between two conformations A and B of the same set of residue pairs from two different objects. The set of residue pairs in each object (A or B) can be defined in two ways:
The whole matrix of contact area differences is returned in M_out . This matrix can be nicely plotted with the plot area M_out number .. command (see example). The full matrix can also be used to calculate the residue profile of the differences. The table of the pairwise contact area differences is written to the s_out string which can later be read into a proper table via: read column group name="aa" input=s_out and sorted by the area (see below). See also Area() function which calculates absolute residue-residue contact areas. Options:
Examples: # Ab initio structure prediction, Overall models by homology read pdb "cnf1" # one conformation of a protein read pdb "cnf2" # another conformation of the same protein show 1.8*Cad(a_1. a_2.) # CAD=0. - identical; =100. different show 1.8*Cad(a_1.1 a_2.1) # CAD between the 1st molecules (domains) show 1.8*Cad(a_1.1/2:10 a_2.1/2:10) # CAD in a window PLOT.rainbowStyle = 2 plot area grid M_out comment=String(Sequence(a_1,2.1)) link display # Loop prediction: 0% - identical; ~100% totally different # CAD for loop 10:20 and its interactions with the environment show 1.8*Cad(a_1.1/10:20 a_1.1/* a_2.1/10:20 a_2.1/*) # CAD for loop 10:20 itself show 1.8*Cad(a_1.1/10:20 a_1.1/10:20 a_2.1/10:20 a_2.1/10:20) # Evaluation of docking solutions: 0% - identical; 100% totally different read pdb "expr" # one conformation of a complex read pdb "pred" # another conformation of the same complex show Cad(a_1.1 a_1.2 a_2.1 a_2.2) # CAD between two docking solutions # # ANOTHER EXAMPLE: the most changed contacts read object "crn" copy a_ "crn2" randomize v_ 5. Cad(a_1. a_2.) show s_out read column group input= s_out name="cont" sort cont.1 show cont # the table looks like this (the diffs can be both + and -): #>T cont #>-1-----------2-----------3---------- -39. a_crn.m/38 a_crn.m/1 -36.4 a_crn.m/46 a_crn.m/4 -32.1 a_crn.m/46 a_crn.m/5 -29.8 a_crn.m/30 a_crn.m/9 -25.2 a_crn.m/37 a_crn.m/1 ... 42.5 a_crn.m/43 a_crn.m/5 45.1 a_crn.m/44 a_crn.m/6 45.2 a_crn.m/43 a_crn.m/6 55.3 a_crn.m/46 a_crn.m/7 56. a_crn.m/45 a_crn.m/7
Cad ( rs_A1 [ rs_A2] rs_B1 [ rs_B2] alignment )
rounding function. Ceil ( r_real [ r_base] ) - returns the smallest real multiple of r_base exceeding r_real. Ceil ( R_real [ r_base] ) - returns the rarray of the smallest multiples of r_base exceeding components of the input array R_real. Default r_base= 1.0 . See also: Floor( ).
crystallographic cell function. Cell ( { os_ | m_map } ) - returns the rarray with 6 cell parameters {a,b,c,alpha,beta,gamma} which were assigned to the object or the map.
returns an rarray of partial electric charges of selected atoms, or total charges for residue, molecule or objects, depending on the selection level. Charges can also be shown with a regular show as_select command. Charge ( { os_ | ms_ | rs_ | as_ } [ formal | mmff ] ) - returns rarray of elementary or total charges depending on the selection level.
Examples: build string "ala his glu lys arg asp" show Charge(a_1) # charge per molecule show Charge( a_1/* ) # charge per residue show Charge( a_1//* ) # charge per atom avC=Charge(a_/15) # total electric charge of 15th residue avC=Sum(Charge(a_/15/*)) # another way to calculate it show Charge(a_//o*) # array of oxygen charges # to return mmff charges: set type mmff set charge mmff Charge( a_//* ) # to return total charges per molecular object: read mol s_icmhome+"ex_mol.mol" set type mmff set charge mmff Charge( a_*. )See also: set charge.
Converting 3D objects to chemical arrays. Chemical( ms|os [exact] [hydrogen] [unique] [pharmacophore] ) returns an array of chemicals from a molecular selection of 3D molecular objects, e.g. a_H for hetero-molecules By default the selected molecules will be converted to 2D graphs. However with the exact option the original 3D coordinates will be retained in the elements of the chemical array. If you want to preserve explicitly drawn hydrogens hydrogen option should be used. Note that the number of chemicals in the array will be determined by the selection level. At the object level multiple molecules of the same object will be merged into one array element. With unique option duplicates will be excluded from the result. Example: read pdb "1ch8" group table t_2D Chemical(a_H) # convert to 2D chemical table group table t_3D Chemical(a_H exact) # convert to 3D chemical table group table t_3D_hyd Chemical(a_H exact hydrogen) # convert to 3D chemical table and preserve hydrogens With pharmacophore option the function generates pharmacophore points for the input selection. Example: read object s_icmhome + "biotin.ob" name="biotin" read mol input = String( Chemical(a_ pharmacophore )) name="biotin_ph4" display xstick display wire a_biotin. To display supported pharmacophore types and use show pharmacophore type command Converting smiles to chemical arrays: Chemical( S_smiles|s_smiles ) returns an array of chemicals from a string arrays of smiles. Example: <> add column t Chemical({"N[C@@](F)(C)C(=O)O", "C[C@H]1CCCCO1"}) <>
See also: chemical functions
Cluster( I_NxM_NearestNeighb i_M_totalNofNearNeighbors i_minNofCommonNeighbors ) ⇒ I_N_clusterNumbers function returns iarray of cluster numbers for each or N points. The input to the first function is an array of M nearest neighbors (defined by the second argument i_M_totalNofNearNeighbors) for each of N points. For example for an array for 5 points, and i_M_totalNofNearNeighbors = 3 it can be an array like this: {3,4,5, 1,3,4 1,2,5 2,3,5 1,2,3} . The points will be grouped into the same cluster if the number of neighbors they share is larger or equal than i_minNofCommonNeighbors . This clustering algorithm is adaptive to the cluster density and does not depend on absolute distance threshold. In other words it will identify both very sparse clusters and very dense ones. The nearest neighbor array can be calculated by the with the Link ( I_bitkeys , nBits, nNearestNeighbors ) function. Cluster( M_NxNdist r_maxDist ) ⇒ I_N_clusterNumbers This function identifies the i_totalNofNeighbors nearest neighbors from the full distance matrix M_NxNdist for each point and assembles points sharing the specified number of common neighbors in clusters. All singlets (a single item not in any cluster) are placed in a special cluster number 0 . Other items are assigned to a cluster starting from 1. Example with a distance matrix:
# let us make a distance matrix D
# we will cook it from 5 vectors {0. 0. 0.}
m=Matrix(5,3) # initialize 5 vectors
m[2,1:3]={1. 0. 0.} # v2
m[3,1:3]={1. 1. 0.} # v3
m[4,1:3]={1. 1. 1.} # v4
m[5,1:3]={1. 0.1 0.1} # v5 close to v2
D = Distance( m ) # 5x5 distance matrix created
Cluster( D , 0.2 ) # v2 and v5 are assigned to cluster 1
Cluster( D , 0.1 ) # radius too small. All items are singlets
Cluster( D , 2. ) # radius too large. All items are in cluster 1
[ Color from gradient | Color image ] returns RGB numbers.Color ( g_grob ) - returns matrix of RGB numbers for each vertex of the g_grob (dimensions: Nof ( g_grob),3). See also: color grob matrix . Example: build string "se his" display xstick make grob image name="g_" display g_ only smooth M_clr = Color( g_ ) for i=1,20 # shineStyle = "color" makes it disappear completely color g_ (1.-i/20.)*M_clr endfor color g_ M_clr Color( M_rgb ) ⇒ S_colorNames - returns sarray of color names approximating the rgb values in the matrix. The color names and definitions are taken from the icm.clr file. Example:
m = Matrix(3)
Color(m) # returns {"red","blue1","green"}
NOTE: this functionality is only available in versions 3.6 and above.
Color( background )
NOTE: the above option is only available in versions 3.6 and above.
Color( r_value s_gradient [ r_from r_to ] ) - returns 3-element rarray with RGB components describing the color. Color( R_N_values s_gradient [ r_from r_to ] ) - returns matrix with N rows and 3 columns where each row is the RGB representation of the interpolated color for the respective value in the R_N_values array. Examples:
s = "red/lime/blue"
Color( 0. s 0. 1. )
Color( 0.5 s 0. 1. )
Color( 1.0 s 0. 1. )
Color( 0.1 s 0. 1. )
Color( 0.8 s 0. 1. )
Color( {0.1 0.8} s 0. 1. )
Color( {1. 8.} s 0. 10. )
Color( 0.1 "red/lime/blue,0:1" )
Color( {0.1 0.8} "red/lime/blue,0:1" )
Color( {1. 8.} "red/lime/blue,0:10" )
NOTE: this functionality is only available in versions 3.6 and above.
Color( imageArray_ background ) returns sarray with background colors of the images in imageArray_.The color of the top left pixel of the image is returned as the background color currently.
See also: Image, image parray
Consensus ( ali_ ) ⇒ s_consensus - returns the string consensus of alignment ali_. The consensus characters are these: # hydrophobic; + RK; - DE; ^ ASGS; % FYW; ~ polar. In the selections by consensus a letter code (h,o,n,s,p,a) is used. Consensus ( ali_ { i_seq | seq_ } ) - returns the string consensus of alignment ali_ as projected to the sequence. Sequence can be specified by its order number in the alignment or by name. Example displaying conserved residues:
read alignment "sx" # load alignment
read pdb "x" # structure
display ribbon
# multiply rs_ by a mask like " A C N .."
cnrv = a_/A & Replace(Consensus(sx cd59),"[.^~#]"," ")
display cnrv red
display residue label cnrv
linear correlation function (Pearson's coefficient R ) Corr ( R_X, R_Y ) ⇒ r_correlation - returns the real value of the linear correlation coefficient. Probability of the null hypothesis of zero correlation is stored in r_out .
Note: this function returns R , not R2 .
Taking it to the 2nd power can be a humbling experience.
r=Corr(a,b) # two vectors a and b if (Abs(r_out) < 0.3) print "it is actually as good as no correlation"See also: LinearFit( ) function.
cosine function. Arguments are assumed to be in degrees. Cos ( { r_Angle | i_Angle } ) - returns the real value of cosine of its real or integer argument. Cos ( rarray ) - returns rarray of cosines of each component of the array. Examples:
show Cos(60.) # returns 0.5
show Cos(60) # the same
rho={3.2 1.4 2.3} # structure factors
phi={60. 30. 180.} # phases
show rho phi rho*Cos(phi) rho*Sin(phi) # show in columns rho, phi,
# Re, Im
hyperbolic cosine function. Cosh ( { r_Angle | i_Angle } ) - returns the real value of hyperbolic cosine of its real or integer argument. Cos(x)=0.5( eiz + e-iz ) Cosh ( rarray ) - returns rarray of hyperbolic cosines of each component of the array. Examples:
show Cosh(1.) # 1.543081
show Cosh(1) # the same
show Cosh({-1., 0., 1.}) # returns {1.543081, 1., 1.543081}
function creates an iarray. Count ( [ i_Min, ] i_Max ) - returns iarray of numbers growing from i_Min to i_Max. The default value of i_Min is 1. Examples:
show Count(-2,1) # returns {-2,-1,0,1}
show Count(4) # returns {1,2,3,4}
See also the Iarray( ).
Count ( array ) - returns iarray of numbers growing from 1 to the number of elements in the array.
Date ( os_ ) ⇒ i_date Date ( os_ all ) ⇒ I_dates returns the date of the pdb file creation in an integer (or iarray ) format. The date read from the HEADER record of a pdb file and is stored with the object. The format of the integer date (e.g. 19920115 for Jan 15, 1992) enables convinient numerical comparison and sorting. Example: read pdb "1crn" if Date(a_) > 19820000 print "released after 1992" Date ( [ s_format ] )
returns string with the current week day, month, year and time in the given format.
The default format is "%m %DD %Y" which returns something like
"Oct 08 2004" .
Date() # uses the default format
Date("%m %DD,%Y %h%pm") # today returns
Oct 08,2002 5pm
Deletion ( rs_Fragment, ali_Alignment [, seq_fromAli ] [, i_addFlanks ] [{"all"|"nter"|"cter"|"loop"}] ) - returns the residue selection which flanks deletion points from the viewpoint of other sequences in the ali_Alignment. If argument seq_fromAli is given (it must be the name of a sequence from the alignment), all the other sequences in the alignment will be ignored and only the pairwise subalignment of rs_Fragment and seq_fromAli will be considered. The alignment must be linked to the object. With this function (see also Insertion function) one can easily and quickly visualize and/or extract all indels in the three-dimensional structure. The default i_addFlanks parameter is 1. String options:
See example coming with the Insertion( ) function description.
determinant function. Det ( matrix ) - returns a real determinant of specified square matrix. Examples:
a=Rot({0. 0. 1.}, 30.) # Z-rotation matrix by 30 degrees
print Det(a) # naturally, it is equal to 1.
Solves the so called "DIStance GEOmetry" problem (finding coordinates from a distance set). This function can be used to visualize in two or three dimensions a distribution of homologous sequences: group sequence se1 se2 se2 se4 mySeqs align mySeqs distMatr=Distances(mySeqs) or any objects between which one can somehow define pairwise distances. Since principal coordinates are sorted according to their contribution to the distances and we can hardly visualize distributions in more than three dimensions, the first two or three coordinates give the best representation of how the points are spread in n-1 dimensions. Another application is restoring atomic coordinates from pairwise distances taken from NMR experiments. Disgeo ( matrix ) - returns matrix [1:n,1:n] where the each row consists of n-1 coordinates of point [i] sorted according to the eigenvalue (hence, their importance). The first two columns, therefore, contain the two most significant coordinates (say X and Y) for each of n points. The last number in each row is the eigenvalue [i]. If distances are Euclidean, all the eigenvalues are positive or equal to zero. The eigenvalue represents the "principal coordinate" or "dimension" and the actual value is a fraction of data variation due to the this particular dimension. Negative eigenvalues represent "non-Euclidean error" in the initial distances. Example: read sequences s_icmhome+"zincFing" # read sequences from the file, list sequences # see them, then ... group sequence alZnFing # group them, then ... align alZnFing # align them, then ... a=Distance(alZnFing) # a matrix of pairwise distances n=Nof(a) # number of points b=Disgeo(a) # calculate principal components corMat=b[1:n,1:n-1] # coordinate matrix [n,n-1] of n points eigenV=b[1:n,n] # vector with n sorted eigenvalues xplot= corMat[1:n,1] yplot= corMat[1:n,2] plot xplot yplot CIRCLE display # call plot a 2D distribution
[ Distance iarray | Distance rarray | Distance as_ | Distance as_ rarray | Distance matrix | Distance Tanimoto | Distance 2 matrixes | Distance tether | Distance Dayhoff | Distance in alignment | Distance 2 alignments | Distance tree | Distance chemical ] generic distance function. Calculates distances between two ICM-shell objects, bit-strings or molecular objects, or extracts distances from complex ICM-shell objects.
Distance ( iarray1, iarray2 ) - returns the real sqrt of sum of (I1i -I2i )2 .
Distance ( R_X, R_Y ) - returns the real Cartesian distance between two vectors of the same length. D = Sum( ( Xi - Yi )2 )
Distance ( as_1, as_2 ) - returns the real distance in Angstroms between centers of mass of the two specified selections. The interactive usage of this function:
Distance ( as_1 , as_2, rarray ) - returns the rarray of distances in Angstroms between the two specified selections containing the same number of atoms (1-1, 2-2, 3-3, ...).
Distance ( M_coor ) - returns the square matrix of distances between the rows of the input matrix M_coor. Each row contains m coordinates (3 in 3D space). For example: Distance(Xyz(a_//ca)) returns a square matrix of Ca-Ca distances.
Distance( X_chem_n X_chem_m ) ⇒ M_nxm_distances
Distance( I_keys1 I_keys2 nBits | R_nBitWeights [simple] ) ⇒ M_distances
distWeighted = 1. - Sum( Wi_of_common_On_Bits ) / Sum( Wi_of_On_Bits ) With option simple the similarity calculation is modified so that the number of bits in common is divided by the number of bits in the second bit-string. For example:
Distance({3} {1} 32 simple ) # returns 0.
Distance({1} {3} 32 simple ) # returns 0.5
Example:
Distance({1 2 3},{1 2 3},32)
#>M
0. 1. 0.5
1. 0. 0.5
0.5 0.5 0.
The diagonal distances are 0; no bits are share between 1 (100..) and 2 (010..) (distance=1.) and
one of two bits is shared between 1 (100..) and 3 (110..).
Instead of the number of bits, one can provide the relative weights for each bit. The dimension of the bit-weight array then becomes the size of the bit-string. The weighted Tanimoto is calculated. See also:
Distance ( M_coor1 M_coor2 ) - returns the matrix of distances between the rows of the two input matrices. Each matrix row may contain any number of coordinates coordinates (3 in 3D space). For example: Distance(Xyz(a_/1:5/ca) Xyz(a_/10:12/ca) returns a 5 by 3 matrix of distances between Ca-s of the two fragments.
Distance ( as_ [ r_defaultLength=-1.] ) - returns the real array of lengths of tethers for each selected atom or the default value ( -1. ). The default value can be set to any value. Tethers are assumed to be already set, see command set tether. Also note, that the expression Distance( as_out ) will give the same results if as_out selection was not changed by another operation; see also special selections. Example:
Distance( seq1 seq2 [identity|evolution|new|fast|number|reverse] ) ⇒ r
Distance( seqArr[n]> <seq ) ⇒ R_n
- returns the real measure of similarity between two aligned sequences. Zero distance means 100% identity. The distance is calculated by the following two steps:
Transformation practically does not change small distances d1, whereas large
distances, especially above 0.9 (10% sequence identity) are increased to
take occasional reversals into account. Distances d1 within [0.9,1.0] are
transformed to [5.17, 10.] range.
Distance ( alignment ) Distance( seqArr[n]> ) ⇒ <M_nn Distance( seqArr[n]> <seqArr[m]> ) ⇒ <M_nm - returns matrix of pairwise sequence-sequence distances in the alignment. These distances are calculated with the fast option as follows 1.-(nResidueIdentities-gapPenalty)/Min(Length(Seq1), Length(Seq2))where gapPenalty is 3 for each gap. Without the fast option the distances are calculated based on comparison matrix and gap penalties. These distances are more sensitive but there is no simple mapping between them and percent identity based distances. Example: read alignment msf "azurins" # read azurins.msf NormCoord = Disgeo(Distance(azurins)) # 2D sequence diversity in
Distance ( ali_1 ali_2 [ exact ] )
- returns the real distance between two alignments formed by the same sequences.
show a1 # La1 = 3 ABC---XYZ ABCDEF--- show a2 # La2 = 6 ABCXYZ ABCDEF Distance(a1,a2) # a1 is a subalignment of a2, distance is 0. 0. exact option: normalization to the number of pairs of the longer alignment. By longer we mean the larger number of aligned pairs regardless of alignment length (the latter includes gaps and ends). D = (La_max - N_commonPairs)/La_max Now in the above example, La_max = 6 , while N_commonPairs = 3, the distance is 0.5 (e.g. the alignments are 50% different). Distance(a1,a2,exact) # returns 0.5 for the above a1 and a2 Example showing the influence of gap parameters: read sequence msf "azurins.msf" gapOpen =2.2 a=Align(Azu2_Metj Azup_Alcfa) # the first alignment gapOpen =1.9 # smaller gap penalty and .. b=Align(Azu2_Metj Azup_Alcfa) # the alignment changes show 100*Distance(a b ) # 20% difference show 100*Distance(a b exact ) # 21.7% difference show a b
Distance( treeArr i_at separator )
- return the current value of the cluster splitting level set by split command.
Distance( chemarray ) - return square matrix of chemical distacnes. Example:
Distance( Chemical( { "CCC", "CCO"} ) )
Distance( chemarray1 chemarray2 ) - return a MxN matrix where M is number of elements in chemarray1 and N is number of elements in chemarray2 Example:
Distance( Chemical({ "CCC", "CCO"}) Chemical("CC" ))
See also: find table find molcart other chemical functions
eigenvalues/eigenvectors function. Eigen ( M_ ) - returns the square matrix of eigenvector columns of the input symmetric square matrix M_ . Eigenvalues sorted by their values are stored in the R_out rarray. Example:
A = Matrix(3, 3, 0.) # create a zero square matrix...
A[1:3,1] = {1.,-2.,-1.} # and set its elements
A[2,2] = 4.
for i = 1, 3-1 # the matrix must be symmetric
for j = i+1, |