Copyright © 2020, Molsoft LLC Sep 22 2022

[ Abs  Acc  Acos  Acosh  Align  Angle  Area  Asin  Asinh  Ask  Askg  Atan  Atan2  Atanh  Atom  Augment  Axis  Blob  Bfactor  Boltzmann  Box  Bracket  Cad  Ceil  Cell  Charge  Chemical  Cluster  Color  Compare  Consensus  Contour  Corr  Cos  Cosh  Count  CubicRoot  Date  Deletion  Descriptor numeric  Descriptor  Det  Disgeo  Distance  Eigen  Energy  Entropy  Error  Error soap  Exist  Existenv  Extension  Exp  Field  File  Find  Floor  Formula  Getarg  Getenv  Gradient  Grob  Group  Header  Histogram  Iarray  IcmSequence  Image  InChi  Index  Indexx  Insertion  Info  Info image  Info model  Integer  Integral  Interrupt  Label  Laplacian  Length  GaussFit  LinearFit  LinearModel  Log  Map  Mass  Moment  Match  Matrix  Max  MaxHKL  Median  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  Ring  Rfactor  Rfree  Rmsd  Rot  Sarray  Score  Select  Sequence  Shuffle  Sign  Sin  Sinh  Site  Slide  Smiles  Smooth  SolveQuadratic  SolveQubic  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 chemical  Trim sequence  Turn  Type  Unique  Unix  Value  Value soap  Vector  Version  Volume  View  Warning  Xyz ] ICMshell functions are an important part of the ICMshell environment. They can be divided into hardwired builtin functions and openshell functions written as an icm script ( see icm shell functions ). They have the following general format: FunctionName ( arg1, arg2, ... ) and return an ICMshell 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 ICMshell constants of different type depending on the arguments types and order. ICMshell 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 GlyXGly 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 dotsurface 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 aminoacid 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 XH 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 s_icmhome+"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 icmshell 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 ZEGAstatistics 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 "Halign". 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 DNA or RNA sequencesMake sure to read the dna.comp comp_matrix before using the Align function, e.g. a=Sequence("GAGTGAGGG GAGCAGTTGG CTGAAGATGG TCCCCGCCGA GGGACCGGTG GGCGACGGCG") b=Sequence("GCATGCGGA GTGAGGGGAG CAGTTGGGAA CAGATGGTCC CCGCCGAGGG ACCGGTGGG") read comp_matrix s_icmhome+"dna.cmp" c = Align(a,b) 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 residueresidue 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_a # 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_a 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 alphahelix in the first sequence preferably aligns with alphahelix 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 shell function 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" name="a" # obj. a build string "se his val gly trp gly ala" name="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 subalignment 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
a family of functions calculating planar angles. The most detailed is Angle ( Angle ( as_atom )  returns the planar angle defined by the specified atom and two previous atoms in the ICMtree. For example, Angle(a_/5/c) is defined by CCaN atoms of the 5th 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. Angle ( as table )  returns a table of all covalently bound atom triplets with their two bond lengths and a planer angle. Example: read pdb "1xbb" t=Angle(a_H table) sort t.angle show t
Angle ( asrsmsos as_filter error )
 returns a rarray of minimal angles within each specific unit of the selection.
The size of the array depends on the level of the selection. Used to detect errors (too small angles).
d=Angle( a_/4/c ) # d equals NCaC angle print Angle( a_/4/ca a_/5/ca a_/6/ca ) # virtual CaCaCa 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 [error] ) → r Area( as  rs ) → R_atomAreasR_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 Area( rs rs_2 distance [ min(4.) max(8.) [Ca_Cb_len(2.3)]] ) → M_0_to_1_contact_strength
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:
g = Grob("SPHERE",1.,2) show Area(g) if(Area(g error)>0.01) print "Surface not closed" # check for holes See also: the Volume( grob ) function, the split command and How to display and characterize protein cavities section. Area ( as [ [ R_userSolvationDensities ] [ energy ] ] )  returns rarray of precalculated solvent accessible areas or energies for selected atoms `as_ . This areas are set by the show area surfaceskin of show energy "sf" commands. Make sure to clean up the areas with the set area a_//* 0. command before computing the areas with show energy command since the command ignores hydrogens. 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: read object s_icmhome+"crn.ob" set area a_//* 0. surfaceMethod = "apolar" show energy "sf" # only heavy atoms, alternatively: show surface area mute 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 precalculated 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 s_icmhome+"crn.ob" show surface area a=Area(a_/* ) # absolute conformation dependent residue accessibilities b=Area(a_/* type ) # maximal residue accessibilities 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 t Sarray( a_/* residue) Area(1crn_a) Area(a_/*)/Area(a_/* type) show t
Important : "precalculated" 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 string "se ala his leu gly trp lys ala" 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 s_icmhome+"crn.ob" 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) displaySee also: Acc( ) function.
(also see the simplified distancebased contacts strength calculation below)
read object s_icmhome+"crn.ob" # 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 s_icmhome+"complex" plot area Area(a_1/A, a_2/A) grid color={50.,50.} \ link transparent={0., 2.} ds Area( rs rs_2 distance [ min(4.) max(8.) [Ca_Cb_len(2.3)]] ) → M_0_to_1_contact_strength  evaluates the strength of residue contact based on the projected and extended CaCb vector. It works with both converted and unconverted objects and needs ca, c, and n atoms for its calculation only to be independent on the presense of Gly residues. By default the procedure finds a point about 1.5 times beyond Cb along the CaCb vector (2.3A) and calculates the distance matrix between those point. Then the distances are converted into the contact strength:
read pdb "1crn" m = Area( a_/A a_/A distance 4. 7. 2.5 )This matrix can also be used to evaluate the contact difference between contacts of two proteins, e.g. read pdb "1crn" read pdb "1cbn" make sequence a_*.A aln=Align(1crn_a 1cbn_a) m1=Area( a_1crn.a/!Cg a_1crn.a/!Cg distance ) # !Cg excludes nonmatching gapped regions m2=Area( a_1cbn.a/!Cg a_1cbn.a/!Cg distance ) diff = Sum(Sum(Abs(m1m2)))/Sum(Sum(Max(m1,m2))) simi = 1.diff printf " Info> dist=%.2f similarity=%.2f or %1f%\n" diff simi,100.*simi
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 by automatically adding quotes around your input text. Examples: windowSize=Ask("Enter window size",windowSize) s_mask=Ask("Enter alignment mask","xxxxxx") 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 combichem 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 Markushscaffolds 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, htmldocs 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 builtin 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 or returns an atom level selection. Function is necessary since some of the commands/functions require a specific level of selection. Atom( asrsmsos ) → as_atomLevelSel  a selection level transformation function Atom( vs ) → as_firstAtomMovedByVar  each variable be it a bond length, bond angle, torsion angle or phase angle in the ICM tree has a single atom that is first moved when this variable is changed. This function returns this first atom(s). Atom( as_icmAtom i ) # ith preceding atom  this function also uses the concept of the ICM tree and returns atoms i  th links before the selected one. Atom( as1 [ as_where ] symmetry )  returns a selection of atoms that are topologically equivalent to one atom defined by as1 . The optional second selection argument as_where allows one to narrow down the search for the equivalent atoms to the specified selection. build smiles "C1CCCC1" # a cyclopentane Atom( a_//c2 symmetry ) # returns 4 other equivalent carbons, c1,c3,c4,c5 # build string "AFA" # a tripeptide with phenylalanine Atom( a_/3/ce1 a_/3 symmetry ) # returns ce2 in phe Atom( as tether )  returns a subselection of as that has tethers . Atom( vs i ) # ith preceding atom for variables Atom( label3d [i_item] ) → as
Atom( pairDist_or_hbondPairDist ) → as
make distance or make bond commands can be used to create distance lines and labels or hbonds, respectively, in the format of a "distance" object;
The Atom function then will return the atoms referenced in the object. E.g. display Atom( hbondpairs ) xstick cpk
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 CsSee also: the Res, Mol, and Obj functions.
creates augmented affine 4x4 space transformation matrix or adds 4th column to the coordinate 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 12transformation 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: read object s_icmhome+"crn.ob" 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 matrices. 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 matrices. Augment( M_3x3_rotation R_3trans )  adds 0.,0.,0.,1. row the 3x3 rotation matrix . Then it adds the translation vector as the first three elements of the 4th column.
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
Blob( s_text ['hex''base64'] ) Creates blob from string. Hex or Base64 conversion is applied if specified. Blob( any_variable binary ) Serialize any shell variable into blob Blob( blob_serialized read ) Unserialize blob into shell variable. Example: read pdb "1crn" convert auto make map potential c = Collection( ) c["ob"] = a_ # store object c["map"] = m_atoms # store map s_base64 = String( Blob( c binary ) 'base64') # serialize collection into base64 string. # now it can be passed between CGI scripts delete a_*. delete m_atoms c c = Blob( Blob( s_base64 'base64' ) read ) # convert s_base64 to blob and unserialize it load object c["ob"] m_atoms = c["map"] display a_ display m_atoms
crystallographic temperature factors or custom atom parameters. Bfactor ( [ as  rs ] [ simple ] )  returns rarray of bfactors for the specified selection of atoms or residues. If selection of residue level is given, the average residue bfactors are returned. Bfactors can also be shown with the command show pdb. Option simple returns a normalized bfactor. This option is possible for Xray objects containing bfactor information. The read pdb command calculates the average Bfactor for all nonwater atoms. The normalized Bfactor is calculated as (bb_av)/b_av . This is preferable for coloring ribbons by Bfactor since these numbers only depend on the ratios to the average. We recommend to use the following commands to color by bfactor: 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: read pdb "1crn" avB=Min(Bfactor(a_//ca)) # minimal Bfactor of Caatoms show Bfactor(a_//!h*) # array of Bfactors of heavy atoms color a_//* Bfactor(a_//*) # color previously displayed atoms # according to their Bfactor color ribbon a_/A Bfactor(a_/A) # color the whole residue by mean Bfac.
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 leftdoubleclicking 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 {X_{min} ,Y_{min} ,Z_{min} ,X_{max} ,Y_{max} ,Z_{max} } 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 ).
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  alignment ] )  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. See also: Area() function which calculates absolute residueresidue 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 #>123 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_/5) # total electric charge of 15th residue avC=Sum(Charge(a_/5/*)) # 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( msos [exact] [hydrogen] [unique] [pharmacophore] [stack] ) returns an array of chemicals from a molecular selection of 3D molecular objects, e.g. a_H for heteromolecules 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. If 3D object has an embedded conformation stack you can use stack option to preserve it in the result chemical object Example: read pdb "1ch8" group table t_2D Chemical(a_H) # convert to 2D chemical table group table t_3D Chemical(a_H exact) # make 3D chemical table without hydrogens group table t_3D_hyd Chemical(a_H exact hydrogen) # make 3D chemical table, keep 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_smiless_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"}) Converting InChI to chemical arrays: Chemical( S_InChIs_InChI ) See also: chemical functions Generating combinatorial compounds from a Markush structure and Rgroup arrays. Chemical( scaffold I_RgroupNumArray enumerate ) → returns one chemical The I_RgroupNumArray is an array of as many elements as there are different R groups in the scaffold.E.g. if there is R1 R2 R3 than this parameter can be {10,21,8}. The numbers refer to the Rgroup arrays linked to the scaffold.E.g.
group table scfld Chemical("C(=CC(=C(C1)[R2])[R1])C=1") "mol" link group scfld.mol 1 Chemical({"N","O","S"}) link group scfld.mol 2 Chemical({"[Cl]", "[C*](=O)O"}) Nof( scfld.mol library ) # returns the total number of molecules in that combinatorial library Nof( scfld.mol group ) # returns an array of sizes of each linked array in R1 R2.. order. Chemical( scfld.mol {1 1} enumerate ) Chemical( scfld.mol {1 2} enumerate ) Chemical( scfld.mol {2 2} enumerate ) Chemical( enumerate scaffold [simple] R1 R2 ... ) → returns enumeration result The same as above but does not require explicit linkage with link group command. Example: Chemical( enumerate Chemical("C(=CC(=C(C1)[R2])[R1])C=1") Chemical({"N","O","S"}) Chemical({"[Cl]", "[C*](=O)O"}) ) simple mode is similar to enumerate library and requires that size of Rgroup arrays be the same. Example: Chemical( enumerate Chemical("C(=CC(=C(C1)[R2])[R1])C=1") simple Chemical({"N","O"}) Chemical({"[Cl]", "[C*](=O)O"}) ) See also: linking scaffold to Rgroup arrays and the Nof
[ Collection ] Cluster( I_NxM_NearestNeighb i_M_totalNofNearNeighbors i_minNofCommonNeighbors ) → I_N_clusterNumbersfunction 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
The function to create a collection object Collection()  returns empty collection object Collection( s_json_string )  returns a collection object from a text in JSON format Collection( s_url_encoded_string )  returns a collection object from a URL encoded string ("a=1&b=abc") Collection( web )  returns a collection object from the POST or GET arguments. Can be used in CGI scripts. Multipart content is also supported. Collection( S_uniq_names_n S_values_n ) collection with translation dictionary (see also Replace( S_name_array k_translation_collection ). Collection( table_row )  returns a collection object for the table row. Collection( t[1] ) Collection( table {columnheaderall} )  converts table columns, header part or whole table to the collection Collection( tabletab_column format )  returns a collection object with the members controlling format, color and function for calculated columns. This collection can be modified and set back to the table or table column with the set format collection command . Example: add column t {1 2 3} {1 2 3} add column t function= "A+B" set format t.A "<i>%1</i>" show format t c = Collection(t.A format ) # modify c set format t.B c
[ Color from gradient  Color image  Color protein ] returns RGB values or color names. Summary:
Color ( as_n ballcpklabelskinsurfacewire ) → M_nx3_rgb
 returns an rgb matrix of colors for a particular representation (0. 0. 0. 0. means black or undisplayed )
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 [name] ) → S_colorHex_or_Names  returns sarray of color names in hex code, or, with option name , ICM colors approximating the rgb values in the matrix. The ICM color names and definitions are taken from the icm.clr file. Example: m = Matrix(3) Color(m ) # returns {"#ff0000","#00ff00","#0000ff"} Color(m name) # returns icm approximations {"red","lime","midnightblue"} Color( system )  returns sarray of system color names. Color( system i_numColor )  returns a name of a system color by number. Example: N = Nof( Color( system )) for i=1,10 print Color( system Random(N) ) # randomly pick one color endfor
Color( background )
Color( r_value s_gradient [ r_from r_to ] ) → R_3rgb  returns 3element rarray with RGB components describing the color and useful for the color .. rgb= command. 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.
Note that these colors are from the permanent part of the spectrum and are only approximately equal to transient colors resulting from the colorbyrainbowandvalue command like GRAPHICS.NtoCRainbow = "white/lightpink/red/darkred" R = Bfactor(a_/* ) color a_/* R//0.//100. # uses a perfect rainbow at a transient part of the spectrum Color( R "white/lightpink/red/darkred" 0. 100. ) # projects those colors to the 'named' part of the spectrum 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" )
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
Color( Ss_aa protein ) → Ss_aaHexColors Some tables may contain an amino acid (along with its position) in its cell, e.g. one may record amino acids around the binding site: add column t "D12"//"E13"//"K14" "D"//"A"//"L" show Color(t.A protein ) # returns sarray of colors for each value show Color(t.A[1] protein ) # returns string color, eg #AAFFFF for "D12" set format t.A color='Icm::Color(A protein)' # will color cells in the table. See also: set format
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 Consensus ( msrs ) surface accessible areas projected on the selected residues via linked sequence and alignment.
making a table with the contour lines of a 2D function represented by a matrix for display in the plot command. Contour( M [r_stepi_numContours [fmin,fmax]] [R_XsR_Ys] ) → T_contourData (X,Y,conn,Z) Example (UNFINISHED): M = 10.*Smooth(Smooth(Smooth(Matrix(100)))) tt = Contour(M,10,0.,5.) delete tt.Z == 0. sort tt.Z add column tt "_black line 0.5" name="mark" plot tt.X tt.Y tt.mark "/tmp/tmp.eps" append
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 R^{2} .
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( e^{iz} + 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. Summary:
Detailed descriptions:
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. Count ( IRS_array unique  identity ) → I returns an integer array with integer id for sequentially identical values. Example: group table t {"d","d","d","bb","bb","a","a","a"} add column t Count(t.A unique ) Count(t.A identity ) name={ "unique","identity" } show t #>T t #>Auniqueidentity d 1 1 d 1 2 d 1 3 bb 2 1 bb 2 2 a 3 1 a 3 2 a 3 3
CubicRoot( r ) → r_cubic_root CubicRoot( r [ r_im ] ) → R6_3re+3im Example: CubicRoot(27. ) 3. CubicRoot(27. 0.) #>R 3. 1.5 1.5 0. 2.598076 2.598076
See also: SolveCubic, Sqrt
Summary:
Date( n ) → e_arrayOf_n_currentDates returns an date array of current system date and time. Example: print "Today is :" Date() Date ( version ) → e_dateOfCompilation Date ( os ) → e_pdbDates returns the date of the pdb file creation in an date array format. The date read from the HEADER record of a pdb file and is stored with the object. Example: read pdb "1crn" if Date(a_) > Date("1980","%Y") print "released after 1980" Date ( {s_dateS_dates} [ s_format ] ) converts string or sarray to dates using s_format or default TOOLS.dateFormat Example: String( Date( "12 Oct 2002", "%d %b %Y" ) "%Y%m%d" ) The allowed format specifications are the following:
Example: String( Date() "%b %d %Y %I:%M%p" ) # Current date and time in American style String( Date() "%d/%b/%Y %H:%M" ) # European style
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 threedimensional structure. The default i_addFlanks parameter is 1. String options:
See example coming with the Insertion( ) function description.
Descriptor ( chemArray number )  returns table of various numerical descriptors of the following categories: # https://www.epa.gov/sites/production/files/201505/documents/moleculardescriptorsguidev102.pdf
Example: read table s_icmhome + "celebrex50.sdf" name="t" add column t Descriptor( t.mol number )
Descriptor ( chemArray ) Descriptor ( chemArray collection_of_Fingerprint_Parameters [info] )  returns vector of binary fingerprints, default or custom, calculated for each chemical. The collection_of_Fingerprint_Parameters argument is a collection which defines parameters for fingerprint generation and consists of the following members:
Examples: # export default binary fingerprints write sarray Sarray(Descriptor(t.mol)) name="fp.txt" # linear counted fingerprint, SIZE=1024, max chain length=5 Descriptor( t.mol, Collection("ATMAP" "cd,h" "SIZE" 1024 "BOMAP" "bt,r" "LEN" 5 "TYPE" "linear", "BINARY", no) ) # ecfp4 fingerprint Descriptor( t.mol, Collection("ATMAP" "cd,h" "SIZE" 2048 "BOMAP" "bt" "LEN" 999 "TYPE" "ecfp", "ECFPITER" 3, "BINARY", no) ) Example in which fingerprints returned by the function are directly used in distance calculation: add column t Chemical({"CCN","CCCN"}) mod = Collection() mod['FP'] = Descriptor( t.mol ) Distance(mod['FP'], Descriptor(Chemical("C(=O)CCN")))
Descriptor ( chemArray predModel )  returns vector of rarrays with chemical descriptors calculated for each chemical. each rarray consists of chemical fingerprint part and values for columns with formula used in the predModel. This information can be used for further analysis or exported outside ICM. Example: # assumes that 'clogPpred' is a prediction model tt = Table( Transpose( Matrix( Descriptor( Chemical("CCC"), clogPpred ) ) )) add column tt Name( clogPpred column ) sort reverse tt.A To find the description of the each particular position in the rarray Name function can be used. Example: rr = Descriptor( Chemical("CCC") myModel )[1] na = Name( myModel column ) for i=1,Nof(rr) if (rr[i] != 0) print rr[i], na[i] endfor
See also: Name( predModel, column .
determinant function. Det ( matrix )  returns a real determinant of specified square matrix. Examples: a=Rot({0. 0. 1.}, 30.) # Zrotation 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 n1 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 n1 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 "nonEuclidean 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:n1] # coordinate matrix [n,n1] 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 hierarchical  Distance Tanimoto  Distance chemset  Distance 2 matrices  Distance tether  Distance Dayhoff  Distance in alignment  Distance 2 alignments  Distance tree  Distance chemical ] generic distance function. Calculates distances between two ICMshell objects, bitstrings or molecular objects, or extracts distances from complex ICMshell objects.Distance( II  RR  as as  seq seq ) → r_dist Distance( Ss, s) → Rr Distance( ali ali [exact] ) → r Distance( S S [simple]) → M Distance( Sn_hier_codes Sm_hier_codes tree [ s_delimeter ]) → M_nm_0to1 Distance( Mnk ) → Mnn_cart_dist_between_rowvectors Distance( Mnk Mmk ) → Mnm Distance( M_xyzas M_xyzas r_dist ) → l_yes_if_closer_than_dist Distance( seq seq [identityevolutionnewfastnumberreverse] ) Distance( seq seq nucleotide [len] ) Distance( seqArr[n]> ) → <M_nn Distance( ali seq [string] ) → R_n_seq_in_ali Distance( seqArr[n]> <seq ) → R_n Distance( seqArr[n]> <seqArr[m]> ) → <M_nm Distance( as [r_default=1.] ) → R_tether_lengths_or_def Distance( as_n as_m ) → d_between_centers_of_mass Distance( as_n as_m all ) → R_nm Distance( as_n as_n rarray ) → R_n # aligned arrays, same n Distance( ali [0] ) → M_interSeqDist Distance( X_n [X_m] [pharmacophoresstructure] ) → M_nxm_chemical_Tanimoto_distances Distance( X_n X_m [[R_Wn R_Wm] r_maxdist (0.4) [r_steepness(6.)]] set ) → r_set1_2_distance Distance( bitvecArr[n]> <bitvecArr[m]> ) → <M_nm #tanimoto, see Descriptor function Distance( I_keys1 I_keys2 i_nBitsR_nbitWeights [simple] ) → M : Tanimotoweighted Distance( tree [i_at=1] split ) → r_splitLevel Distance( tree allmodify ) → R_splitLevelssplitLevelTStats Distance( g wiregrid [i_maxDist(1000000)>] ) → <M_shortestPaths Distance( d_0to1M evolution ) → dM_Dayhoff_correction_applied
See detailed descriptions below.
Distance ( iarray1, iarray2 )  returns the real sqrt of sum of (I1_{i} I2_{i} )^{2} .
Distance ( R_X, R_Y )  returns the real Cartesian distance between two vectors of the same length. D = Sum( ( X_{i}  Y_{i} )^{2} )
Distance ( as_1, as_2 [ all ] )  returns the real distance in Angstroms between centers of mass of the two specified selections. The interactive usage of this function: Option all will return an array of all cross distances between the selections. The selected virtual atoms will be skipped if the selection level residue, molecule or object. Othewise, if you explicitly select virtual atoms, they will be included, e.g. build string "ala" # contains 2 virtual atoms at N terminus build string "his" # also contains 2 virtual atoms at N terminus Distance( a_1. a_2. all ) # no virtual atom distances Distance( a_1.// a_2.// all ) # selected virtual atoms are included Distance( a_1. a_2. ) # a single distance between centers of mass
Distance ( as_1 , as_2, rarray )  returns the rarray of distances in Angstroms between the two specified selections containing the same number of atoms (11, 22, 33, ...).
See also: Distance ( as1 as2 all )
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 CaCa distances.
Distance( Sn_hier_codes Sm_hier_codes tree [s_delimeter]) → M_nm compares two arrays of hierarchical labels like this: "clan.family.subfamily.." The labels can be delimiter separated, or just strings of the same length where one positions is just one character (the default). Returns a distance matrix normalized to [0:1] range. Here are examples of classification codes that can be used:
Examples: add column t {"Cocaine","Betaxolol"} {"52:16.00","52:92.00"} show Distance(t.B t.B tree ":.") add column tt {"Cocaine","Betaxolol"} {"AB2","ABc"} show Distance(tt.B tt.B tree ) # use each character as level These distance matrices can be used for making 2D and 3D graphs, or to plot clustering trees of tables containint suitable label columns, eg see ds3D make tree object .
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 bitstring. 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 bitweight array then becomes the size of the bitstring. The weighted Tanimoto is calculated. See also:
Distance( X_n X_m [[R_Wn R_Wm] r_minScore (0.3) [r_steepness(6.)]] set ) → r_distance [0:1] retuns a real effective distance between two chemical sets. It is equal to 1  r_similarity defined by function Score(X1,X2,..set) 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 Cas of the two fragments.
Distance( M_xyz1as1 M_xyz2as2 r_dist ) → l_yes_if_closer_than_dist
This function returns a logical yes if any two points or atoms in two sets of coordinates or selections are closer
than the threshold.
is a more efficient version of this condition:
if Nof( Sphere( as1 as2 r_dist )) > 0
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 [identityevolutionnewfastnumberreverse] ) → r Distance( r_dist_0_to_1M_dist ) → rM_Dayhoff_corrected_distances to [0.:10.]
Distance( seqArr[n] seq ) → R_n Distance( d_0to1M evolution ) → dM_Dayhoff_correction_applied  returns the real measure of difference 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. The last function ( Distance( dM evolution ) allows to apply Dayhoff correction that extends a distance from 0. to 1. to a range 0. to 10. to take into acount the evolutionary time correction (stretching) at larger distances because. See also: Distance ( ali ) for distance and seq.identity matrices.
Distance ( alignment ) → M_nxn Distance( seqArr_n ) → M_nxn Distance( seqArr_n seqArr_m ) → M_nxm  returns matrix of pairwise sequencesequence distances in the alignment. These distances are calculated with the fast option as follows
Example: read alignment msf s_icmhome+"azurins" # read azurins.msf NormCoord = Disgeo(Distance(azurins)) # 2D sequence diversity in # # calculate pairwise sequence identities read alignment "aln" name="aln" n=Nof(aln) mids = 100*(Matrix(n,n,1.)  Distance(aln )) # the pairwise seq. identities t = Table( mids, Name(aln), Name(aln) ) # to convert the matrix into pairwise table t = Table( mids, index ) # a simpler version with i,j
Distance ( ali_1 ali_2 [ exact ] )
 returns the real distance between two alignments formed by the same sequences.
show a1 # La1 = 3 ABCXYZ 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 s_icmhome+"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 [pharmacophore] )  return square matrix of chemical distances. The chemical distance is defined as the Tanimoto distance between binary fingerprints Option pharmacophore uses different fingerprints based on ph4type triplets. Example: Distance( Chemical( { "CCC", "CCO"} ) ) Distance( chemarray1 chemarray2 [pharmacophore] )  return a MxN matrix where M is number of elements in chemarray1 and N is number of elements in chemarray2 Option pharmacophore uses different fingerprints based on ph4type triplets. Example: Distance( Chemical({ "CCC", "CCO"}) Chemical("CC" )) Zero distance for nonidentical compounds.Sometimes nonidentical compounds can give a zero fingerprint distance due to the limitations inherent in finite length fingerprints. To make the distance more representative, one can mix different types of distances, e.g. for two chemical arrays X1 and X2 Mdist = Distance( X1, X2 ) + 0.1*Distance(X1,X2, pharmacophore)
See also: find table find molcart other chemical functions
eigenvalues/eigenvectors function, eigendecomposition of a square diagonal matrix. Eigen ( M ) → X_eigenVectorColums and R_out with eigen values  returns the square matrix ( n x n ) of eigenvector columns of the input symmetric square matrix M_ . All n eigenvalues sorted by their values are stored in the R_out rarray.
Eigen value decomposition is be given by three matrices: X, Matrix(3,R_out) and Power(X,1)
# create a symmetric real matrix which describes a transformation read matrix name="A" input=""" 2. 0.6 0.5 0.6 4. 0.3 0.5 0.3 6. """ X = Eigen(A) # calculate eigenvectors... V = R_out # and save eigenvalues in rarray V L = Matrix(3,V) # diagonal matrix with eigen values # note that now A can be reproduced by this calculation : X*L*X^^1 show A, X*L*Power(X,1) # Eigenvectors are X[?,1], X[?,2], X[?,3] show X[?,1] # 1st eigenvector
function. Energy ( string )  returns the real sum of precalculated energy and penalty (i.e. geometrical restraints) terms specified by the string. Important: this function does NOT calculate the energy, the terms must be calculated beforehand by invoking one of the following commands where energy is calculated at least once: show energy, minimize, ssearch command and montecarlo command. Note:
Energy ( rs [ simple  base  s_energyTerms ] )  in contrast to the previous function this function with an explicit residue selection calculates and returns residue energies in an ICM object. convert the object if is not of the ICM type. The energies are calculated according to the current energy terms , and also depend on the fixation of the object. Note: Use unfix only V_//S,V before the function call for standard fixation. This function can be used to evaluate normalized residue energies for standard aminoacids to detect local problems in a model. For normalized energies, use the simple option. The base option just shifts the energy value to the mean energy for this residue type. If the simple or base terms are not used, the current energy terms are preserved. The energies calculated with the simple or base option are calculated with the "vw,14,hb,el,to,en,sf" terms. The terms are temporarily enforced as well as the vwMethod = 2 and vwSoftMaxEnergy values, so that the normalization performed with the simple option is always correct. Do not forget to build string "ASDF" unfix only V_//S,V add column t Name(a_/A full) Energy( a_/A simple ) Energy( a_/A base ) show t This function will calculate residue energies for all terms and setups with the following exceptions:
The s_energyTerms argument allows one to refine the energy terms dynamically (see example below). Example: read pdb "1crn" delete a_W convert set terms "vw,14,hb,el,to,en,sf" group table t Energy( a_/A ) "energy" Label(a_/A ) "res" show t unfix V_//* group table tBondsAngles Energy( a_/A "bs,bb" ) "covalent" Label(a_/A ) "res" show tBondsAngles See also: the calcEnergyStrain macro. Energy ( conf i_confNumber)  returns the table of all the energy components for a given stack conformations. The table has two arrays:
Energy ({ stack  conf } )  returns the rarray of total energies of stack conformations. Useful for comparison of spectra from different simulations. Examples: read object s_icmhome+"crn.ob" set terms only "vw,14,hb,el,to" # set energy terms show energy v_//xi* # calculate energy with only # side chain torsions unfixed # energy depends on what variables are fixed since # interactions inside rigid bodies are not calculated, # and rigid body structure depends on variables a = Energy("vw,14") # a is equal to the sum of two terms electroMethod="MIMEL" # MIMEL electrostatics set terms only "el,sf" # set energy terms show energy print Energy("ener") # total energy print Energy("sf") # only the surface part of the solvation energy print Energy("el") # electrostatic energy print r_out # electrostatic part of the solvation energy
Entropy( R_frequencies ) → r_entropy Entropy( R_energies r_RT_energy ) → r_entropy Entropy( seq [simpleR_26aa_prob] ) → r_entropy returns energy calculated as âˆ‘_{i} p_{i} Log(p_{i)} where p_{i} probabilities are calculated either as normalized R_frequencies or exp( (EE_min)/ r_kT_energy ) factors. If the frequency array contains only one element it is considered as the first probability of an array of two probability that should add up to 1., ie {0.2} is interpreted as {0.2, 0.8}. The sequence entropy is calculated according to the residue probability from a standard amino acid frequency table. You may substitute it with your own array of 26 numbers. Option simple assumes residue frequencies to be 1/20. Notes:
Examples: Entropy({0.5, 0.5}) # 0.693147, two equiprob. states Entropy({0.2}) # 0.500402, two states: p=0.2 and p=0.8 Entropy({0.2, 0.2, 0.2}) # 1.09861 three states, Entropy({10.2, 0.2, 0.2, 0.2}) # 0.275593 one estates dominates # below the numbers are interpreted as energies, and 1.4 is a temperature factor. Entropy({30., 28., 31., 15.}, 1.4) # 0.848429. Î”Es divided by 1.4, exponentials used to calc probs. Entropy({30., 28., 31., 15.},100.) # 1.38432 at this high temperature 4 states are almost equiprobable.
function indicates that the previous ICMshell command has completed with error. Error  returns logical yes if there was an error in a previous command (not necessarily in the last one). After this call the internal error flag is reinstalled to no. The shell error flag can be set to yes with the set error command.
Error ( string )
read pdb "1mng" # this file contains strange 28th residue if (Error) print "These alternative positions will kill me" read pdb "1abcd" # file does not exist read pdb "1mok" clear errorSee also: errorAction , s_skipMessages , l_warn, Warning Error ( r_x [ reverse ] )  returns real complementary error function of real x : erfc(x)=1.erf(x)) , defined as (2/sqrt(pi)) integral{x to infinity} of exp(t^{2}) dt or its inverse function if the option reverse is specified. It gives the probability of a normally distributed (with mean 0. and standard deviation 1./Sqrt(2.)) value to be larger than r_x or smaller than r_x. Examples: show 1.Error(Sqrt(0.5)) # P of being inside +sigma (about 68%) show Error(2.*Sqrt(0.5)) # P of being outside + 2 sigma Error ( R_x )  returns rarray of erfc(x)=1.erf(x)) functions for each element of the real array (see above). Examples: x=Rarray(1000 0. 5. ) plot display x Error(x ) {0. 5. 1. 1. 0. 1. 0.1 0.2 } plot display x Log(Error(x ),10.) {0. 5. 1. 1.} #NB: can be approximated by a parabola #to deduce the appr. inverse function. #Used for the Seq.ID probabilities.
Error( soapMessage )  returns a error string from the SOAP message. (empty string if no error) This function is used the check the result of calling SOAP method. See: SOAP services for more details and examples.
[ Existpattern  Exist molcart ] function indicates if an ICMentity exists or not.Exist ( s_fileName [ write  read  directory ] )  returns logical yes if the specified file or directory exists, no otherwise. Options:
Exist( collection s_fieldname ) Checks if the field exists, e.g. c = Collection(); c['a']=123 Exist(c,'a') # yes Exist(c,'b') # no
Exist ( key, s_keyName )
 returns logical yes if the specified keystroke has been previously defined. Examples:
Exist(key, "F1" , Exist( key, "CtrlB" )
See also: set key command.
Exist ( grob display )
 returns logical yes if the grob is displayed.
Exist( s_table_name sql table )  returns logical yes if there is an sql table with the specified name exists. It works with the Molcart tables or tables accessed via the Sql function.
Exist( variable s_varName )
 returns yes if the variable exists in the ICM shell, no otherwise. See also Type( Exist(variable, "aaa") # returns no aaa=234 Exist(variable, "aaa") # returns yesExamples: if (!Exist("/data/pdb/") then unix mkdir /data/pdb endif if(!Exist(key,"CtrlB")) set key "CtrlB" "l_easyRotate=!l_easyRotate" if !Exist(gui) gui simple Exist( chemarray pattern ) returns logical yes if at least one of the elements contains SMARTS search attributes, no  otherwise. Example: Exist( Chemical("[C&H1,N]") pattern ) # returns yes Exist( Chemical("CCO") pattern ) # return no
Exist( s_dbtable sql table )  returns logical yes if the specified table exists in the database See also: molcart
function indicating if an UNIXshell environmental variable exists. Existenv ( s_environmentName )  returns logical yes if the specified named environment variable exists. Example: if(Existenv("ICMPDB")) s_pdb=Getenv("ICMPDB")See also: Getenv( ), Putenv( ) .
function. Extension ( string [ dot ] )  returns string which would be the extension if the string is a file name. Option dot indicates that the dot is excluded from the extension. Extension ( sarray [ dot ] )  returns sarray of extensions. Option dot indicates that the dot is excluded from the extensions. Examples: print Extension("aaa.bbb.dd.eee") # returns ".eee" show Extension({"aa.bb","122.22"} dot) # returns {"bb","22"} read sarray "filelist" if (Extension(filelist[4])==".pdb") read pdb filelist[4]
exponential mathematical function (e^{x}). Exp ( real )  returns the real exponent. Exp ( rarray )  returns rarray of exponents of rarray components. Exp ( matrix )  returns matrix of exponents of matrix elements. Examples: print Exp(deltaE/(Boltzmann*temperature)) # probability print Exp({1. 2.}) # returns { E, E squared }
[ Field user ] function.Field ( s [ s_precedingString] i_fieldNumber [ s_fieldDelimiter] )  returns the specified field. Parameter s_fieldDelimiter defines the separating characters (space and tabs by default). If the field number is less than zero or more than the actual number of fields in this string, the function returns an empty string. The s_fieldDelimiter string Single character delimiter can be specified directly, e.g. Field("a b c",3," ") # space Field("a:b:c",3,":") # colonAlternative characters can be specified sequentially, e.g. Field("a%b:c",3,"%:") # percent OR colonMultiple occurrence of a delimiting character can be specified by repeating the same character two times, e.g. Field("a b c",3," ") # two==multiple spaces in field delim Field("a%b::::c",3,"%::") # a single percent or multiple colonsYou can combine a singlecharacter delimiters and multiple delimiters in one s_fieldDelimiter string. More examples: s=Field("1 ener glu 1.5.",3) # returns "glu" show Field("aaa:bbb",2,":") # returns "bbb" show Field("aaa 12\nbbb 13","bbb",1) # returns "13" show Field("aaa 12\nbbb 13 14","bbb",2," \n\n") # two spaces and two \n . # another example read object s_icmhome+"all" # energies from the object comments, the 1st field after 'vacuum' show Rarray(Field(Namex(a_*.),"vacuum",1)) Field ( S , [ s_precedingString] i_fieldNumber [ s_fieldDelimiter] )  returns an string array of fields selected from S_ string array . s_fieldDelimiter is the delimiter. If the field number is less than zero or more than the actual number of fields in this string, an element of the array will be an empty string. Examples: show Field({"a:b","d:e"},2,":") # returns {"b","e"} s=Field({"aa 2 3.3", "bb 4 1.3", "cc 31a 1.1 3"},2) # returns {"2","4","31a"} s=Field({"aa 2 3.3", "bb 4 1.3", "cc 31a 1.1 3"},4) # returns {"","","3"}See also: Split( ).
Field( asrsmsos [s_fieldName] ) Field( { rs  ms  os } [ i_fieldNumber ] ) Field( os 15 )
read object s_icmhome+"crn.ob" set field a_//* Random(0.,1.,Nof(a_//*)) show Field( a_//* ) read pdb "1f88" # rhodopsin, many loops missing Field( a_ 15) # returns 31. residues Field( a_ "pmid") # iarray[1] with pubmed id, automatically created by read pdb set field a_/10,14,21 name="pocket" display cpk Field ( a_/* "pocket" ) Residues, molecules and objects. Three user fields can be defined for each residue and up to 16 for molecules and objects. To extract them specify i_fieldNumber . The level of the selection determines if the values are extracted from residues, molecules or objects. Use the selection level functions Res Mol and Obj to reset the level if needed. For example: Res(Sphere(gg, a_1. 3.)) selects residues of the 1st object which are closer than 3. A to grob gg . Upon reading a pdb file the object field 15 contains the number of residues missing from the ATOM records, but present in SEQRES records due to local disorder. Example: read object s_icmhome+"crn.ob" set field a_/A Random(0.,1.,Nof(a_/A)) number = 2 # set the 2nd field to random values GRAPHICS.atomRainbow= "yellow/green/blue/blue" # optional redefenition of colors color a_/* Field( a_/A 2 ) # color by it Standard fields:
See also:
function returning file names or attributes of named files. File ( os ) returns the name of the source file for this object. If the object was created in ICM or did not come from an object or PDB file, it returns an empty string. Example: read pdb "/home/nerd/secret/hiv.ob" File( a_ ) /home/nerd/secret/hiv.ob File ( s_file_or_dir_Name "length" )  returns integer file size or 1. File ( s_file_or_dir_Name "time" )  returns integer modification time or 1. Useful if you want to compare which of two files is newer. File ( icm_object )  returns string file name from which this object has been loaded or empty string. File ( s_file_or_dir_Name )  returns string with the file or directory attributes separated by space. Note that this function will only work on Unix or Mac, see a`Exist ( s_file .. ) function for crossplatform functions. If file or directory do not exist the function returns "    0" Otherwise, it contains the following 4 characters separated by space and the file size:
Example: if File("/opt/icm/icm.rst")=="    0" print "No such file" if Field(File("PDB.tab"),2)!= "w" print "can not write" if ( Indexx( File("/home/bob/icm/") , "d ? w x *" ) ) then print "It is indeed a directory to which I can write" endif # Here the Indexx function matched the pattern. if ( Integer(Field(File(s_name),5)) < 10 ) return error "File is too small" File ( last ) returns the file name of the last icmshell script called by ICM. In scripts File(last) can be used for the Help section. See also: Path ( last ) File ( T_IndexTable database ) returns the file name of the first source file indexed. Example: read index "nci" File( nci database) /data/chem/nci.sdf
[ Find in array  Find in table  Find chemical ] function searching all fields (arrays) of a table, and to search patterns in sequences or their names.
Find ( R_source r_value ) Find ( I_source i_value )  returns index of the source array element which is closest to the value Example: Find( {10 20 30 40 50} 43 ) #will return 4 because 40 is the closest value Find( {1. 2. 3.} 100. ) #will return 3 See also: Index
Find ( table s_searchWords )
(t.a=="word1"  t.b == "word1") & (t.a=="word2"  t.b == "word2"). Examples: read database "ref.db" # database of references group table ref $s_out # group created arrays into a table show Find(ref,"energy profile") & ref.authors == "frishman" Find ( table s_pattern regexp )  returns table containing the entries where at least one text column matches s_pattern. Examples: add column t { "one" "two" "three" } {"Item1", "Item2" "Item3" } Find( t "Item[12]" regexp ) # matches first two rows Find( t "twothree" regexp ) # matches last two rows
[ Findseq ] Find( mol_array, array_of_chemical_patterns S_labels ) Find( mol_array, table_with_chemical_patterns ) returns a 'sarray of chemicalpattern labels found in the mol_array. If the table argument is provided as the source of the chemical patterns, the function will look for two columns:
Example: Find( chemTable.mol, Chemical( {"c1ccccc1", "[CH3]"} ), {"benzene", "methyl"} ) # or group table t Chemical( {"c1ccccc1", "[CH3]"} ) "mol" {"benzene", "methyl"} "label" Find( chemTable.mol, t ) See also: Index chemical Nof find table find molcart returns an sarray of sequence names in which the sequence matched the pattern, e.g. make sequence 10 # generates 10 random sequences Find( "*A?[YH]*" sequence ) Find( sequence s_seq_name_pattern ) searches the pattern in sequence names rather than sequences.
rounding function. Floor ( r_real [ r_base ] )  returns the largest real multiple of r_base not exceeding r_real. Floor ( R_real [ r_base] )  returns the rarray of the largest multiples of r_base not exceeding components of the input array R_real. Default r_base= 1.0 . Hint: for rounding numbers you can use Floor( value + 0.5 ) Example: rr = { 0.1, 0.5, 1.2, 1.7 } Floor( rr + 0.5 ) See also: Ceil( ).
Formula( chemarray )  returns the sarray of compounds' molecular formulas.
function returning the value for an argument to ICM or an icmscript. If one runs icm directly, specify arguments after the a option, e.g. icm s a t=2 verbose c='some text' # three arguments passed to icm icm_script t=2 verbose c='some text' # three arguments passed to icm_script A summary of the Getarg functions:
if Getarg(help) quit HELP mid = Getarg( "mid",no,delete) # logical files = Getarg(list,delete) # all args without '' files = Getarg(input,delete) # file names (undashed args), appended with 'keep' and stdin if necessary outfiles = Getarg(output,delete) # file names files = Getarg(mol,delete) # same for .sdf* files c=Collection() c["a" ] = Getarg("a",test) # logical to activate the option c["a_params" ] = Getarg("a","10:30",delete) # defaults and params c["m"]=Getarg("m",test); c["mfrto"] = Getarg("m","100:500",delete)
Getarg ( s_icmargName [s_default] [ delete ] ) Getarg ( s_int_argName [i_default] [ delete ] ) Getarg ( s_real_argName [r_default] [ delete ] ) Getarg ( s_log_argName [l_default] [ delete ] ) If the default value is provided, the returned object is cast to default value's type. Else the function tries to guess the return type based on the value format. If the default value is of logical type, the function returns the opposite value if the argument is found in the list. e.g. Getarg("x",yes) will return no if the option was specified). for icm or icmscript arguments like name returns a string with "yes". For argument name=value returns the argument value converted according to the default value. The default value is be returned if the argument is not specified. Option delete extracts the variable from the list. Getarg( ) returns a concatenated list (`string) of all arguments prepared for interpretation by a Unix shell. This is convenient for passing arguments further to a nested script. Trim(Getarg(),all) will return the empty string if no arguments are found. Getarg( listkeep [delete] ) returns sarray of nonoption arguments (usually they are file names). Option keep adds the "stdin" for dash or no arguments, and adds keyword keepto keep the file open for multiple 'chunk' access to it. Getarg( name ) returns sarray of argument names Getarg( set ) returns sarray of argument values Getarg( delete ) deletes all arguments and returns the number of them Testing if the argument exists Getarg( s_argName [findtest] ) returns yes if the argument can be found in the list in any form. Getarg( s_argName [name] ) returns yes if the argument is in the list as the name only (rather than the name=value pair). E.g. verbose will return yes, and verbose=2.3 will return no. Getarg ( i_pos gui ) returns string which contain a user input after GUI dialog execution using Askg function. Examples :
if Getarg("L" find) print "L was found" t = Getarg("time","1.",delete) s = Getarg("sequence","ABC") Getarg("L" yes ) # returns no in this case, yes is the default Getarg("L" no ) # returns yes since no was the default args = Getarg(name) wrongArgs = NotInList({"s","t"} ,args) if wrongArgs print " error> illegal arguments ", Sum(wrongArgs)The example above may be called from the shell like: > icm a time=1.5 sequence="ADEGFKL" L file1 file2 An example with an icm script: > cat script.icm #!icm s x=Getarg("x","3") y=Getarg("y","a b c") show x,y > script.icm x=33 y="d e" 33, "d e" An example of dialog input: buf = "#dialog{\"Select InSilco Models\"}\n" buf += "#1 s_Some_Input (some text)\n" buf += "#2 l_Check (no)\n" buf += "#3 i_Number (4)\n" Askg( buf ) # run the dialog print Getarg( 1 gui ) Getarg( 2 gui ) Getarg( 3 gui ) Another example with a text box txw_ spec : #dialog{ "Sample Dialog" } # txw_Enter_Text () txt = %s_out # s_out is not a safe place (might be overwritten) print Length(txt) See also Putarg , Getenv, script .
function returning value for an environment name. Getenv ( s_environmentName [s_default] )  returns a string of the value of the named environment variable. If the default string is provided, it is used if the variable is not found. Example: user = Getenv("USER") # extract user's name from the environment if (user=="vogt") print "Hi, Gerhard" Getenv("HOME","you are homeless :(") # use default if HOME is not found /home/ruben/ Getenv("HOME_MISSPELLED","you are homeless :(") you are homeless :( Getenv("HOME_MISSPELLED") # errorSee also: Existenv( ), Putenv( ) .
function. Gradient( )  returns the real value of the rootmeansquare gradient over free internal variables. Gradient ( vs_var )  returns the rarray of precalculated energy derivatives with respect to specified variables. Gradient ( as  rs )  returns the rarray of precalculated energy derivatives with respect to atom positions (G[i] = Sqrt(Gxi*Gxi+Gyi*Gyi+Gzi*Gzi)) The function returns atomgradients for atom selection ( as_ ) or average gradient per selected residue, if residue selection is specified ( rs_ ). You can display the actual vectors/"forces" (Gxi, Gyi, Gzi) by the display gradient command. Important: to use the function, the gradient must be precalculated by one of the following commands: show energy, show gradient, minimize .
read object s_icmhome+"crn.ob" show energy # to calculate the gradient and its components if (Gradient( ) > 10.) minimize show Max(Gradient(a_//c*) # show maximum "force" applied to the carbon atoms
function to generate graphics objects. Grob( M_NxM )
 returns grob for 3D surface function: X=i,Y=j,Z=~~M_NxM
 returns grob of dots with xyz from M_Nx3_xyz Grob( M_Nx3_xyz r_ra ball )  returns grob of spheres with centers from M_Nx3_xyz  returns grob of dots with xyz from M_Nx3_xyz and radius r_ra
Grob ( "arrow", { R_3  R_6 } )
GROB.relArrowSize = 0.1 g_arr = Grob("arrow",Box( )) # return arrow between corners of displayed box display g_arr red # display the arrow g_arr1 = Grob("ARROW100",{1. 1. 1.}) display g_arr1 Grob ( "cell", { R_3  R_6 } )  returns grob containing a wire parallelepiped for a given cell. If only R_3 is given, angles 90.,90.,90. are implied. Grob ( "CELL", { R_3  R_6 } )  returns grob containing a solid parallelepiped for a given cell. If only R_3 is given, angles 90.,90.,90. are implied. Example: read csd "qfuran" gcell = Grob("CELL",Cell( ) ) # solid cell display a_//* gcell transparent # fancy stuff Grob ( "distance", as_1 [ as_2 ] )  returns grob with the distance lines. This grob can be displayed with distance labels (controlled with the GRAPHICS.displayLineLabels parameter). With one selection it returns all possible interatomic distances within this selection. If two selections are provided, the distances between the atoms of the two sets are returned. Example: build string "se ala his trp" g = Grob( "distance", a_/1/ca a_/2/ca ) display g GRAPHICS.displayLineLabels = no display new Grob ( "label", R_3, s_string )  returns grob containing a point at R_3 and a string label. Grob ( "line", R_3N )  returns grob containing a polyline R_3N[1:3], R_3N[4:6], ... Example: display a_crn.//ca,c,n g = Grob("line",{0.,0.,0.,5.,5.,5.}) # a simple line (just as an example) display g yellow gCa = Grob("line",Rarray(Xyz(a_//ca))) # connect Cas with lines display gCa pink # display the grobs Grob ( "SPHERE", r_radius i_tesselationNum )  returns grob containing a solid sphere. The i_tesselationNum parameter may be 1,2,3.. (do not go too high). Example: display a_crn.//ca,c,n # make grob and translate to a_/5/ca # Sum converts Matrix 1x3 into a vector g=Grob("SPHERE",5.,2)+Sum(Xyz(a_/5/ca)) # mark it with dblLeftClick and # play with AltX, AltQ and AltW display g red
Grob ( "TORUS", r_radius r_radius2 [R_normalVector] [i_quality] )  returns grob containing a solid torus. Grob ( "ELLIPSOID", r_radius r_radius2 [R_normalVector] [i_quality] )  returns grob containing a solid ellipsoid. Grob ( "CYLINDER", r_radius r_height [R_normalVector] [i_quality] )  returns grob containing a solid cylinder. Example t = Grob("TORUS", 1.2 0.2 ) e = Grob("ELLIPSOID" 1 0.4 ) display smooth t red display smooth e blue Example (display plane of the phenyl ring) build smiles "(CC(C)Cc1ccc(cc1)C(C)C([O])=O)" display xstick a_ find chemical a_ "c1ccccc1" # result is stored into as_out n = Normalize(Vector( Rarray(Xyz(as_out[2])Xyz(as_out[1])) Rarray(Xyz(as_out[3])Xyz(as_out[1])) ),"euclidean" ) # normal gr_plane = Grob( "CYLINDER", 2. 0.05, n ) + Mean( Xyz( as_out )) display smooth transparent gr_plane Grob( grob R_6rgbLimits ) returns a grob containing selection of vertices of the source grob. The vertices with colors between the RGB values provided in the 6dim. array of limits will be selected. The array of limits consists of real numbers between 0. and 1. : { from_R, to_R, from_G, to_G, from_B, to_B } If you want a limit to be outside possible rgb values, use negative numbers of numbers larger than 1., e.g. a selection for the red color could be: {0.9,1.,0.1,0.1,0.1,0.1} The grob created by this operation has a limited use and will contain only vertices (no edges or triangles). This form of the Grob function can be used to find out which atoms or residues are located to spots of certain color using the Sphere( grob as_ ) function. Example: build string IcmSequence("ADERD") # a peptide dsRebel a_ no no g=Grob(g_electro_def_ {0.9,1.,0.1,0.1,0.1,0.1} ) # red color display g_electro_def_ transparent display g show Res(Sphere( g, a_//* 1.5)) See also: color grob by atom selection, and GROB.atomSphereRadius .
Group ( R_n_atoms as_n_atoms "min""max""avg""rms""sum""first" ) → R_resArray Group ( I_n_atoms as_n_atoms "min""max""avg""sum""first" ) → I_resArray
Group ( as_atomSelection "count" ) → I_resArrayOfNat
Example: read pdb "1crn" show Group( a_A//* "count" ) # numbers of atoms in residues show Group( Mass( a_A//* ) , a_A//* "sum" ) # residue masses show Group( Mass( a_A//* ) , a_A//* "rms" ) # residue mass rmsd
Header ( os ) returns sarray with the PDB entry information stored in the requested objects. PDB entry information is stored in objects in HTML format. Use Header( os1_ )[1] for a single string. In order to be able to access the additional information in the objects' header, they should be read from PDB using the read pdb command with the header option. Notice that if the object was read with the read pdb html option the header will be in html format, while it if the header option was used instead, the entire header will be stored as is. Example: read pdb "1crn" html h1 = Header( a_1crn. )[1] set property h1 html See also read pdb .
function to create a histogram of an array. Function returns matrix [ n,2], where n is number of cells, the first row contains a number of elements in each cell and the second row contains midpoints of each cell. Histogram (I_inputArray )  returns matrix with a histogram of the input array. Histogram ( R_inputArray, i_numberOfCells [, R_weights ] )  returns histogram matrix [ i_numberOfCells,2] in which the whole range of the R_inputArray array is equally divided in i_numberOfCells windows. An array of point weights can be provided. Histogram ( R_inputArray, r_cellSize)  returns matrix [ n ,2], dividing the whole range of R_inputArray equally into r_cellSize windows. Histogram ( R_inputArray, r_from, r_to, r_cellSize )  returns matrix [ n,2], dividing into equal cells of r_cellSize between minimum value, maximum value. Histogram ( R_inputArray, R_cellRuler [, R_weights ] )  returns matrix [ n,2], dividing the range of the input array according to the R_cellRuler array, which must be monotonous. An array of R_weights of the same size as the input array can be provided. Examples: plot display Histogram({ 2, 2, 3, 10, 3, 4, 2, 7, 5, 7, 5}) BAR a=Random(0. 100. 10000) u=Histogram(a 50) s_legend={"Histogram at linear sampling curve" "Random value" "N"} plot display regression BAR u s_legend a=Random(0. 100. 10000) b=.04*(Count(1 50)*Count(1 50)) u=Histogram(a b) s_legend={"Histogram at square sampling curve" "Random value" "N"} plot display BAR u s_legend b=Sqrt(100.*Count(1 100)) s_legend={"Histogram at square root sampling curve" "Random value" "N"} plot display green BAR Histogram(a b) s_legend
[ Iarray making  Iarray inverse  Iarray bits to integers  Iarray atom numbers  Iarray residue numbers  Iarray stack ] function to create/declare an empty iarray or transform to an iarray. Summary: Iarray( [i_n=0 [i_default=0]] )Iarray( RSI ) → I Iarray( I reverse ) → I_reverseOrder Iarray( I key ) → I_compress01intoInts # obsolete Iarray( stack ) → I_nofVisits Iarray( as ) → I_atomCodes Iarray( as topology ) → I_atomSymmetryNumbers Iarray( rsmsos ) → I_nAtomsInEachResMolObj
Iarray ( i_NumberOfElements [ i_value ] )  returns iarray of i_NumberOfElements elements set to i_value or zero. You can also create an zerosize integer array: Iarray(0) . Iarray ( rarray )  returns iarray of integers nearest to real array elements in the direction of the prevailing rounding mode magnitude of the real argument. Iarray ( sarray )  converts sarray into an iarray. Examples: a=Iarray(5) # returns {0 0 0 0 0} a=Iarray(5,3) # returns {3 3 3 3 3} b=Iarray({2.1, 4.3, 3.6}) # returns {2, 4, 4} c=Iarray({"2", "4.3", "3.6"}) # returns {2, 5, 3}
Iarray ( iarray reverse )  converts input real array into an iarray with the reversed order of elements. Example: Iarray({1 2 3} reverse) # returns {3 2 1} See also: Sarray( S_ reverse ), Rarray( S_ reverse ), String(0,1,s)
Iarray( I_nBitVector key )  returns a shorter vector of integers if n/32 elements, in which every 32 array values of zeros and nonzeroes are compressed into one integer. The number of elements n does not need to be a multiple of 32, the missing elements will be assumed to be zero. Example: Iarray({1 0 1 0 0 0 0},key) # returns {5} Iarray({1 1 1 0 0 0 0},key) # returns {7} See also:
 returns iarray of relative atom numbers in a single object. This iarray can be saved and later reapplied with the Select ( os_ I ) function. If you selection covers more than one object, the function returns an error. Example: build string "se ala" ii = Iarray( a_//c* ) # returns {6,8,12} Select( a_ ii ) # returns three carbons
 returns iarray of residue numbers for an input selection. Example: build string "ala glu" Iarray( a_/ number ) # residue level Iarray( a_// number ) # atom level
Iarray( stack )  returns the iarray of the numbers of visits for each stack conformation. This is the same number as shown by the nvis> line of the show stack command. Example: show stack iconf> 1 2 3 4 5 ener> 15.3 15.1 14.9 14.8 13.3 rmsd> 84.5 75.3 6.4 37.2 120.8 naft> 3 0 4 0 2 nvis> 10 9 8 1 4 Integer(stack) # returns { 10 9 8 1 4 }
creates a "sequence" for an ICM molecular object. Output is in icm.se file format. IcmSequence ( { sequence  string  rs }, [ s_NTerm, s_CTerm ] )  returns multiline string with full (3char.) residue names which may be a content of an icm.se file. The source of the sequence may be one of the following:
Rules for oneletter coding:
If the source of the icmsequence is a 3D object, the proline ring puckering is analyzed and residue name prou is returned for the upprolines (the default is pro ). The Nterminal and Cterminal groups will be added if their names are explicitly specified or an oxt atom is present in the last residue of a chain. Here are the possibilities for automated recognition of Cterminal residue: IcmSequence( a_/* ) # Cterminal residue "cooh" will be added if oxt is found IcmSequence( a_/* "","" ) # no terminal groups will be added IcmSequence( a_/* "","@coo" ) # "coo" will be added only if oxt is found IcmSequence( a_/* "nh3+","coo" ) # "nh3+" and "coo" will always be added The resulting string can be saved to a ICM molsequence file and further edited for unusual aminoacids (see icm.res ). Examples: write IcmSequence(seq1) "seq1.se" # create a sequence # file for build command show IcmSequence("FAaSVMRES","nh3+","coo") # one peptide with Dala show IcmSequence("FAAS.VMRES","nter","cooh") # two peptides show IcmSequence("AA;MRES","nter","cooh") # two peptides read pdb "2ins" write IcmSequence(a_b,c/* ,"nter","@cooh") "b.se" # .se file for b # and c chainsIn the last command the ampersend means that the Cterminal residue will only be added if an oxt atom is present in the last residue. There is a build string command to create a single or multiple chain peptides. Example: build string "SDSRAARESW;KPLKPHYATV" # two 10res. peptides See also icm.se for a detailed description of the ICMsequence file format.
Image( slides )  returns the image array containing slide thumbnails. E.g. group table t Image( slideshow.slides ) Image( grob texture )  returns the image array with textures stored in the grob see also set texture Image( images i_newWidth i_newHeight [s_method] ) returns array with resized images. By default uses high quality but slow algorithm. Other algorithms are available by specifying the scaling method:
Image( i_width i_height [s_color ("black")] ) returns an image with the specified sizes and of the specified color. May be useful for blending images with a certain color (the default value is 'black'). Example: I = Sum( Image(100,60,"red"), Image(100,60,"#00FF00") ) Image( X_chemarray [i_width] [i_height] [s_displayOptions] ) returns an image array with 2D depictions of chemicals. Optionally you can specify width, height and display options See also: image parray, Sum image, Color image write image chemical
returns InChI International Chemical Identifier. InChi( X_chem [key] ) → S_InChi_or_InChiKey Example: InChi(Chemical("CC(C)Cc1ccc(cc1)C(C)C(O)=O")) add column t InChi(t.mol key) name="InChiKey" See also: Chemical
[ Index fork  Index chemical  Index string  Index regexp  Index table selection  Index table label  Index unique elements  Index element in array  Index tree  Index compare  Index atom map ] family of functions. It returns either an integer or an integer array of indices in an array or a table. Summary:
Index( sseq sseq_sub [i_skiplast] ) → i_posSubInStr Index( sS_source[n]> <sS_pattern[n]> exactsimpleregexp [<i_start] ) → I_pos[n] # length for regexp match is in i_outI_out Index( S s regexp all ) → I_matchedPos Index( Sn s {regexpexact} ) → In_indexInEachElement Index( ali seq ) → i_posSeqInAli Index( ali {rs  selection column} ) → I_columnsInAlignment Index( alitabletree selection ) → I_selectedEntries Index( fork [systemall] ) → i_procpidnof_children Index ( {IRS}, {IRS} compare ) → C_["A","AB","B","BA"] Index( IRS irs ) → i_1st_matching_pos Index( IRS irs all ) → I_matchedIndexes Index( IS unique ) → I_uniqueValueIndexes Index( Im_indexes n_max inverse ) → I_nm_complementaryIndexes Index( map [cell] ) → I_mapLimits  I_xrCellLimits (see Map(m I_xrCellLimits) Index( object ) → i_currObj Index( rs ) → I Index( site seq i_no ) → I_fromToList Index( slideArray s_name ) → i_slideByName ( 0 if not found) Index( T ) → I Index( T i_label label ) → I_labeledEntries (colored in GUI) Index( T sql problem ) → I_rejectedRowIndexes Index( tree center [r_threshold] ) → I_centers Index( S_smi smiles problem ) → I_illegal_smiles Index( Xm s_smi [select] ) → I_matches_in_Xm Index( Xm Xk_query [sstructurer_taminoto] ) → I_n_matches_in_Xm (n<=m) Index( X1a X1b_sub atom map ) → I_matching_atoms_in_X1a Index( X i_RgroupNumber [group] ) → I_ringNumber
Index( fork ) the current of process number filled by the fork command. This number is zero for the parent process. Index( fork system ) process ID of the spawned child (is nonzero in children, zero in parent). Index( fork all ) number of spawned children (is zero in children, nonzero in parent). See also: fork , wait Nof( fork ) the number of available cores in a computer
Index( chem_array , chemical_or_chemarray , [ sstructure [group] ] [ stereo ] [ salt ] )  returns iarray of indices of compounds from the first chem_array that contain any of identical compounds (the default), or substructure patterns (the sstructure option) from the chemical array. Example in which we find the nitro compounds among the known drugs: read table "oralDrugs.sdf" name = "drugs" modify oralDrugs.mol delete salt modify oralDrugs.mol delete salt simple # leaves only the 1st molecule nitrocomps= t[Index(t.mol Chemical("N(=O)O") sstructure )] Options
Example: add column t Chemical( {"CCC","CCO", "CC", "CCC", "CCC.C", "CC", "CCC"} ) Index( t.mol t.mol[1] ) # find all occurrences of the first molecule ( disregarding stereo and salt ) Index( t.mol t.mol[1] salt ) # find all occurrences of the first molecule (salt is taken into account ) Index( {"C1CC2","CCO", "CxC", "CCC", "CCC.C", "CC", "CCC"} smiles problem ) 1 3
Index( chem_array , chemical_or_chemarray r_distThreshold ) returns iarray of indices of compounds from the first chem_array with chemical distanceless than r_distThreshold to at least one compound from chemical_or_chemarray. Finding indices of duplicate entries Index( chem_array exact [ salt ] [ stereo ] ) returns iarray of indices of duplicates (entries found more than once). This function can be useful to remove redundant compounds from the set. Options:
Example: add column t Chemical( {"CCC","CCO", "CC", "CCC", "CCC.C", "CC", "CCC"} ) show Index( t.mol exact ) # returns {4,5,7,6} delete t[ Index( t.mol exact salt ) ] # remove duplicates. preserves different salts See also: Nof Find find table find molcart Index( S_smiles , smiles problem ) → I_indeces_of_illegal_smiles_strings returns iarray of incorrect smiles strings. Example Index( {"C1CC2","CCO", "CxC", "CCC", "CCC.C", "CC", "CCC"} smiles problem ) 1 3 Index( as enumerate ) → collection_of_equivalent_self_atom_mappings finds chemically equivalent projection of atoms for a chemical against itself. The function returns a parray which contains one or several iarray(s) arranged into an ivector( ivector is a subtype of parray) . Example: build smiles "C1=CC=CC=C1" x = Index(a_//!h* enumerate) Nof(x) # returns 12 possible iarray mappings (six shifts for flipped and nonflipped) show x # all mappings 1,2,3,4,5,6 1,6,5,4,3,2 2,1,6,5,4,3 2,3,4,5,6,1 3,2,1,6,5,4 3,4,5,6,1,2 5,4,3,2,1,6 5,6,1,2,3,4 4,3,2,1,6,5 4,5,6,1,2,3 6,1,2,3,4,5 6,5,4,3,2,1 map1 = x[1] # creates an integer array Index( as tautomer ) → index_of_current_tautomer_from_mask_hydrogen returns index of the currently set tautomer. The tautomers must be prebuilt with build tautomer command. The tautomer can be set either by set tautomer command or explicitly by masking hydrogen with set command. Example: build smiles "N(C(N=C1N)=O)C=C1" build tautomer a_1 set tautomer a_1 3 Index( a_1 tautomer ) See also build tautomer, set tautomer commands
Index ( { s_source  seq_source }, { s_pattern  seq_pattern }, [ { last  i_skipToPos ] )  returns integer value indicating the position of the pattern substring in the source string, or 0 otherwise. Option last returns the index of the last occurrence of the substring. The i_skipToPos argument starts search from the specified position in the source string, e.g. Index("words words","word",3) returns 7 . If i_skipToPos is negative, it specifies the number of characters from the end of the string in which the search is performed. Examples: show Index("asdf","sd") # returns 2 show Index("asdf" "wer") # return 0 a=Sequence("AGCTTAGACCGCGGAATAAGCCTA") show Index(a "AATAAA") # polyadenylation signal show Index(a "CT" last) # returns 22 show Index(a "CT" 10) # starts from position 10. returns 22 show Index(a "CT", 10) # search only the last 10 positionsAnother example in which we output all positions of all "xxx.." stretches in a sequence " xxxx xxxxx xxxx ... xxxx " (must end with space) EX = "xxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxx " sp=0 while(yes) x=Index(EX "x" sp) if(x==0) break sp=Index(EX " " x) print x sp1 endwhile
Index ( s_sourceS_N_source, { s_pattern S_N_patterns }, exact  simple  regexp ) Options:
Index ( T_tableExpression_orSelection ) → I_matchingRows
Index ( T_table_with_graphical_selection_or_rows selection ) → I_matchingRows
group table t {33 22 11} "A" {"a","b","c"} "B" Index(t.A==22) # returns 2 for 2nd row #>I 2 t.B[ Index(t.A== 22 )[1] ] # returns B according to A value b
Index ( T_table i_label label ) → I_matchingRows
 returns an integer array of order numbers (indices) of rows with labels equal to
See also: set label table Label
Index ( S_data unique ) → I_indexes Index ( I_data unique ) → I_indexes  returns iarray containing indexes of unique elements in the data array, sorted in ascending order. Examples: test Index( {1 7 5 7 2 1 1 5} unique )=={1 2 3 5} test Index( {"a" "A" "a" "B" "A"} unique )=={1 2 4}
Index ( S_data, s_value [reverse] ) → i_FirstOrLastMatchingElement Index ( I_data, i_value [reverse] ) → i_FirstOrLastMatchingElement
Index ( rarray, real [reverse] ) → i_FirstOrLastMatchingElement
show Index({"Red Dog","Amstal","Jever"}, "Jever") # returns 3 show Index({"Red Dog","Amstal","Jever"}, "Bitburger") # returns 0 show Index({3 ,2, 8},2 ) # returns 2 show Index( 0.3//0.1//0.2//ND//0.5, ND ) # returns 4 show Index( 0.3//0.1//0.2//ND//0.5, 0.1 ) # returns 2 Index ( S_data, s_value all ) → I_matchPositions Index ( I_data, i_value all ) → I_matchPositions
Index ( R_data, r_value all ) → I_matchPositions
Index ( I_indexes, i_nofElements inverse ) → I_complementarySetOfIndexes  this function returns a complement of the input set of indexes. It is similar to a negation of a selection. Examples: show Index({"A","B","C","B","B"}, "B") # returns {2,4,5} show Index({1,2,6,4},3) # returns empty iarray show Index({1,3} 5 inverse) # returns {2,4,5} Index ( alignment, sequence ) returns integer index of an identical sequence in the alignment of 0. Index ( alignment selection column ) or Index ( alignment rs )
returns an iarray of column positions selected graphically in the alignment.
See also: macro calcSelSimilarity
l_commands = no read pdb "1crn" read object s_icmhome+"crn" printf "The object a_crn. is the %dnd, while ...\n", Index(object) set object a_1. printf "the object a_1crn. is the %dst.\n", Index(object)
Index ( tree center [r_threshold] )  returns cluster centers (current threshold is taken if not specified) Index ( tree selection )  returns indices of table rows which are selected in cluster
Index ( {iarrayrarraysarray}, {iarrayrarraysarray} compare )  returns a collection object with four fields:
Example: a = Random(1,100,50 ) b = Random(1,100,60 ) c = Index( a, b, compare ) show a[ c["A"] ] # elements only in 'a' show a[ c["AB"] ] # overlap show b[ c["B"] ] # elements only in 'b' show b[ c["BA"] ] # overlap printf "The total number of unique elements is %d\n",Nof(c["A"]//c["B"]//c["AB"])To get the union, use Unique(Sort(a//b))
Index( X_single_chem1, X_single_chem2 atom map ) → iarray X_single_chem2 should be substructure or equal to the X_single_chem1.  returns iarray of the length equal to the number of atoms in the X_single_chem2. Each element of the result array contains an atom number in X_single_chem1 which corresponds to the atom number == position_in_the_array in ~X_single_chem2 Example: Index( Chemical("CCO"), Chemical("OCC") atom map ) # returns {3 2 1}
function to find location of substring pattern. Indexx ( { string  sequence }, s_Pattern )  returns an integer value indicating the position of the s_Pattern (see pattern matching) in the string, or 0 otherwise. Allowed metacharacters are the following:
Examples: show Indexx("asdf","s[ed.]") # returns 2 show Indexx("asdfff","ff$") # returns 5 (not 4) show Indexx("asdf" "w?r") # return 0
function selecting inserted residues. Insertion ( rs_Fragment, ali_Alignment [, seq_fromAli ][, i_addFlanks ] [{"all""nter""cter""loop"}] )  returns the residue selection which form an insertion 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 Deletion( ) function) one can easily and quickly visualize all indels in the threedimensional structure. The default i_addFlanks parameter is 0. String options:
Examples: read pdb "1phc.a/" # read the first molecule form this pdbfile read pdb "2hpd.a/" # do the same for the second molecule make sequences a_*. # you may also read the sequence and # the alignment from a file aaa=Align( ) # online seq. alignment. # You may read the edited alignment # worm representation assign sstructure a_*. "_" display ribbon link a_*. aaa # establish connection between sequences and 3D obj. superimpose a_1. a_2. aaa display ribbon a_*. color a_1. ribbon green color ribbon Insertion(a_1.1 aaa) magenta color ribbon Insertion(a_2.1 aaa) red show aaa
function. Info ( [ string ] )  returns the string with the content previous ICM Info message. Info ( display )  returns the string with commands needed to restore the graphics view and the background color. See also: View () , write object auto or write object display=yes . Info ( term [mapmmff] )  returns the string with energy terms. E.g. s_oldterms = Info(term) .. set terms only s_oldterms If option map is specified, ICM starts looking for m_gc, m_ge, .. etc. maps and adds a corresponding term. E.g. s_termsAccordingToExistingMaps = Info(term map)
If option mmff is specified, ICM will select the correct set of the mmff terms.
Info ( images ) returns sarray with advanced details of images, such as their file format (JPEG, PNG, etc.), dimensions, color space (e. g. RGB, grayscale), transparency, etc.
Info ( predModel ) Info ( s_builtInModelName model ) returns collection with model properties: type, weights, constant, etc.. Example Info( "MolLogP" model )
function converting to integer type. Integer ( l_value )  returns 0 or 1.
Integer ( r_toBeRounded )
show Integer(2.2), Integer(3.1) # 2 and 3 jj=Integer("256aaa") # jj will be equal to 256 See also: Iarray( ), Tointeger( )
function. Integral ( I  R )
returns iarray (or rarray) of the same dimension containing partial sums (from 1 to i )
of the element in the source array. E.g. Integral({2.,2.,2.}) will return 2.,4.,6.
 calculates the integral rarray of the function represented by rarray Ron the periodically incremented abscissa x with the step of r_xIncrement. Note the difference between this and the above function of partial sums. The explicit increment form of the function will do the following
Integral ( R_Y R_X )
 calculates the integral rarray of the function represented by R_Y on the set of abscissa
values R_X.
# Let us integrate sqrt(x) x=Rarray( 1000 0. 10. ) plot x Integral( Sqrt(x) 10./1000. ) grid {0.,10.,1.,5.,0.,25.,1.,5.} display # Let us integrate x*sin(x). Note that Sin expects the argument in degrees x=Rarray( 1000 0. 4.*Pi ) # 1000 points in the [0.,4*Pi] interval plot x Integral( x*Sin(x*180./Pi) x[2]x[1] ) \ {0., 15., 1., 5., 15., 10., 1., 5. } grid display # x[2]x[1] is just the incrementLet us integrate 3*x^{2}1, determined on the rarray of unevenly spaced x. The expected integral function is x^{3}x x=Rarray(100 ,.9999, .9999 ) x=x*x*x plot display x Integral((3*x*x1.) x) cross
function. (obsolete). Interrupt  returns logical yes if ICMinterrupt (CtrlBackslash, ^\) has been received by the program. Useful in scripts and macros. Examples: if (Error  Interrupt) return This method is now replaced by the setting of the interruptAction preference, e.g. interruptAction = "break all loops" #or interruptAction = "exit macro"
function returning a molecular/grob label string. Label ( g ) → s  returns the string label of the grob. See also: set grob s_label . Label ( as ) returns sarray of atom labels which will be displayed. Normally they are atom names. The custom labels can be set with the set atom label command.
Label ( rs )
build string "ala his glu lys arg asp" resLabelStyle = "Ala 5" # other styles also available aa = Label(a_/2:5) # extract residue name and/or residue number info show aa # show the created string array Label ( T_table )  returns iarray of table row labels (marks) set from the GUI or by set label command Examples: group table t {1 2 3} "A" set label t 1 index={1,3} Label(t) Label ( chem chiral )  returns sarray of chiral labels for the set of compounds. Each element of the array may have one of the following values:
See also: set label table Index table label , Nof( X chiral [ 012.. ] )
The Laplace operator is a second order differential operator. The Laplacian of Æ’ where f is defined in 3D space as map on a grid is the sum of all the unmixed second partial derivatives in the Cartesian coordinates x_{i}
function. Length ( { string  matrix  sequence  alignment  profile } )  returns integer length of specified objects. Length ( sarray )  returns iarray with lengths of strings elements of the sarray. Length ( X_chem1_single i_at1 i_at2 )  returns integer length in bonds between two atoms in a single molecule Length ( as1_single as2_single )
 returns integer length in bonds between two atoms in a single molecule (1 if atoms are not connected)
 returns iarray with number of bonds in a shortest path between two marked attachment points. Length ( seqarray )  returns iarray with lengths of sequence parray elements.
Length ( {iarray  rarray } )
len=Length("asdfg") # len is equal to 5 a=Matrix(2,4) # two rows, four columns nCol=Length(a) # nCol is 4 read profile "prof" # read sequence profile show Length(prof) # number of residue positions in the profile vlen=Length({1 1 1}) # returns 1.732051 See also: Nof
Gaussian curve fitting parameter estimation function. GaussFit( R_X , R_Y )  returns a 3element rarray a,b,c of the parameters of the Gauss function c*Exp((xa)*(xa)/b) Example: read table mol s_icmhome+ "/moledit/Dictionary.sdf" name="Xdict" add column Xdict function="MolWeight(mol)" index=2 name="molWeight" append format="%.3f" h = Histogram(Xdict.molWeight,40) # 40 bins h[?,2] = h[?,2] / Nof( Xdict ) # Normalize by number of molecules x = h[?,1] y = h[?,2] params = GaussFit( x, y ) printf "Best fit: %f * Exp( (x%f)*(x%f)/%f )\n", params[3],params[1],params[1],params[2] add column tt x y R_out make plot tt "x=A;y=C;color=#ff0000;size=6.;style=connected;depth=5.;;x=A;y=B;color=#0000ff;size=6.;style=vertical bars;;"
the linear regression function. LinearFit( R_X , R_Y , [ R_Errors] )  returns a 4element rarray A,B,StdDev,Corr of the parameters of the linear regression for a scatter plot Y(X): R_Y = A*R_X + B , where the slope A and the intercept B are the first and the second elements, respectively. The third element is the standard deviation of the regression, and the fourth is the correlation coefficient. Residuals R_Y  ( A*R_X + B) are stored in the R_out array. You can also provide an array of expected errors of R_Y . In this case the weighted sum of squared differences will be optimized. The weights will be calculated as: W_{i} = 1/R_Errors_{i} ^{2} Example: X = Random(1., 10., 10) Y = 2.*X + 3. + Random(0.1, 0.1, 10) lfit = LinearFit(X Y) printf "Y = %.2f*X + %.2f\n", lfit[1],lfit[2] printf "s.d. = %.2f; r = %.3f\n", lfit[3],lfit[4] show column X, Y, X*lfit[1]+lfit[2], R_out A more complex linear fit between a target set of Y_{i} , i=1:n values and several parameters X_{i,j} (i=1:n,j=1:m) potentially correlating with Y_{i} is achieved in 3 steps: M1=Transpose(X)*X M2=Power(M1,1) W =(M2*Transpose(X))*Y The result of this operation is vector of weights W for each of m components. Now you can subtract the predicted variation from the initial vector ( Y_{2} = Y  X*W ) and redo the calculation to find W_{2} , etc. A proper way of doing it, however, is to calculate the eigenvalues of the covariance matrix.
LinearModel( T_weights ) creates a linear regression predictionmodel like: Y = 5*A + 10*B + 20The resulting model can then be applied to any table with columns required by the model. The T_weights table should have two columns: sarray called "name" with column names, and rarray "w" with weights. It may also have a real header "b" specifying the free term (the default value is 0.). For example, tables produced by the model weight function for other regression models may be used as input for LinearModel. So it is possible to obtain weights from a PLS model, refine or simplify them, and create a new linear regression model: n = 1000 add column T Random(10., 10., n) name="A" add column T Random(10., 10., n) name="B" add column T Random(10., 10., n) name="C" add column T T.A + 10.*T.B  5.*T.C name="Y" learn T.Y type="plsRegression" name="Y" Y1 = LinearModel( Table( Y term ) ) predict T Y1 A simple model example: Y = 0.7*A + 2.3*B  10.*C + 5.6 # Build model add column WT {"A", "B", "C"} name="name" add column WT {0.7, 2.3, 10.} name="w" add header WT 5.6 name="b" Y = LinearModel( WT ) # Predict n = 100 add column T Random(10., 10., n) name="A" add column T Random(10., 10., n) name="B" add column T Random(10., 10., n) name="C" predict T Y
See also: Table model , predict , learn
the logarithm function. Log ( real )  returns the real natural logarithm of a specified positive argument. Log ( real r_realBase)  returns the real logarithm of a specified positive argument (e.g. the base 10 logarithm is Log(x, 10)). Log ( rarray )  returns an rarray of natural logarithms of the array components (they must not be negative, zeroes are treated as the least positive real number, ca. 10^{38}). Log ( rarray r_realBase )  returns an rarray of logarithms of the array components (they must not be negative), arbitrary base. Log ( matrix [ r_realBase ] )  returns a matrix of logarithms of the matrix components (they must not be negative). Examples: print Log(2.) # prints 0.693147 print Log(10000, 10) # decimal logarithm print Log({1.,3.,9.}, Sqrt(3.)) # {0. 2. 4.} See also: Power
function. Map( m_map cell )  returns map in the limits of the crystallographic cell (a,b,c,alpha,beta,gamma). The source map needs to be equal in size or greater to the asymmetric unit of the cell. This function helps to prepare local maps for real space refinement (see make map potential m R_6box ) Map( m_map , I_6box [ simple ] )  returns map which is a transformation (expansion or reduction) of the input m_map to new I_6box box ({ iMinX,jMinY,kMinZ,iMaxX,jMaxY,kMaxZ}). Note that the order of axes in most crystallographic is defined by the MAPS,MAPR,MAPS parameters and is not always x,y,z. The correctly ordered index is returned by the Index(
Map( m_map , as )
returns a map around selected atoms . The index box of this selection is returned by the
Index( read object "crn" read map "crn" display a_//ca,c,n m_crn m1 = Map(m_crn, {0 0 0 22 38 38}) # half of the m_crn m2 = Map(m_crn, {0 0 0 88 38 38}) # double of the m_crn display m1 display m2See also : make grob map to generate contour around a particular selection
function. Mass( as  rs  ms  os )  returns rarray of masses of selected atoms, residues, molecules or objects, depending on the selection level. Examples: build string "ala his trp glu" objmasses = Mass( a_*. ) molmasses = Mass( a_* ) resmasses = Mass( a_/* ) masses=Mass( a_//!?vt* ) # array of masses of nonvirtual atoms molweight = Mass( a_1 )[1] # mol.weight of the 1st molecule molweight = Sum(Mass( a_1//* )) # another way to calculate 1st mol. weight See also: Nof( sel atom ), Charge( sel ) , Moment ( sel  X_ ) (principal moments of inertia)
Moment( as_nObjX_n [ pca  simple  all ] ) returns an array of principal moments of inertia for the selected atoms in each selected object. The input array can also be a parray of chemicals (see Chemical ). Options:
Example: build string "ASD" build string "G" Moment(a_*.//* ) # three components for each object 3470.9 # first object 2886.5 855.1 167.5 # second object 124.9 48.4 Moment(a_*.//* simple ) # two largest moments of inertia 3470.980225 167.546844 Moment(a_1./2:3/ca pca ) # just two atoms: a linear molecule 86.0 86.0 0.0
Match( s_where s_regexp [i_field=0 [i_startPos=1]] ) → s_match  returns the matched substring (or empty string). Example with parsing swiss id, name and description (see macro readUniprot): id_sw = Match(swissEntryHtmlLine, "<DT><A HREF=\"/uniprot/(.+)\">(.+)</A> \(<b>.+</b>\)<DD>(.+)" 1) namesw = Match(swissEntryHtmlLine, "<DT><A HREF=\"/uniprot/(.+)\">(.+)</A> \(<b>.+</b>\)<DD>(.+)" 2) descsw = Match(swissEntryHtmlLine, "<DT><A HREF=\"/uniprot/(.+)\">(.+)</A> \(<b>.+</b>\)<DD>(.+)" 3) minimal and greedy match Check regexp syntax for the full description of the rules. Some important hints: add question mark (?) to the end of a matching expression to make the match minimal (to the closest separator). Without '?' the match will be greedy i.e. it long for the longest match. Example: Match( "bla = stuff; and more", "=\s+(.*?)\s",1) # ? for minimal stuff; Match( "bla = stuff; and more", "=\s+(.*)\s",1) # greedy match stuff; and Case sensitivity To make the match case insensitive use the "(?i)" or the "(?i)" prefix (see also regexp syntax and simple expressions ) Example: s= "Some text\n Smiles = C1CCCC1 \nmore text" Match(s,"(?i)smiles\s+=\s*(.+?)\s",1) # ? in (.+?) means the minimal match, 1 refers to the (..) expression C1CCCC1 Match( all s_where s_regexp [i_field=0 [i_startPos=1] ) → S_matches  returns an sarray with all matched expression Match( S_where s_regexp [i_field=0 [I_startPos={1,..}]] ) → S_matches  returns an sarray with matched substrings, the resulting array has the same size as the input array
[ Matrix new  Matrix sub  Matrix symmetric  Matrix color  Matrix residue comparison  Matrix table  Matrix tensor  Matrix residue areas  Matrix alignment  Matrix boundary  Matrix stack  Matrix histogram  Matrix grob connectivity ] function.
Matrix( i_NofRows, i_NofColumns [ r_value] )
 returns matrix of specified dimensions. All components are set to zero or r_value if specified.
Matrix( i_n [ R_m_row ] )  returns square unity matrix of specified size. A matching array of diagonal values can be provided. If the array size does is not equal to i_n , a matrix with i_n rows with R_m_row values will be returned. Example: Matrix(3,{1. 2. 3.}) #>M 1. 0. 0. 0. 2. 0. 0. 0. 3. Matrix(3,{1. 2.}) #>M 1. 2. 1. 2. 1. 2. Matrix( nRows [ R_row ] )
multiples R_row vector nRows times into a matrix. Make sure that nRows is not equal to
Nof( R_row ) . Example: Matrix(10, {1. 2. 3.})
Matrix({1. 2. 3. 4. 5. 6.},3) #>M 1. 2. 3. 4. 5. 6. Matrix({1. 2. 3. 4. 5. 6.},3) #>M 1. 4. 2. 5. 3. 6. Matrix({1. 2. 3. 4. 5. 6.},4) Error> nonmatching dimension [4] and vector size [6]
Matrix( M_square i_rowFrom i_rowTo i_colFrom i_colTo ) → M a submatrix of specified dimensions. To select only columns or rows, use zero values, e.g. Matrix( Matrix(3) 0,0,1, 2) # first two columns
Matrix( M_square { left  right } )  generate a symmetric matrix by duplicating the left or the right triangle of initial square matrix. Example: icm/def> m #>M m 1. 0. 0. 0. 1. 0. 7. 0. 7. icm/def> Matrix( m right ) #>M 1. 0. 0. 0. 1. 0. 0. 0. 7. icm/def> Matrix( m left ) #>M 1. 0. 7. 0. 1. 0. 7. 0. 7.
Matrix( S_nHexcolors rgb  color ) function returns a matrix of n rows and 3 columns for each of the rgb (red, green, blue) values. With option color it adds three additional columns for
makeColorTable # this macro calls the Matrix( .. color ) function # Matrix( {"#FFFFAA","#ACBB01"} rgb ) Matrix( {"#FFFFAA","#ACBB01"} color )This matrix can also be used to calculate a distance matrix and cluster colors, e.g. makeColorTable # create a table add header icmColors Distance(Matrix(icmColors.Color rgb) ) name="dm" # click on the cluster tool
Matrix( comp_matrix s_newResOrder )  returns comparison matrix in the specified order. Example in which we extract cysteine, alanine and arginine comparison values: icm/def> Matrix(comp_matrix "CAR") #>M 2.552272 0.110968 0.488261 0.110968 0.532648 0.133162 0.488261 0.133162 1.043102
Matrix ( T [ S_colnames ] ) → M Example: add column t {1 2} {3 4} {4 5} # columsn .A .B .C M = Matrix( t ) # 3x2 matrix mm = Matrix( t {"B","C"} ) # 2x2 matrix with .B and .C
The inverse operation is also possible with the Table ( matrix , S_colNames ) function.
Matrix( R_A R_B )
mm=Matrix(2,4) # create empty matrix with 2 rows and 4 columns mm=Matrix(2,4,5.) # as above but all elements are set to 5. show Matrix(3) # a unit matrix [1:3,1:3] with diagonal # elements equal to 1. a=Matrix({1. 3. 5. 6.}) # create one row matrix [1:1,1:4 ] Matrix({1.,0.},{0.,1.}) # tensor product #>M 0. 1. 0. 0.
Matrix ( rs_1 rs_2 )
 returns matrix of contact areas.
See also: Cad, Area .
Matrix ( ali )
 returns a matrix of normalized pairwise Dayhoff evolutionary distances
between the sequences in alignment ali_
(for similar sequences it is equal to the fraction mismatches).
Matrix ( boundary )  returns values generated by the make boundary command for each atom.
Matrix ( stack )
 returns distance matrix of stack conformations according to the
compare command and the vicinity parameter. Used for clustering of the stack
conformations.
Matrix( R_Xn R_Yn R_ruler )  retuns 2D histogram of X and Y values. The R_ruler array consists of limits for X and Y and step sizes for X and Y and optional bin sizes: {xFrom, xTo, yFrom, yTo, [xStep, yStep] } . Returned values:
Example: icm/def> Matrix(Random(0. 5. 20) Random(0. 5. 20) {0. 5. 0. 5. 1. 1.}) #>M 1. 0. 2. 1. 0. 1. 1. 1. 1. 2. 0. 2. 1. 1. 0. 0. 1. 0. 0. 1. 1. 0. 0. 1. 2.
Matrix( grob wire ) → M_one_or_large_number Returns a matrix n_vertices by n_vertices containing 1. for connected vertices and a large number for unconnected. Example:
maximumvalue function. Max ( { rarray  map } )  returns the real maximumvalue element of a specified object Max ( iarray )  returns the integer maximumvalue element of the iarray.
Max ( R1_n R2_n ) → R_max_n
 returns the rarray of maximal values.
Max ( clusterObject )  returns maximal distance of the root node
cl = Split( t.cluster, Max( t.cluster )/2 ) Max ( index { iarray  rarray } group I_clusterNumbers )  returns the iarray of indices of maximal values, e.g. Max(index { 1. 3. 1. 2. 5.} group { 1 2 1 2 2} ) #>I 1 4 # the maximal element 2. has index 4see also Min(.. ) and the group .. command. Max ( matrix )  returns the rarray of maximumvalue element of each column of the matrix. To find the maximum value use the function twice ( Max(Max( m)) ) Max ( matrix_nm matrix_nm ) → M_max_nm  returns the matrix with the larger values of the two input matrices of the same dimensions.
g_skin_1 g_skin_2This function is equivalent to Max( Name(grob), s_leadingString ) (see the previous function). Examples: show Max({2. 4. 7. 4.}) # 7. will be shown
Max( image graphic )  returns the recommended value of GRAPHICS.quality to be used with commands which generate images. Example: write image memory GRAPHICS.quality=Max(image graphic)
an array of three maximal crystallographic h,k,l indices at a given resolution. MaxHKL( { map  os  [ R_6CellParameters ] }, r_minResolution ) → I_3hkl_limits the function extracts the cell parameters from map_ , os_ object, or reall array of {a,b,c,alpha,beta,gamma}, and calculates an iarray of three maximal crystallographic indices { hMax , kMax , lMax } corresponding to the specified r_minResolution .
medianvalue function.
Median ( { rarray  iarray } )
Examples: print Median(Count(100)) # returns 50.5
averagevalue function. Mean ( { rarray  map } )  returns the real averagevalue of elements of the specified ICMshell objects. Mean ( iarray )  returns the real averagevalue of the elements of the iarray. Mean ( matrix )  returns rarray [1:m] of average values for each ith column matrix[1:n,i]. Mean ( R1 R2 )  for two real arrays of the same size returns rarray [1:m] of average values for each pair of corresponding elements. Examples: print Mean({1,2,3}) # returns 2. show Mean(Xyz(a_2/2:8)) # shows {x y z} vector of geometric # center of the selected atoms Mean({1. 2. 3.} {2. 3. 4.}) #>R 1.5 2.5 3.5
minimumvalue function. Min ( { rarray  map } )  returns the real minimum value element of a specified object Min ( index { iarray  rarray } )  returns the integer index of the minimumvalue element of the array (or one of them if many). Min ( index { iarray  rarray } group I_clusterNumbers )  returns the iarray of indices of minimal values, e.g. Min( index { 1. 3. 1. 2. 5.} group { 1 2 1 2 2} ) #>I 1 4 # the minimal element 2. has index 4see also Max(.. ) and the group .. command. Min ( iarray )  returns the integer minimumvalue element of the iarray.
Min ( R1_n R2_n ) → R_min_n
 returns the rarray of minimum values.
Min ( matrix_nm matrix_nm ) → M_min_nm  returns the matrix with the smaller values of the two input matrices of the same dimensions.
show Min({2. 4. 7. 4.}) # 2. will be shown show Min(2., 4., 7., 4.) # 2. will be shown Min ( alignment, sequence ) → i_nearestSeq  returns the integer index of the nearest sequence in the alignment. To get the name of the nearest sequence, use the Name function. Example: read alignment s_icmhome+"sh3" b = Sequence("KKYAKAKYDFVARNSSELSMKDDVLELILDD") # like Eps8 seq iseq = Min(sh3, b) # returns 3. nam = Name(sh3)[iseq] # "Eps8" is the closest sequence show $nam
function to print money figures. Money ( { i_amount  r_amount}, [ s_format] )  returns a string with the traditionally decorated money figure. s_format contains the figure format and the accompanying symbols.
Examples: Money(1452.39) # returns "$1,452.39" Money(1452.39,"DM %m") # returns "DM 1,452" Money(1452.39,"%.M FF") # inverts comma and dot "1.452,39 FF"
remainder (module) function. Similar to, but different from Remainder() function:
Mod ( i_divisor, [ i_divider ] )  returns integer remainder. Mod ( r_divisor, [ r_divider ] )  returns the real remainder r = x  n*y where n is the integer nearest the exact value of x/y; r belongs to [ 0, y ] range. Mod ( iarray, [ i_divider ] )  returns the iarray of remainders (see the previous definition). Mod ( rarray, [ r_divider ] )  returns the rarray of remainders (see the previous definition). The default divider is 360. (or 360) since we mostly deal with angles. Examples: phi = Mod(phi) # transform angle to [0., 360.] range a = Mod(17,10) # returns 7
molecule function. Mol ( { os  rs  as } )  selects molecules related to the specified objects os_ , residues rs_ or atoms as_, respectively.
Note that there is an obsolete Mol function to return a mol/sdf formatted string .
The uptodate version of this function is String( X )
show Mol( Sphere(a_1//* 4.) ) # molecules within a 4 A vicinity of the first one # Sphere function Sphere(as_atoms) selects atoms.See also: Atom, Res, Obj .
[ Name chemical property  Name soap  Name close sequence  Name string  Name tree  Name chemical  Name conf  Name sequence  Name pred colum  Name object parray  Name image  Name molcart ] generic function returning strings or string arrays with names of things.Name ( )  returns empty string. Name ( sS_Path_and_Name ) → s_nameS_name  returns file name sub string (or array of substrings) if full path is specified , example: Path({"a/b/aa.icb"}) returns {"aa"} See also Path and Ext Name( s_hint [ simple  unique  object ] ) Opions:
Name( " %^23 a 2,3 xreno77butadien" simple) 23_a_2_3_xreno_77_butadien a=1 Name("a",unique) a1Unique molecular object names and unique molecule names in a given object Name( s_hint object unique ) Name( s_hint os_object unique ) Name of the shell variable Name( variable any_shell_variable )  returns a string with a name of a provided shell variable. Example: add column t {1 2 3} name="A" Name( variable t ) Name( variable t.A ) All names of objects in a given class Name ( className ) → S_names  returns a string array of object names for the specified class. Classes: command,function,macro,integer,real,string,logical,iarray,rarray,sarray,matrix,map,grob,alignment,table,profile,sequence
Subclass of strings: htmlobjects and scripts Name( string [ html  command ] )
returns the list of html documents or scripts in ICM shell
read pdb "1zzz"//"3zzz" add column t Name(a_*.H full) name="A" set format t.A "<!icmscript name=\"1\"\ndsSelection \"%1\" ><a href=#_>%1</a>" See also: String( as ); Sarray( as )
Name ( asrsmsos field )
 returns sarray of unique names of assigned tags (fields), see also set field name .
Name ( ms chain )  returns sarray of chain names of selected molecules.
Name ( chem_array )
 returns sarray of names of chemicals in an array ( see also )
Name( T column )  returns sarray of column names Name( T header )  returns sarray of header names Name( T selection )  returns sarray of selected (in GUI) column names Name( collection )  returns sarray of keys of the collection Name( collection s_filter )  returns sarray of keys of the collection which satisfy the s_filter expression. s_filter can be any logical expression which operates with key or value or both. Example: c = Collection( "a" yes, "b" no, "c" yes ) Name( c "value==yes" ) # returns only "a" and "c" Name( c "value" ) # the same as above Name( c "!value" ) # "b" Name( gui {htmltablealignment} )  returns sarray of shell objects in the order of their tabs appear in the GUI. Notice that the order of tabs corresponding to htmldocuments, tables or alignments can be changed with drag and drop. It will lead to a different order retuned by the Name function. Name( foreground {htmltablealignmentslide} ) returns name of the currently active object (the active tab) in the class. Examples: read alignment msf s_icmhome+"azurins" # load alignment seqnames = Name(azurins) # extract sequence names show Name( Acc( a_/* ) ) # array of names of exposed residues
Name( chemical property )  returns sarray of names of loaded descriptors/models (e.g. "MolLogP") for chemicals.
Name( soapStruct ) See also: SOAP services for further information.
Name( ali seq ) → s_nameOfTheClosestSequence Example: read alignment s_icmhome+"sh3" # alignment readUniprotWeb "FYN_HUMAN" Name(sh3,FYN_HUMAN) # returns "Fyn"
Name( string html )  returns sarray with the names of all the HTML objects in the project Name( string command )  returns sarray with the names of all the scripts in the project
Name( treeparray i_parrayIndex [indexlabelmatrixsortsplit] )  returns string names of different properties of the tree cluster object. The following names can be returned:
Name( chemarray )  returns sarray of names of chemarray. Note that function does not generate a systematic (IUPAC) name. It uses names from the first line of SD/MOL file. Chemical names can also be set with set name command.
See also: set name other chemical functions
Name( conf ) → comments for the global stack Name( os conf ) → comments for the embedded stack of the object
Name( seq_parray ) → S_names  returns sarray with stored names of sequence parray elements
See also: set name sequence
Name( predModel column )  returns sarray with column names or chemical fingerprint chain information. The result of this function can be used for analysis of the prediction model results and can used together with Descriptor function. Each element in the fingerprint part is SMARTSlike expression (some atom properties used in the prediction model cannot be expressed as a valid SMARTS expression) For the default atom properties the output will look like this: Name( myModel column ) #>S string_array [#6;H3] [#6;H2][#6;H3] [#6;H2] ... See also Descriptor
Name( object_parray )  returns sarray with names of objects in the object_parray
See also: object parray
Name( imageArray )  returns sarray with names of images
See also: image parray
Name( sql )
 returns current database connectionID string, which can be used as the connect= Name( sql database )  returns sarray listing all databases in the current Molcart connection Name( sql table [s_database] )  returns sarray listing all tables in the current or specified database Name( molcart table [s_database] )  returns sarray listing chemical tables in the current or specified database Name( sql connect )  returns sarray with the connection parameters stored in user's settings: {host,user,password,database} Name( s_dbtable sql column )  returns sarray listing column names in the specified table. Table name may be prefix with database name with dot. See also: molcart, Type molcart, Nof molcart
[ Namex sequence  Namex image ] comment (or description) function.Namex ( osmsrs ) → S_comments Namex ( s_MultiObjectFile )  returns sarray of comments of selected objects os_ (i.e. a string for each object). This field is set to the chemical compound name by the read pdb command. Alternatively, you can set your own comment with the set comment os_ s_comment command. If you have a single object and want to convert a string array of one element (corresponding to this one object) to a simple string, use this expression, e.g.: Sum(Namex(a_)). Other manipulations with a multiline string can be performed with the Field, Integer, Real, Split functions (see also s_fieldDelimiter). Example. We stored values in the comment field in annotations like this: "LogP 4.3\n". Now we extract the values following the "LogP" field name: remarks = Namex( s_icmhome+"log3.ob") # get remarks directly without reading group table t Rarray(Field(remarks,"vacuum",1,"\n")) "vacuum" group table t append Rarray(Field(remarks,"hexadecane",1,"\n")) "hex" show t read object s_icmhome + "log3" # read multiple object file # extract numbers following the 'LogP' word in the object comments logPs = Rarray(Namex(a_*.),"LogP",1," \n")
See also: set comment
Namex ( seq )  returns string of long name ('description' field in Swissprot). Namex ( seqarray )  returns sarray with long names of sequence parray elements Example: read index s_inxDir+"/SWISS.inx" read sequence SWISS[2] # read the 2nd sequence from Swissprot show Namex( sequence[0] )
Namex ( imageArray )  returns sarray with comments associated with images See also: image parray, Name image .
selection function. Next ( { as  rs  ms  os } )  selects atom, residue, molecule, or object immediately following the selected one. Next( the_last_element ) returns an empty selection. Examples: read object s_icmhome+"crn.ob" Next( a_/4 ) # show residues number 5
Next ( as { bond  tree } )  selects atoms forming covalent bonds with the selected single atom. Option tree allows one to select only atoms above a given atom in an icmtree. Example of a test if a hetatm molecule is covalently attached to a polymer:
read pdb "2vsd" ms1 = a_a2 l_cov_attached = Nof( Mol(Next( ms1 bond)) & !(ms1) ) > 0 Another example: build string "his" display display a_/his/he2 ball red display Next( a_/his/he2 bond ) ball magenta # show atom preceding he2 cd2_neigh = Next( a_//cd2 bond ) for i=1,Nof(cd2_neigh) nei = cd2_neigh[i] print " Distance between a_//cd2 and ",Sum(Name(nei)), " = ", Distance( a_//cd2 nei) endfor
[ Nof tree  Nof chemical  Nof distance  Nof library  Nof molcart  Nof latent  Nof soap ] NumberOFelements function. See also Nof( X .. ) Summary:
Nof( P_distArray, distance ) → i_nofDistances # see make distance Nof( X, sS_smarts ) → IM_nOfChemMatches Nof( X, 'maxRing''minRing''maxFusedRings''maxFusedAromRings''rotBond''HBA''HBD''APO' ) → I_nOfChemMatches Nof( X, atomchiralmoleculeselectionsuperimposetopology ) → n Nof( X, chiral, {0123} ) → nChiralCenters of particular type Nof( X, library ) → enumeration_library_size Nof( site rs_seq_ ) → i_nSites Nof( model vector ) → i_nLatentVectors Nof( drestraintresiduevrestraint type ) → i Nof( as {bond [error]  selftether [error] } ) → i Nof( rsms {atom  tautomer } ) → I #in each res. or mol. Nof( stack ) → the number of stack atoms Nof( os_1, "bio" ) → nBiomol # see: SelectTransform(os "bio" i) Nof( [os_1] stack ) → the number of stack confs Nof( fork ) → the number of CPU cores available Nof( map grid ) → the number of 4D layers in map Nof( g {123} ) → nVertexnLinesnTriangles Nof( s s_substring [pattern] ) → nMatches Nof( s_file ) → i_filesize, nof of elements in .ob and .cnf files Nof( tree [i_at=1all] ) → nEntries Nof( tree [i_at=1] treeauto ) → nClustersnSuggestedClusters Nof( idb s_indexedIDBfile ) → nRecords Nof( SI si ) → i_nMatched_el Nof( S s regexp ) → I_nMatches_in_each Nof( s_table_name sql [s_connectionID] ) → nRows
Nof( s_table_name molcart unique ) → nUniqueChemicals
 returns integer number of objects in a class (e.g. Nof(sequence) ). Classes: iarray,rarray,sarray,sequence,aselection,vselection,alignment,matrix,map,grob,string,object Nof ( { iarray  rarray  sarray  chemarray  parray } )  returns integer number of elements in an array. Note that distanceParrays or hbondParrays returned by the make distance of make hbond commands have a twolevel structure in which the actual list of bonds or distances is the nested to the main level of this parray. Therefore to get the number of distances or hbonds one needs to use the following function. Nof ( hbondChunkArraydistChunkArray distance )  returns the total number of nested atom pairs.
Nof ( ali )
 returns integer number of sequences in a specified alignment ali_
(see also Length( alignment ) ).
Nof ( map )
 returns integer number of grid points in a map.
Nof( { as onoff  bond [error]  selftether [error] )  returns integer number of atoms that are hidden ( off ) or present ( on ). See also set as on  off . Also counts bonds, bonds and selftethers Nof( { rsms atom  tautomer )  returns iarray with number of atoms or tautomers in each residue or molecule. Depends on selection levels. Nof ( { atoms  residues  molecules  objects  conf  stack  tether  vrestraint } )  returns the total integer number things.
Nof ( fork )  returns the number of available processor cores for spawning new processes. See: fork and wait
Nof ( library )
 returns 1 if the force field parameter library is loaded and 0 otherwise.
Nof ( os1 stack )
 returns integer number of conformations in a builtin stack of a specified object.
for i=1,Nof("def.cnf",conf) # stack is NOT loaded read conf i endfor Nof ( os_singleObj stack )  returns integer number of conformations in the object stack. Note that stack stored in object is not the same as the global shared stack. E.g. build string "HWEH" montecarlo store # creates stack and stores it in object Nof(a_ stack) # returns the number of conformations in object stack Nof ( string, substring )  returns integer number of occurrences of substring in a string. E.g. Nof("ababab","ba") returns 2 Nof ( string, substring, pattern )  returns integer number of occurrences of regular pattern in a string. E.g. Nof("ababab","b?",pattern) returns 2 Example with a strange DNA sequence dn1: if(Nof(String(dn1),"[!ACGT]" pattern) > 0.5*Length(dn1)) print " Warning> Bad DNA sequence" Nof ( className selection )
 returns integer number of selected ICMshell variables.
This selection does not work the following types:
aselection, vselection, string , object .
nseq = Nof(sequences) # number of sequences currently loaded if(Nof(object)==0) return error "No objects loaded" if ( Nof( sequence selection ) == 2 ) a = Align( selection ) Nof ( {tablealignmentgrob} display )  returns integer number of displayed ICMshell variables.
Nof( grob display ) # number of meshes displayed in 3D Nof( table display ) # number of spreadsheets visible in GUI
Nof ( tree [i_index=1] )  returns integer number of entries in the cluster tree. Nof ( tree [i_index=1] tree )  returns integer number of clusters at current split level Nof ( tree [i_index=1] auto )  returns an integer guess for a recommended number of clusters
Nof( chemarray, "ring" )  returns an iarray containing the number of rings in each array element. show Nof(Chemical("C1CC2CC1CCC2") "ring" ) Nof( chemarray, "minRing" )  returns an iarray of max ring sizes Nof( chemarray, "maxRing" )  returns an iarray of min ring sizes Nof( chemarray, chiral [ 123 ] )  returns the number of chiral or racemic centers as follows:
See also: Label( X chiral ) Nof( chemarray, s_smarts [group] )  return an iarray of number of matches with the SMART pattern for each element of the chemical array. Options
Examples: Nof( Chemical("CP(C)(C)=C"), "P~*" ) Nof( Chemical("OP(O)(O)=C"), "P~O" ) Nof( Chemical( "CC(=O)OC1=CCCC=C1C(O)=O" ), "[*;!D1]!@[*;!D1]" ) # the group option examples Nof( Chemical("C(=CC=CC1C(=CC=C(C2)C(=CC=CC3)C=3)C=2)C=1") "C(=C1)C=[C*]C=C1" group )[1] # returns 2 Nof( Chemical("C(=CC=CC1C(=CC=C(C2)C(=CC=CC3)C=3)C=2)C=1") "C1C=[C*]C=C[C*]=1" group )[1] # returns 1
See also: other chemical functions SMILES and SMARTS
Nof( distobject distance ) counts number of records in the distance parrays created by the following commands.
Example: read pdb "1crn" convertObject a_ yes yes no no make hbond name="hbonds_crn" show Nof( hbonds_crn ) # counts distances
Nof( X_scaffold library )  returns the total library size Nof( X_scaffold group )  returns iarray of substituent Rgroup array sizes See also: link group , chemical , Chemical .
Nof( s_dbtable sql [s_connectionID] )  counts the number of entries (rows) in an SQL table Nof( s_dbtable molcart unique )  counts unique chemicals in an SQL table See also: molcart
Nof( PLS_model i_num )  returns number of latent vectors of the PLS model
Nof( soapObject )  counts numbers of element in complex SOAP object (array or structure) See SOAP services for information.
returns different norms of a vector, e.g. its Euclidean length, or the size of the range of its values. Norm ( R_vector s_type )  returns the specified norm of the vector. Supported norm types ( s_type ) are (this parameter is caseinsensitive):
Examples: Norm ( {3., 4.}, "euclidean" ) Norm ( {1. 3. 3. 6. 3. 4. 5.7 7.}, "RMSD" ) # case insensitive See also: Normalize
normalize vectors or real arrays according to different transformations, e.g. "range","rmsd","euclidean","citiblock","linf" etc. Normalize( R, r_f0 r_t0) → R_norm #[f0,t0]→[0.,1.]
Normalize( R, R2_f_tR4_f0_t0_f_t) → R_norm #[f0,t0]→[f,t]
change the input range of values to the destination range. If the second array has only two elements the source range is derived from the input array R .
Normalize ( matrix )  returns the matrix linearly transformed into the [0.,1.] range. The following expression returns 1. for any valid s_type and vector v with nonzero norm: Norm( Normalize( v, s_type ) s_type ) # always returns 1. Examples: 2.*Normalize ( {3., 4.}, "euclidean" ) #make euclidean length 2.
InList ( S_list S_testedItems ) returns sarray of S_testedItems elements which are included in the first list. NotInList ( S_list S_testedItems ) returns sarray of S_testedItems elements which are not in the first list. Examples: NotInList({"cc","aa","bb"} {"aa","dd","ee"}) # returns {"dd","ee"} InList ({"cc","aa","bb"} {"aa","dd","ee"}) # returns {"aa"} See also: InList( S_list , S_X )
object level function. Obj ( { ms  rs  as } )  selects object(s) related to the specified molecules, residues or atoms, respectively. Examples: show Obj( a_*./dod ) # show objects containing heavy waterSee also: Atom, Res, Mol .
function. Occupancy ( { as  rs } )  returns rarray of occupancy for the specified selection. If residue selection is given, average residue occupancies are returned. See also: set occupancy. Examples: read object s_icmhome+"crn.ob" avO=Min(Occupancy(a_//ca)) # minimal occupancy of Caatoms show Occupancy(a_//!h*) # array of occupancy of heavy atoms color a_//* Occupancy(a_//*) # color previously displayed atoms # according to their occupancy color ribbon a_/A Occupancy(a_/A) # color residues by mean occupancy
function. Path ( )  returns the working directory (same as Path(directory).
Path ( sS_FullFileName )
 returns header sub string (or sarray) with the path(s).
Example: Path("a/b/c/dd.icb") returns "a/b/c/"
See also Name and Ext sPath=Path("/usr/mitnick/hacker.loot") # returns "/usr/mitnick/" Path("~/.cshrc" full ) /home/crepe/.cshrcSee also: Name() and Extension() functions which return two other components of the full file name. Path ( indexTable ) → s_sourceFile returns the string path to the source data file for the indexTable . The full name is returned by the File function. Example: write index mol "/data/chem/nci.sdf" "./nci.inx" read index "./nci.inx" Path(nci) # returns location of the source nci.sdf file /data/chem/See also: write index , File( T_indexTable database )
Path ( origin [ s_script_with_args ] )
Example in which Path finds icm executable runs the script with it: Path(origin "myicmscript.icm file.icb v max=2.3") /pro/icm/icm/icm myicmscript.icm file.icb v max=2.3
Versions before 3.52 used Path(unix) syntax.
Path ( preference )
Note, that the current version of ICM stores user preferences in the ~/.config/Molsoft.conf file under Linux.)
Path ( s_somePath fix )  returns a string with simplified separators (useful when you want to compare different paths) Example: Path("/home/"+"/"+"theuser//" fix ) # == "/home/theuser/"
function returning an array or 'pointers' to various types of dataobjects in ICM, for example an array of chemical compounds. The dataobjects types of an element (one cell) may include: chemical, image, grob, object, sequence, sarray, iarray or rarray, and collection. Parray( grobiarrayobjectrarraysarraysequence i_n ) or Parray( i_n iarrayobjectrarraysarraysequence) create an empty parray of the specified cell/elementtype. To store images, use the Image function, to store logicals see below. Extracting the parray elements back to shell objects can be done with one of three methods:
Parray ( s_smiles smiles ) Parray ( s_molFileText mol ) Parray ( matrix ) add a column of rowarrays. E.g. add column t Parray(Matrix(10)) set property plot t.A Parray ( model s_modelName )  returns an empty parray of type model It has two reserved fields "type" (set to "Custom" ) and "dim" . This object also behaves as a collection which can hold additional named elements. Parray ( object )  returns an object parray containg all ICM molecular objects loaded Parray ( object os [stack] )  returns an object parray of ICM molecular objects from the object selection. If stack keyword is specified, the current stack is stored into the object. Parray ( sequence rs )  returns a sequence parray of size 1 containing the residues specified. Parray ( sequence [selection] )  returns a sequence parray containing all sequences loaded into ICM (with the selection option only the GUIselected ones). Parray ( sequenceobject i_n )  returns a sequence parray or object parray containing i_n empty objects Example: read table mol "ex_mol.mol" name="t" s = String(t.mol[1]) # sss contains mol/sdf text t.mol[1] = Parray(s mol) # sss is parced and converted
function. Pattern ( { s_consensus  ali } [ exact ] )  returns sequence pattern string which can be searched in a single sequence with the find pattern command or in a database with the find database pattern=s_pattern command. If ICMconsensus string s_consensus is provided as an argument, the string is translated into a regular pattern expression (e.g. an expression "R+. ..^D" will be translated to "R[KR]?\{3,6\}[ACGS]D" ). If alignment ali_ is given as an argument, the pattern is either extracted directly from the alignment, option exact, or is converted to consensus first, and only after that translated into a pattern. For example, an alignment position with amino acids A and V will be transformed into pattern [AV] with option exact and into pattern [AFILMPVW] without the option. Additionally, the exact option will retain information about the length of the flanking regions. Example: read sequence s_icmhome + "zincFing" group sequence aaa align aaa show Pattern("#~???A% ?P") # symbols from consensus string show Pattern(aaa) show Pattern(aaa exact) Pattern ( s_seqPattern prosite  residue )  returns string containing the prosite formatted sequence pattern. The input string s_seqPattern is an ICM sequence pattern . Pattern ( rs ) → s_res_barcode  returns string "barcode" with selected residues followed by the length of the intervening gaps. This function can be applied with the 'B' and 'Q' residue selections. E.g. read pdb "1xbb: Pattern(Res( Sphere( a_H a_A 1.1))) A47ME1AE1G46L a_*.*/BA47ME1AE1G46L Pattern ( seq disulfide ) → s_Cys_pattern  e.g. Pattern(1crn_a) returns "C??C???...C"style pattern
function (or rather a reserved name). Pi  returns the real value of Pi ( 3.14...). Examples: print Pi/2.
function. Potential ( as_targets as_charges )  returns rarray of Nof( as_targets) real values of electrostatic potentials at as_targets atom centers. Electrostatic potential is calculated from the specified charges as_charges and the precalculated boundary (see also REBEL, make boundary and How to evaluate the pK shift). Examples: read object s_icmhome+"crn" # prepare electrostatic boundary descriptions make boundary # potential from oe*, od* at cz of two args show Potential(a_/arg/cz a_/glu,asp/o?* ) print 0.5*Charge(a_//*)*Potential(a_//* a_//* ) # the total electrostatic energy which is # actually calculated directly by show energy "el"
mathematical function. Power ( r_base, { r_exp  i_exp} )  returns real r_base^{r_exp} or r_base^{i_exp}. Note that r_base may be negative if the exponent is an integer, otherwise error will be produced. Power ( r_base, R_exp )  returns rarray of the r_base taken to the R_exp powers.
Power ( R_base, r_exp )
 returns rarray with each of the R_base elements taken to the r_exp power.
Power ( r_base, M_exp )
 returns matrix of the r_base taken to the M_exp powers.
Power(2.,{1. 2. 3.}) # returns {2.,4.,8.} Power ( rarray, r_Exponent )  returns rarray of elements taken to the specified power. Power ( matrix, integer )  for square matrix returns the source matrix taken to the specified power. If the exponent is negative, the function returns the nth power of the inverse matrix. Examples: size=Power(tot_volume,1./3.) # cubic root read matrix "LinearEquationsMatrix" # read matrix [1:n,1:n] read rarray b # read the righthand column [1:n] x=Power(LinEquationsMat,1) * b # solve system of linear equations a=Rot({0. 1. 0.}, 90.0) # create rotation matrix around Y axis by 90 degrees if (Power(a,1) != Transpose(a)) print "Wrong rotation matrix" # the inverse should be # equal to the transposed rotate a_1 Power(a,3) # amatrix to the third is # three consecutive rotations See also: Log
Predict( chem_array ) returns table with specified chemical properties:
Predict( chem_array {s_propertyP_model} ) returns rarray with one of the following properties : "DrugLikeness","MolArea","MoldHf","MolHalfLife","MolLogP","MolLogS","MolSynth","MolPSA","Volume" See description above. Additional functions are listed here.
see above, or applies the model specified as the second argument. An array of the property names for loaded models can be returned by the Name ( chemical property ) function. Examples: Predict(Parray( "C1CCNCC1" ) ) #>T #>DrugLikenessMoldHfMolLogPMolLogSMolPSAVolume 1.006698 11.227206 0.746186 0.528251 12.391162 102.286931 read table mol "drugs" add column drugs Predict(drugs.mol "MolLogP" ) name="MolLogP" 746186
function. Probability ( s_seqPattern )  returns the real probability of the specified sequence pattern. To get mathematical expectation to find the pattern in a protein of length L, multiply the probability by LLength( s_seqPattern). Examples: # chance to find residues RGD at a given position show Probability("RGD") # a more tricky pattern show Probability("[!P]?[AG]") Probability ( i_minLen, r_Score [, { identity  similarity  comp_matrix  sort } ] )  returns the real expected probability that a given or higher score ( r_Score) might occur between structurally unrelated proteins (i.e. it is essentially the probability of an error). This probability can be used to rank the results of database searches aimed at fold recognition. A better score corresponds to a lower probability for a given alignment. The four types of scores
Example: Probability( 150, 30, identity)*55000. is the mathematical expectation of the number of structurally unrelated protein chains of 150 residues with 30% or higher sequence identity which can be found in a search through 55000 sequences. The inverse function is Score . Probability ( ali_2seq, [ i_windowSize1 i_windowSize2 ] [ local ] )  returns the rarray of expected probabilities of local insignificance of the pairwise sequence alignment ali_2seq. The Karlin and Altschul score probability values (option local ) or local ZEGA probabilities (see also Probability(i_, r_)) are calculated in multiple windows ranging in size from i_windowSize1 to w_windowSize2 (default values 5 and 20 residues, respectively). The exact formulae for the Karlin and Altschul probabilities (option local ) are given in the next section and the ZEGA probabilities are given in the Abagyan&Batalov paper. The window with the lowest probability value is chosen in each position. The array returned by this function can be used to colorcode the regions of insignificant sequencestructure alignment in modeling by homology. One can use the Rarray(R_,ali_,seq_) function to project the array onto selected sequence. To calculate an array of mean scores for each column of a multiple sequence alignments use the Rarray( ali [ exact ] ) function. Example: read alignment s_icmhome+ "sx" # 2 seq. alignment read pdb s_icmhome+"x" p= Log(Probability(sx)) display ribbon a_ color ribbon a_/A Rarray(p,sx,cd59) # Rarray projects the alignment array to the sequence Probability ( seq_1 seq_2 [ i_windowSize1 i_windowSize2 ] )  returns a dot matrix of probabilities of local statistical comparison between the two sequences. This matrix contains local probability values that two continuous sequence fragments of length ranging from i_windowSize1 to w_windowSize2 have statistically insignificant alignment score , which means that the match is random. Visualization of this matrix allows one to see periodic patterns if sequence is compared with itself as well as identity alternative alignments. The formula is taken from the Karlin and Altschul statistics: P= 1exp(exp(Lambda*Sum(score in window)/K)), where Lambda and K are coefficients depending on the residue comparison matrix. This example allows one to trace the correct alignment despite an about 100 residue insertion: read pdb sequence "2mhb" read pdb sequence "4mbn" m=Probability(2mhb_a 4mbn_a 7 30) print " pProbability: Min=" Min(Min(m)) "Max=" Max(Max(m)) PLOT.rainbowStyle="white/rainbow/red" # show probability of the chance matching (comparable to the BLAST Pvalue) plot area m display color={.2 0.001} transparent={0.2 1.} link grid # OR show Log10(Probability) plot area Log(m,10) display color={0.7 3.} transparent={0. 0.7} link grid
function. Profile ( alignment )  creates profile from an alignment
Property ( grob option )  returns various advanced grob properties as logical. Available options:
See also set property
Putarg( s_name s_value )  adds a namevalue pair to the list of ICM arguments. Returns no in case of error. See Getarg .
function to change or add value to environment. Putenv ( " s_environmentName = s_environmentValue " )
returns a logical yes if the named shellenvironment variable is created or modified.
 function to push the icm or icmscript arguments (see Getarg ) into the unix shell as shell arguments. Returns the number of set variables. To eliminate an agrument from the list, use the Getenv ( s_argName delete ) function.
show Putenv("aaa=bbb") # change/add variable 'aaa' with value 'bbb' to environment show Getenv("aaa") # check if it has been successful See also: Existenv, Getenv, Getarg.
atomic radii (van der Waals, surface energy, and electrostatic). Radius ( as )  returns the real array of van der Waals radii of atoms in the selection. These radii are used in the construction of the molecular surface (skin) and can be found (and possibly redefined) in the icm.vwt file.
Radius ( as ball )
 returns the rarray of the graphical radii of the xstick or ball representation. Normally they are defined by the
GRAPHICS.stickRadius parameter and GRAPHICS.ballStickRatio . They can be set to custom values with the
set atom
[ Random string ] evenly distributed random function.Random ( )  returns a pseudorandom real in the range from 0. to 1. Random ( i_max )  returns a pseudorandom integer distributed in [1, i_max ] Random ( i_min , i_max )  returns a pseudorandom integer distributed in [ i_min , i_max ] Random ( r_min , r_max )  returns a pseudorandom real evenly distributed in [ r_min , r_max ] Random ( r_min , r_max , i_n )  returns a rarray [1: i_n ] with pseudorandom real values distributed in [ r_min , r_max ] Random ( r_mean , r_std , i_n , "gauss" )  returns a rarray of i_n elements with normally distributed pseudorandom values. The mean and standard deviation are provided as the first two arguments Random ( r_min , r_max , i_nRows , i_nColumns )  returns a matrix [1: i_nRows, 1: i_nColumns] with pseudorandom real values distributed in [ r_min , r_max] Random ( i_nRows, i_nColumns, r_min, r_max )  returns a matrix [1: i_nRows, 1: i_nColumns] with pseudorandom real values distributed in [ r_min, r_max ] Examples: print Random(5) # one of the following: 1 2 3 4 or 5 print Random(2,5) # one of the following: 2 3 4 or 5 print Random(2.,5.) # random real in [2.,5.] randVec=Random(1.,1.,3) # random 3vector with components in [1. 1.] randVec=Random(3,1.,1.) # the same as the previous command randMat=Random(1.,1.,3,3) # random 3x3 matrix with components in [1. 1.] randMat=Random(3,3,1.,1.) # the same as the previous command Random(0., 1., 10, "gauss" ) # normal distribution
Random( I_lengths s_alphabet )  returns an sarray of random strings of lengths specified in the I_lengths array. Strings are comprised from the characters specified in the s_alphabet. Alphabet specifications are the same as character set specifications in regular expressions: "AZ", "\\w", "\\dAFaf", "ACGT". Random( i_n S_words )  returns an i_n element sarray consisting of the words specified in the S_words array repeated in random order. Examples: Random( Iarray(10,20) "\\dAZ" ) # returns 10element sarray with 20character strings containing random digits and capital letters Random( 100, {"rock","paper","scissors"} ) # returns 100element sarray consisting of words "rock", "paper" and "scissors" in random order Random( 100, Random( Iarray(10,3) "az" ) ) # returns 100element sarray containing 10 random words from the "az" alphabet
[ rarray sequence projection  Rarrayinverse  R property transfer via alignment  Rarray properties  RarrayAlignment ] realarray function.Rarray ( i_NofElements )  returns a rarray; creates zeroinitialized rarray [1: i_NofElements]. You can also create an zerosize real array: Rarray(0) . Rarray ( i_NofElements, r_Value )  returns a rarray [1: i_NofElements ] with all elements set to r_Value. Rarray ( i_NofElements, r_From, r_To )  returns a rarray [1: i_NofElements ] with elements ranging from r_From to r_To. Rarray ( r_From, r_To , r_step )  returns rarray of equally spaced numbers from r_From to r_To. Example: Rarray( 3.1, 15. 0.1) Rarray ( iarray )  converts iarray into a rarray. Rarray ( sarray )  converts sarray into a rarray. Rarray ( sarray s_patternForValue1 )  converts sarray into a rarray of 1. and 0. The value is 1. if an element if an array matches the string. E.g. Rarray({"M","W","M","E","W"},"M") # returns {1. 0. 1. 0. 0.}
Rarray ( R n_significantDigits ) → R_rounded
 rounds the input array to the specified number of significant digits. If n is out of bounds ( less than zero or more than 12, the function switches to the default of 2.
Examples: a=Rarray(54) # create 54th dimensional vector of zeros a=Rarray(3,1.) # create vector {1.,1.,1.} a=Rarray(5,1.,3.) # create vector {1., 1.5, 2., 2.5, 3.} a=Rarray({1 2 3}) # create vector {1. 2. 3.} a=Rarray({"1.5" "2" "3.91"}) # create vector {1.5, 2., 3.91} # M=Matrix(2);M[2,2]=2;M[1,2]=3 Rarray( M ) Rarray( M 1 ) Rarray( M 2 ) Rarray( M 3 ) Rarray( M 4 ) Rarray( M 5 ) Rarray( M 6 ) Rarray( M 7 )
Rarray ( R_ali ali_from { seq  i_seqNumber } )  returns a projected rarray. The R_ali rarray contains values defined for each position of alignment ali_from. The function squeezes out the values which correspond to insertions into sequence seq_, that is, in effect, projects the alignment array R_ali onto sequence seq_. E.g. for the residue conservation: Rarray( Rarray( alig ), alig , myseq )  Projecting from one sequence to another sequence via alignment. Let us imagine that we have two sequences, seq1 and seq2 which take part in multiple sequence alignment ali . The transfer of property R1 from seq1 to seq2 can be achieved via two transfers :
See also:
Rarray ( rarray reverse )  converts input real array into an rarray with the reversed order of elements. Example: Rarray({1. 2. 3.} reverse) # returns {3. 2. 1.}
Rarray ( R_seq { seq  i_seqNumber } ali_to r_gapDefault )  projects the input rarray from seq_ to ali_to (the previous function does it in the opposite direction). The R_seq rarray contains values defined for each position of the sequence seq_. The function fills the gap positions in the output array with the r_gapDefault values. Combination of this and the previous functions allow you to project any numerical property of one sequence to another by projecting the r1 property of seq1 first to the alignment and than back to seq2 (e.g. Rarray( Rarray(r1,seq1,a,99.) , a, seq2) ). This function can also be used to determine alignment index corresponding to a sequence index. Example: read alignment s_icmhome+"sh3" t = Table(sh3) group table t Count(Nof(t)) "n" append # add a column with 1,2,3,.. show t # t looks like this: #>T t #>consFynSpecEps8n " " 0 1 1 1 " " 0 2 2 2 " " 0 3 3 3 " " 0 4 4 4 . 1 5 5 5 ... t2forFyn = t.Fyn == 2 # table row for position 2 in seq. Fyn t2forFyn.n # corresponding alignment position See also the String( s_,R_,seq_,ali_,s_defChar ) function to project strings.
Rarray ( sequence R_26resProperty )  returns a rarray of residue properties as defined by R_26resProperty for 26 residue types (all characters of the alphabet) and assigned according to the aminoacid sequence. Example with a hydrophobicity property vector: s= Sequence("TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN") # crambin sequence # 26dim. hydrophobicity vector for A,B,C,D,E,F,.. h={1.8,0.,2.5,3.5,3.5,2.8,.4,3.2,4.5,0.,3.9,3.8,1.9,3.5,.0,1.6,3.5,4.5,.8,.7,0.,4.2,.9,0.,1.3,0.} hs=Rarray(s,h) # harray for each sequence position hh = Smooth(Rarray(s,h), 5) # window average
Rarray ( ali [ simpleexact ] )  returns a rarray of conservation values estimated as mean pairwise scores for each position of a pairwise or multiple alignment. The number is calculated as the sum of RESIDUE_COMPARISON_VALUES over n*(n1)/2 pairs in each column. The gapped parts of an alignment are considered equivalent to the 'X' residues and the comparison values are taken from appropriate columns. Option exact uses raw residue substitution values as defined in the comparison matrix These values can be larger than one for the residues the conservation of which is important (e.g. W to W match can be around 3. while A to A match is only about 0.5. By default (no keyword) the matrix is normalized so that two identical residues contribute the replacement value of 1. and two different but propertysimilar amino acid contributed values from 0. to 1. depending on the residue similarity. If option simple is specified, each pair with identical residues contributes 1. while each pair of different aminoacids contributes 0. The resulting total of pairwise similarities d calculated for n(n1)/2 pairs is then converted into the conservation value with the following equation: c = Â½(1+ âˆš(8Â·d +1) ) (a solution of the equation n^{2}  n = 2d ) and further divided by the number of sequences in the alignment
The values returned with both simple option and the default are therefore between 1/n (all residues are different) and 1.
To project the conservation onto a 3d chain with its linked sequence in alignment use the
Rarray( R_conserv alignment seq3d) projection function. e.g.
read alignment s_icmhome+"sh3" show Rarray(sh3) # a=Rarray(sh3 simple) # a number for each alignment position # to project a to a particular sequence, do the following b=Rarray(a,sh3,Spec) # a number for each Spec residue String(Rarray(a, sh3, Spec ))//String(Spec) # example See also:
generally converts things to a real. Real ( integer )  converts integer to real number. Real ( string )  converts string to real number. The conversion routine ignores trailing nonnumerical characters. Examples: s = "5.3" a = Real(s) # a = 5.3 s = "5.3abc" # will ignore 'abc' a = Real(s) # the same, a = 5.3See also: Toreal
Returns the remainder; similar to, but different from the Mod function.
Remainder ( i_divisor, [ i_divider ] )  returns the integer Remainder ( r_divisor, [ r_divider ] )  returns the real remainder r = x  n*y where n is the integer nearest the exact value of x/y; if  nx/y=0.5 then n is even. r belongs to [ y/2, y/2 ] range Remainder ( iarray, [ i_divider ] )  returns the iarray of remainders (see the previous definition). Remainder ( rarray, [ r_divider ] )  returns the rarray of remainders. The default divider is 360. (real) or 360 (integer) since we mostly deal with angles. Examples: read object s_icmhome+"crn.ob" # transform angle to the standard # [180., 180.] range. (Period=360 is implied) phi=Remainder(Value(v_//phi)) # we assume that you have two objects # with different conf. of the same molecule
Reference( seq [ s_fieldName ] )  returns the swissprot database reference if available. It is possible to specify the requested field name; the default is "DR".
[ Replace exact  Replace simple  Replace regexp  Chemical replace ]  text substitution function.
Replace( sS s_regexp s_by regexp [i_field=0] ) → sS
(regular expressions, and casesensitivity,  see below).
a=Replace(" 1crn "," ","") # remove empty space Replace ( s_source S_fromArray S_toArray )  make several replacements in a row. The size of the two arrays must be the same. Example which generates a complimentary DNA strand (actually there is a special function Sequence( seq_, reverse ) which does it properly). invertedSeq = String(0,1,"GTAAAGGGGTTTTCC") # result: CCTTT.. complSeq=Replace(invertedSeq,{"A","C","G","T"},{"T","G","C","A"}) # result: GGAAA... Replace ( s_source S_fromArray s_replacement )  replace several strings by a single other string. If s_replacement is empty, the found substrings will be deleted. Example which generates a complimentary DNA strand: cleanStr=Replace("XXTEXTYYTEXT",{"XX","YY"},"") Replace ( S s_icmWildcard s_replacement )  returns a sarray with globally substituted elements (the original sarray remains intact). Examples: aa={"Terra" "Tera" "Teera" "Ttera"} show column aa Replace(aa "er?" "ERR") Replace(aa "*[tT]" "Shm") Replace ( S S_fromArray S_toArray ) or Replace ( S k_translation_nameval_collection [s_nonMatchFormat]))
 returns a sarray with multiple substitutions.
Replace( S s_completeString s_by exact ) → S Search a string array and find an element which matches the full s_completeString, e.g. the "never again" element of S will only be matched with the "never againg" string, but not with "never" .
Replace( sS s_whatAsIs s_byAsIs simple ) → s_S In this case there is not intepretation of the query string. The first occurrence of it is replaced with the second argument. Example: s="a[b]()c" Replace(s,"[b]","()$",simple) # no intepretation
Replace( sS s_regexp s_by regexp [i_field = 0] ) → sS  replace the s_regexp in the source string or array by s_byRegexp using regular expressions. The latter is a string which may contain backreferences.
Example: caseinsensitve replacements: Replace("bla 1"//"Bla 2"//"BLA 3" , "(?i)bla ","") # get rid of bla Example: read string "t.html" s_out = Replace( s_out, "(?n)<i>(.*?)</i>", "<b>\\1</b>" regexp ) # replace italic with bold s_out = Replace( s_out, " +", " ",regexp ) # replace multiple spaces with a single on Note that "(?n)" modifier is needed to make '.' match newline too.
Dehtmltagging of the html text in a string or a string array:Prep work in html conversion is usually this:
<>
S = Replace( S, " ","\n\n", exact) S = Replace( S, " "," ", exact) # finally remove all tags S = Replace( S, "<.*?>","",regexp) <> Example in which we remove href html tags from a column in a table : read table html "http://pfam.sanger.ac.uk/search/keyword?query=sh2" name = "sh2t" sh2t.ID = Replace(sh2t.ID, "<.*?>","",regexp)
Replace( chem , s_smartFROM, s_smileTO [exact] ) Finds a chemical pattern containing one of several Rn groups and replaces the pattern to the s_smileTO pattern according to the matching Rgroups. Note that all atoms except the ones connected to the Rgroups in s_smartFROM pattern will only match exactly the same local pattern. The molecules will be redrawn in 2D after the replacement. The exact option will supress the redrawing if the number of atoms in the FROM and TO patterns is the same. Example in which we created a newe table tt with a modified column: read table mol "drugs.sdf" add column tt Replace(drugs.mol, "[R1]C(=O)O","[R1]C(=O)OC") See also: modify chemarray s_pattern s_repl [exact] will modify in place. This replacement can be done only for the "terminal" fragments (one attachment point) `Trimchemical{Trim} ( X [s_smart] ...) will iteratively delete selected atom pattern, e.g. "[*;D1]"
residue selection function. Res ( { os  ms  rs  as } [ append ] )
Res ( { rs [ append ] )
show Res( Sphere(a_1/1/* 4.) ) # show residues within 4 A # vicinity from the firsts one See also: Atom ( ), Mol ( ), Obj ( ).
Res ( ali { seq  i_sequence } )  returns residue selection corresponding to the aligned positions of the specified sequence. The sequence can be specified by its order number in the alignment (e.g. 1crn_m in the example below has number 1 ), or by name.
 returns the Xray resolution in Angstroms. Resolution ( )  returns the real resolution of the current object. Resolution ( os_object )  returns the rarray Xray resolutions for the specified objects. The resolution is taken from the PDB files. Examples: sort object Resolution(a_*.) # resort objects by resolution res=Resolution(a_1crn.)[1] print "PDB structure 1crn: resolution = ", res, " A" Resolution ( s_pdbFileName pdb )  returns the real resolution of the specified pdbfile. The function returns 9.90 if resolution is not found. Resolution ( T_factors [ R_6cell ] )  returns the rarray of Xray resolution for each reflection of the specified structure factor table. The resolution is calculated from h, k, l and cell parameters taken from R_6cell or the standard defCell shell rarray. Example: read factor "igd" # read h,k,l,fo table from a file read pdb "1igd" # cell is defined there defCell = Cell(a_) # extract the cell parameters from the object group table append igd Resolution(igd) "res" show igd See also: set resolution
Ring( as )  returns logical yes all atoms from the selection belong to one ring Ring( vs )  returns subset of input variable selection which belongs to one ring Ring( chemical )  returns chemical array of ring system(s) Ring( chemical simple )  returns chemical array of the smallest set of smallest rings (SSSR) Example: show Smiles( Ring( Chemical("C(=CC=CC1C(=CC=C(C2C3)C=CC=3)C=2)C=1" ) ) unique ) show Smiles( Ring( Chemical("C(=CC=CC1C(=CC=C(C2C3)C=CC=3)C=2)C=1" ) simple ) unique )
crystallographic Rfactor. Rfactor ( T_factors )  returns the real Rfactor residual calculated from the factortable elements T_factors.fo and T_factors.fc. Reflections marked with T_factors.free = 1 are ignored.
crystallographic free Rfactor. Rfree ( T_factors )  returns the real Rfactor residual calculated from the factortable elements T_factors.fo and T_factors.fc. Only reflections marked with T_factors.free = 1 will be used.
RootMeanSquareDeviation function. Rmsd ( { iarray  rarray  matrix  map } )  returns the real standard deviation estimate (sigma) from the estimated mean for specified sets of numbers. This function returns the unbiased estimation of standard deviation with Bessel's correction according to this formula: s = âˆš(âˆ‘(xáµ¢Î¼)Â²/(n1) ), where Î¼ is the sample mean. Rmsd ( Rn Wn )  returns the real weighted rmsd and weighted mean as r_out according to this formula: xw = Sum(w[i]*x[i])/Sum(w[i]) # the weighted mean np # is the number of nonzero weights sdw2 = Sum(w[i]*(x[i]xw)^2) / (((np1)/np)*Sum(w[i])) sdw = Sqrt(sdw2) Rmsd ( as_tetheredAtoms ) returns the real rootmeansquaredeviation of selected atoms from the atoms to which they are tethered . The distances are calculated after optimal superposition according to the equivalences derived from tethers (compare with the Srmsd( as_ ) function which does not perform superposition ). This function also returns the transformation in the R_out array. Rmsd ( ms_select1 ms_select2 chemical [output] )  returns the real rootmeansquare distance between two selected chemical (hetero) molecules after an optimal chemical superposition via graphmatching is performed. In this mode atom equivalence can be found either by substructure search or (if none of molecules is substructure of other) by common substructure search algorithm. Other feature of chemical mode is that it enumerates topologically equivalent atoms to find best superposition. The maximal common substructure will be used for the calculation. Option output will produce R_2out array with individual deviation for the matched pairs. Rmsd(R_2out) will essentially be the overall Rmsd, but one will be able to measure the maximal and median deviation as well. See also Srmsd( ms1 ms2 chemical ) and superimpose command. Rmsd ( chemarray ms_select2 [pharmacophore] )  returns real array of rootmeansquare distances between each element of chemarrayand ms_select2. pharmacophore toggles pharmacophore superposition. ms_select2  pharmacophore template.
Rmsd ( as_pharmTemplate as_select2 pharmacophore )  returns the real rootmeansquare distance between pharmacophore points of as_pharmTemplate and as_select2after an optimal superposition of as_pharmTemplate See also: find pharmacophore , show pharmacophore type , makePharma
Rmsd ( as_select1 as_select2 [ { { alialign }  exact } ] )
read pdb "1mbn" # load myoglobin read pdb "1pbx" # load alpha and beta # subunits of hemoglobin print Rmsd(a_1.1 a_2.1 align) # myo versus alpha subunit # of hemo all atoms print Rmsd(a_1.1//ca a_2.1//ca align) # myo versus alpha subunit # of hemo Caatoms print Rmsd(a_1./4,29/ca a_2.1/2,102/cb exact) # exact match
rotation matrix function. Rot ( R_12transformVector )  extracts the 3x3 rotation matrix from the transformation vector. Rot ( R_axis , r_Angle )  returns matrix of rotation around 3dimensional real vector R_axis by angle r_Angle. To solve the inverse problem, i.e. calculate the angle from a transformation, use the Axis( R_12 ) function which returns the angle as r_out . Examples: # rotate molecule by 30 deg. around zaxis rotate a_* Rot({0. 0. 1.},30.) Rot ( R_3pivotPoint R_3axis , r_Angle )  returns rarray of transformation vector of rotation around 3dimensional real vector R_axis by angle r_Angle so that the pivotal point with coordinates R_3pivotPoint remains static. Examples: # rotate by 30 deg. around {0.,1.,0.} axis through the center of mass nice "1crn" R_pivot = Mean(Xyz(a_//*)) transform a_* Rot(R_pivot,{0. 1. 0.}, 30.)
[ Sarray index ] sarray function.Sarray ( integer )  returns empty sarray of specified dimension Sarray ( integer s_Value )  returns sarray of specified dimension initialized with s_Value Sarray ( integer S_ids )  returns sarray of unique strings using the ID seeds. Examples: Sarray(10,Sarray(0)) # ID1 ID2 etc. Sarray(10,{"A"}) Sarray(10,{"A","B","C"}) # read csv header name='b' s_icmhome + "bnames.csv" # 2K baby names Sarray(10000,Shuffle(Unique(b.name,sort))) # useful for generating identifiers in tables Sarray ( s_wildCard directory [simpleall] )  returns sarray of file names with full path to them. With 'simple' option only file names are stored in the result array. all toggles recursive search in subfolders. Example: Sarray( "*.pdb" directory ) Sarray( "/home/user/*.ent*" directory ) if (Nof( Sarray("*.png") )==0) print "No images found"
Sarray ( string )
 converts the input string into a ONEdimensional sarray .
To split a string into individual lines, or to split a string into a sarray of characters,
use the Split() function.
Sarray ( sarray [32] hash )  generates 32 char or 26 char MD5 based has string. Example in which we create a unique chemical id: add column t Chemical({"C1CCCC1","CCO"}) add column t Sarray(Smiles( t.mol unique cistrans ), 32 hash) Sarray ( rs [ { append  name  residue } ])  converts input residue selection into an sarray of residue ranges, e.g.: {"a_a.b/2:5", "a_a.b/10:15",..} or with option residue into an array of individual selections (see also Name( rs full ) . Options:
Example: Sarray(a_/2,4:5 name) #>S string_array def.a1/ala2 def.a1/trp4 def.a1/glu5 Sarray(a_/2,4:5 residue) #>S string_array def.a1/2 def.a1/4 def.a1/5 Field(Sarray(a_/2,4:5 name),2,"/") # extract residues #>S string_array ala2 trp4 glu5 The l_showResCodeInSelection system logical controls if oneletter residue code is printed in front of the residue number ( e.g. a_/^F23 instead of a_/23 ). See also:
Sarray ( stack, vs_var )  creates a string representation of all the conformations in the stack Variable selection allows one to choose the conformational feature you want. Character code: Backbone (phi,psi pairs):
Sidechain (chi1):
Example: show Sarray(stack,v_/2:10/x*) # coding of sidechain conformations show Sarray(stack,v_//phi,psi) # backbone conformation character coding show Sarray(stack,v_/2:10/phi,PSI) # character coding of a chain fragment(Note use of special PSI torsion in the last example.) Other examples: ss=Sarray(5) # create empty sarray of 5 elements ss[2]="thoughts" # assign string to the second element of the sarray sa=Sarray("the first element") show Sarray(Count(1 100)) # string array of numbers from 1 to 100 Sarray (sarray reverse )  Reversing the order of elements in an sarray  converts input sarray into an sarray with the reversed order of elements. Example: Sarray({"one","two"} reverse) # returns {"two","one"} See also: Iarray( I_ reverse ), Rarray( S_ reverse ), String(0,1,s) Sarray ( sarray i_from i_to ) returns sarray of substrings from position i_from to position i_to . If i_from is greater than i_to the direction of substrings is reversed. Example: a={"123","12345"} Sarray(a,2,3) {"23","23"} Sarray(a,5,2) {"32","5432"}
this function allows one to get Sarray ( T_index )  returns sarray of index table elements Example: read index "myindex" S = myindex[2:8] S[1]See also: write index
[ Score overlap  Score chemset  Score apf  Score model  Score predictions  Score sequence  Score conservation  Score alignment ] function. Summary:Score( <R_X> <R_Y> ) => r [1.:1.] # overlap between two distributions Score( <R_Ei> <R_Di> <wE> <wD> ) => <r> # prediction quality Score( <I_keys1> <I_keys2> <nBits><R_bitWeights> [simple] ) => M # Tanimoto distances Score( <seq1> <seq2> [newnucleotidesimple] ) => <R_scores> Score( <seqArray[n]> ) => Mnn_alignedScore Score( <i_len> <r_probability> [comp_matrixsimilarityidentity] ) => <r_> Score( <ali2> [areasortcomp_matrixsimilarityidentity [<i_alnLength>] ] ) => r # see also Distance (<ali>), and Rarray(<ali>) Score( <X_n> <X_m> [[<R_Wn> <R_Wm>] <r_minScore> (0.4) [<r_steepness>(6.)]] set ) => r_inter_set_score [0:1] Score( <X_3D_n> [<X_3D_m>] fieldsimilaritydistance ) => <M_nxm APF_scores> # needs Chemical(<as> exact hydrogen) Score( <rs_n> [simpleinfocomp_matrix] ) => <R_n_conserv_scores> # info is entropy Score( <rs_n> <seq_n> ) => <r_score_without_alignment> Score( <rs_n> <seq_n> all ) => <T_sel_scores_seqids> Score( <model> fulltest [<s_stats>] ) => <r_learnStatistics> Score( predict <RI_obs> <RI_pred> [<R_weights>] ) => <R_allRegression_or_Classification_Stats>
Score ( R_1, R_2 ) → r_overlapMeasure
 returns the real measure of overlap between two real arrays.
This measure varies between 1 and 1..
(all values of R_1 are smaller than all values of R_2) and +1.
(all values of R_1 are greater than all values of R_2)
and may serve as a ranking criterion.
show Score({1. 2. 5. 3.} {3. 1.5 1.5 5.}) # 0. perfectly overlapping arrays show Score({2. 5. 3.} {1. 1.5 0.5}) # 1. no overlap R_1 > R_2 show Score({1. 1.5 0.5} {2. 5. 3.}) # 1. no overlap R_2 > R_1 show 1.Abs(Score({1. 3. 2.5} {2. 5. 3.})) # relative overlap between R1 and R2
Score( X_n X_m [[R_Wn R_Wm] r_minScore (0.3) [r_steepness(6.)]] set ) → r_sim_score [0:1] This function returns a similarity (0. to 1.) between two sets (arrays) of chemicals. It is calculated as N_{AB} /( N_{AA} + N_{BB}  N_{AB} ), where N is an effective number is similar compounds calculated as weighted sum of sigmoidly transformed similarities to the power of one half. The original similarity measure is transformed by a sigmoid starting from r_minScore (0.) and ending at 1. The mid point of the sigmoid is at 0.5*(1+ r_minScore ) . A general form of the sigmoid before it is shifted and squeezed is 1./(1.+exp(b*t)) where b is r_steepness . Arguments:
Score( t.mol tt.mol set )
Score( X_3Dn [X_3Dm] fieldsimilaritydistance ) → M_nxm apf_scores returns all pairwise APF scores between 3D chemical arrays. Two prerequisities:
Example: build string "H" build string "W" build string "A" add column t Chemical(a_*. exact hydrogen ) name="mol" read pmf s_icmhome+"APF" show Score(a_1. a_2. field) sf = Score( t.mol field ) ss = Score( t.mol similarity ) sd = Score( t.mol distance ) CS = Rarray( ss 6 ) # off diagonal elements Mean(CS) # average similarity If the two sites (or atoms sets) are not superimposed, use the siteSuperAPFas1 as2 exact macro which makes the superposition and returns the unnormalized score. The normalized score can be returned after converting the superimposed selections into a 3D chemical array with the Chemical( as exact ) function Alternatively, the normalization can be done directly by the above formula ( S_ij = Sij/Sqrt(Sii*Sij) if selfscores are calculated.
Score ( model [ test  full ] s_stats ) → r_PredictionQuality Categorical or class prediction (e.g. Bayesian classifier). If each data record has a label which can be either positive or negative (say, 1, or 1) then the success of a prediction method can be measured by the following measures:
Quality measures to evaluate a regression method predicting numerical values, e.g. Partial Least Squares, or Kernel Regression.
Score ( R_En, R_Dn, wE, wD ) → r_PredictionQuality Evaluates the quality of submitted multiple predictions for a unknown outcome. The submitted provies R_En , the evaluator evaluates R_Dn from the correct answer, then plugs in the weights and calculates the quality. The Q (quality)value of predicted "energies" R_En for n  states, by comparing predicted energies with the deviations R_Dn from the correct answer. In essence we are doing the following:
The Qvalue is calculated as follows: Q =  Log( Sum( exp( wE#(EiEmin) wD*Di )) / Sum(exp( wE#(EiEmin))) ) The best Q value is 0. (it means that zero deviation (Di=0.) correspond to the best energy and the energy gap is large. The weighting factors wE and wD can be used to change the relative contributions of energies and deviations.
Score ( sequence1, sequence2 )
read sequence msf s_icmhome+"azurins.msf" a = Score( Azur_Alcde Azur_Alcfa ) # it is around 90. Score ( seq_n_long, seq_m_short simple ) → R_nm+1_scores returns an array of scores of sliding nogap sequences. Score ( seq_n, rs_N ) → r_no_gap_score Score ( seq_n, rs_N all ) → T_Nn_scores_ids_for_all_frames these two functions return the match or nogapalignment score for one frame or multiple frames with the all option. The second function template returns a table with the following columns: i (relative number), nu (first residue number), sl (fragment selection string), se (the first residue code), sc (normalized alignment score divided by the sequence selfscore and multiplied by 100., id (sequence identity), sf (relative surface area), ss ( relative nonloopsecondary structure ). id , sf , ss range from 0. to 100. % . Make sure to assign the secondary structure and calculate the atomic surface areas before you fun the Score(.. all ) function. Example: build string "ASDFY" a=Sequence("SDF") assign sstructure a_/A show surface area t = Score( a_/A a all) show t
See also: Distance( ).
Score ( rs, [ simple  comp_matrix  info ] ) Setup: a multiple sequence alignment, one of the sequences is linked to a structure, you may want to color residues by conservation or other measure of a column in an alignment. For a straight conservation value for each position in an alignment see Rarray( ali ) The function returns the rarray of alignmentderived conservation values for the selected residues. For each residue Ri in the residue selection rs_ the following steps are taken:
Example in which we compare conservation on the surface and in the core: read alignment s_icmhome+"sh3.ali" read pdb "1fyn" make sequence a_a group sequence sh3 align sh3 display ribbon color ribbon a_a/A Score( a_a/A simple ) show surface area show Mean( Score( Acc(a_a/*) ) ) # conservation score for the surface show Mean( Score( a_a & !Acc(a_/*)))# conservation score for the buried
See also: Rarray( ali [simple] )
Score ( ali2, [ { identity  similarity  comp_matrix  sort } [i_alnLength] )
To extract a pairwise alignment of sequences 1 and 2 from a multiple alignment use the Align( ali I_seqIndexes ) function, e.g. make sequence 5 20 # 5 random sequences of length 20 align sequence # creates aln Score( Align(aln, 1//2 ), identity) # 1//2 results in an iarray {1,2} To return a matrix of all pairwise seq. identities, use this: n = Nof(sequence) mdist = (Matrix(n,n,1.)  Distance(Parray(sequence ) )) * 100. # 100 for identities Score ( i_minLen, r_Probability [, { identity  similarity  sort } ] )  returns the real threshold score at a given r_Probability level of occurrence of alignment with a protein of unrelated fold. The threshold is related to the corresponding method of the score calculation (see above). For example, Score( 150, 1./55000.,identity)gives you the sequence identity percentage for sequences of 150 residues at which only one false positive is expected in a search through the Swissprot database of 55000 sequences. See also the inverse function: Probability .
[ Select break  Select fix  Select neighbors  Select by nmembers  Select graphical  Select expand  Select by atom property  Select_projection  Select_by_text  Select_by atom numbers  Select_patching  Select_lists  Select_by_sequence  Select by alignment  Select by center of mass ] Selection of atoms according to their coordinates or properties, transferring a selection to another object, or selecting by relative objectspecific atom numbers stored in an integer array, or by sequence distance.
Select() → as_graph_or_displayed_or_current Select(as_source cond ) → as # conditions: "c" from x,y,z,b,o,c,f,a,u,v,w,n e.g. Select(a_ "b>80") Select(osmsrsas s_exprfieldNamecond ) → omras # 'n' number_of, 'r' resolution Select(as_source I_indices ) → as Select(as_source hydrogenhbondsmooth ) → as_expandByTerminalAtoms Select(as_source fixunfix) → as_atomsOn(un)FixedBranches Select(as_source bond nNeighbors ) → as_atomsWithN_neighbors Select(as_source molecule i_mol ) → as_atoms_of_ith_disconnected_fragment Select(as grob ) → as_subset_in_grob_vicinity Select(grob ) → as_currentObjAtomsNearGrob Select(rs_patches i_MaxGapSize ) → rs_patchSmallGaps # e.g. Select(a_/1:2,4:6 2) → a_/1:6 Select(rs_patches margin,i_size ) → rs_expand_by_margin Select(as error ) → as_flankingBackboneBreak Select(as_inObjA os_objB ) → as_inObjB Select(seq [ ms_where [r_min_seqid(0.2) [r_mx_length_dist(0.3)]]] ) → ms_sim_seq
Select( as delete  error ) → as_bad_atom_pairs this function returns pairs of atoms (i) connected with abnormal bond lengths, and, (ii) breaks in the backbone of a polypeptide (even if a 'C' carbon and the following 'N' are not bound covalently). Example in which we find residues flanking the missing loop: read pdb "2pe0" display ribbon display residue label Res(Select(a_ delete ))
Select ( as fix  unfix ) select atoms of the fixed or rotatable branches, for the fix or unfix options, respectively.
Select( as bond i_NofBondedAtoms )  returns a subselection of as with atoms having the specified number of covalent neighbors. Example: build smiles "CCO" show Select(a_ bond 1) # selects all terminal hydrogens show Select(a_ bond 2) # selects oxygen that is bonded to C and H show Select(a_ bond 3) # no atom has three neighbors: show Select(a_ bond 4) # carbons have 4 neighbors See also: selecting by SMARTS patterns
These functions allow one to select objects according to the number of molecules in them, and molecules according to the number of residues in them.
Select ( os "n==nofMolecules" ) Allowed comparison operations : ==, >, >=, <, <=, != . Example: Select( a_A,N "n==1" ) # all single residue amino or nucl molecules Select( a_A,N "n>1" ) # all longer residue amino or nucl molecules
Select ( [ residue  molecule  object ] )  returns either selected ( as_graph ) or displayed atoms ( a_*.//DD ). By providing the argument, you can change the selection level. Example: display skin Select(residue)
Select ( as_source [ hbond  hydrogen  smooth ] )  returns the source selection expanded to single covalently bonded atoms, e.g. hydrogens. The returned selection is at the atomic level. Options:
Select(a_/tyr/o* hbond ) # adds hh to this selection Select(a_/tyr/cb hydrogen ) # adds hb1 and hb2 Select(a_//ca,c,n smooth ) # carbonyl oxygen and Nterminal hydrogens
Select ( as s_condition [ r_Value] )  returns a subselection of atom selection as_ according to the specified condition s_condition.
Select ( osmsrs s_condition )
 can use field names (see set field sel name=.. ) or presets 'n' for number of molecules in an object
or number of residues in a molecule. Also 'r' for resolution (eg 'r<2.3' )
See also the related functions: Area, Bfactor, Xyz, Charge, Field . Examples: build string "se glu arg" show Select(a_//* "charge < 0.")Select(a_//c* "x> 2.4") show Select(a_//c* , "x>", 2.4) show Select(a_/* , "w>3.") # 3rd res. user field greater than 3. Note: atoms with certain Cartesian coordinates can also be selected by multiplying selection to a box specified by 6 real numbers {x,y,z,X,Y,Z}, e.g. show a_//* & {1.,10.,2.,25.,30.,22.} or a_//* & Box( ). See also: display box and the Box function.
Select ( as_sourceSelection os_targetObject )
build string "ASD" aa = a_/2/c* # selection in the current obj a_ copy a_ "b" # a copy of the source object bb = Select(aa,a_b.) # selection aa moved to a_b.
Select ( os_sourceObject S_residueSelStrings )  returns residue selection of the residue selection strings which can be returned with the Sarray ( rs_ residue ) function. The object name can be skipped. E.g. Select( a_2ins. {"a/14","b/14"} )
Select ( os_sourceObject I_atomNumbers )
Select ( rs_fragmented_selection [smoothmargin] i_gapSizeToHeal ) This function by default (or with option smooth) will take a source residue selection, identify all gaps of size below the specified parameter and will healing those gaps by adding them to the selection. For example, if you have a residue selection, e.g. a_/1,2,5,6 Select(a_/1,2,5,6 2 ) # residues 3 and 4 will be added a_/1,2,3,4,5,6 Option margin will simply expand the source selection by the specified margin size.
Select ( as_source "vw,14,hb,el,cn,tz" ) Interacting atoms.selecting atoms interacting with the source atoms according to a particular energy term. It is required that the source atoms are in the current ICM object and show energy command has been used at list once. See example below. Tether destination atoms.In case of tethers ("tz") this function returns a selection of the static destination atoms (same as a_//Z ). Example: build string "se ala his trp" copy a_ "tz" tether # make a copy object and tether atoms to a_tz. show energy "vw,hb" aca = a_//ca # selection of Ca atoms Select( aca "vw,hb" ) Obj(Select( aca "tz" )) 2 a_tz. Type: ICM Mol: 1 Res: 1 def
Select(seq [ ms_where [r_min_seqid(0.2) [r_mx_length_dist(0.5)]]] ) → ms_sim_seq  returns molecular selection of all chains with sequences similar to seq . Arguments and options:
read pdb "1crn" read pdb "2ins" Select( Sequence( a_2.2 ) ) display ribbon a_ color ribbon magenta Select( Sequence( a_2.2 ) a_*. 0.2 0.3 )
Select( rs_as_ alig ) → selection_propagated_by_ali
To select the closest residue from a center of mass of one selected residue, use the Sphere function with a coordinate matrix argument. We need to follow these steps:
E.g. read pdb "1crn" display center_of_mass = Mean(Xyz(a_/44)) display xstick magenta Res(Sphere( center_of_mass , a_1. & a_/!44 , 7.5) ) # Res is added to select all residue atoms once an atom is inside the sphere To find the closest residue to residue 44 in the above example, use the table approach, e.g. read pdb "1crn" display center_of_mass = Mean(Xyz(a_/44)) nb = Res(Sphere( center_of_mass , a_1crn. & a_1crn./!44 , 7.5) ) if(Nof(nb)>0) then group table t Rarray(0) "dist" Sarray(0) "sel" for j=1,Nof(nb) add t cmj = Mean(Xyz(nb[j])) t.dist[j] = Distance( center_of_mass, cmj ) t.sel[j] = String(nb[j]) endfor sort t.dist # the smallest distance is on top ([1]) now s_closest_res = t.sel[1] endif A faster implementation of the same task with the Group function with the "mean" argument. This solution can also be modified to use the closest atom (instead of the center of mass) by using "min".
[ Reverse complement  Sequence array ] function.Sequence ( as_select )  returns sequence extracted from specified residues. Sequence( s [ nucleotide  protein ] )  converts a string (e.g. "ASDFTREW") into an ICM sequence object. By default the type is "protein". To reset the type use the set type seq { nucleotide  protein } command. Examples: seqA = Sequence( a_1./15:89 ) # create sequence object # with fragment 15:89 show Align(seq1, Sequence("HFGDKLS AREWDDIPYQ") # noncharacters will be squeezed out a=Sequence("ACTGGGA", nucleotide) Type(a , 2) # returns the typestring : nucleotide Sequence ( ali )  returns a parray of sequenceswhich from the alignment.
Sequence ( ali group )
 returns a chimeric sequence which represents the strongest character in every
alignment position.
Sequence ( seq_DNAsequence reverse )  returns the reverse complement DNA sequence: nucleotide complement _______________________________  A = Adenosine  T (replace by U for RNA) C = Cytidine  G G = Guanosine  C T = Thymidine  A U = Uridine  A R = puRine (G A)  Y Y = pYrimidine(T C)  R K = Keto (G T)  M M = aMino (A C)  K S = Strong (G C)  S W = Weak (A T)  W B = !A (G T C)  V D = !C (G A T)  H H = !G (A C T)  D V = !T (G C A)  B N = aNy  N
Sequnce( S_sequenceString [S_seqNames] )  converts sarray of sequence strings to proteinsequence parray Sequnce( S_namesOfLoadedSequences name )  returns a parray of protein sequences retrieved by name from the ICM shell/workspace. Example: add column T Sequence( {"MILERR", "STAGKVIKCKAAVLW"} {"aa","bb"} ) name="seq" add column T Length(T.seq) name="len" set name T.seq {"seq1", "seq2"} # reset names sq1 = T.seq[1] read alignment s_icmhome + "sh3.ali" add column t Sequence({"Spec","Fyn"} name) See also: sequence parray.
Shuffle ( I  R  S ) → shuffled_array Shuffle ( string ) → shuffled_string Shuffle ( seq ) → shuffled_sequence randomly change order of elements of an array or a sequence of characters. Example: a={1 2 3} Shuffle(a) # {2 1 3} Shuffle(a) # {3 1 2} Shuffle("this") # won't tell you..
transferofsign function. It returns the value (or values) of sign { 1.0.+1.} of its argument. Sign ( real )  returns real sign of the argument. Sign ( integer )  returns integer . Sign ( iarray )  returns iarray. Sign ( rarray )  returns rarray.
Sign ( map )
 returns map with 1., 0., 1. values.
Sign(23) 1 Sign(23.3) 1. Sign({23,13}) {1,1} Sign({23.0,13.1}) {1.,1.}
sine trigonometric function. Arguments are assumed to be in degrees. Sin ({ real  integer } )  returns the real sine of its real or integer argument. Sin ( rarray )  returns the rarray of sines of rarray elements. Examples: print Sin(90.) # equal to 1 print Sin(90) # the same print Sin({90., 0., 90.}) # returns {1., 0., 1.}
hyperbolic sine function. Sinh ( { real  integer } )  returns the real hyperbolic sine of its real or integer argument. Sinh(x)=0.5( e^{iz}  e^{iz} ) Sinh ( rarray )  returns the rarray of hyperbolic sines of rarray elements. Examples: print Sinh(1.) # equal to 1.175201 print Sinh(1) # the same print Sinh({1., 0., 1.}) # returns {1.175201, 0., 1.175201}
site selection function Site ( s_siteID [ ms ])  returns the iarray of the site numbers in the selected molecule. The default is all the molecules of the current object. Example: nice "1est" # contains some sites delete site a_1 Site("cat",a_1)
Slide( )  returns a compact binary representation of the entire graphical view (also known in ICM as a slide). Slides include the following:
The data is packed into a singleelement parray of a view type. These "slides" can be written and read as parts of the .icb project files with the read binary command. To display the view use the display parray_slide command, e.g. slide1 = slideshow.slides[1] display slide1 Slide( gui )  returns a slide containing only the current window layout information. See also: String slide gui, add slide.
convert chemical structure into a Smiles string. Smiles ( as ) Smiles ( chem [unique] [cistranscartesian] )  returns a smiles  string with the text representation of the chemical structure of a selected fragment or a chemical array. The unique option will make that string independent of the order atoms in the molecule. The cartesian option will adds 2D or 3D coordinates at the end of the result smiles string. That coordinates will be used in Chemical function Example: read object s_icmhome + "biotin.ob" s_smiles = Smiles( Chemical( a_ exact hydrogen ) cartesian ) # coordinates will be preserved read mol input=String( Chemical( s_smiles )) # Srmsd( a_1. a_2. chemical ) # # or even simpler # s_sm3d = "CCCCC3D:1.39,0.00,0.02,2.16,1.30,0.01,3.45,1.20,0.82,4.23,2.52,0.81,5.51,2.42,1.62" read mol input=String(Chemical( s_sm3d ) name="cc" See also: build smiles, String( as_ )  chemical formula.
[ Smooth  Smooth matrix  Smoothrs  Smooth alignment  Smooth map ] sliding window averaging, convolution, 2D and 3DGaussian smoothing, map smoothing and function derivatives.
Smooth ( R_source, [ i_windowSize ] )  returns the windowaveraged rarray. The array is of the same dimension as the R_source and i_windowSize is set to windowSize by default. An average value is assigned to the middle element of the window. i_windowSize must be an odd number. At the array boundaries the number of averaged elements is gradually reduced to one element, i.e. if i_windowSize=5, the 3rd element of the smoothed array will get the mean of R1,R2,R3,R4,R5, the second element will get the mean of R1,R2 and R3, and the first element will be set to R1. Smooth ( R_source, R_weightArray )  returns the rarray of the same dimension as the R_source, performs convolution of these two arrays. If R_weightArray contains equal numbers of 1./ i_windowSize, it is equivalent to the previous option. For averaging, elements of R_weightArray are automatically normalized so that the sum of all elements in the window is 1.0. Normalization is not applied if the sum of elements in the R_weightArray is zero. Convolution with such an array may help you to get the derivatives of the R_source array. Use: {1.,1.}/Xstep # for the first derivative {1.,2.,1.}/(Xstep*Xstep) # for the second derivative {1.,3.,3.,1.}/(Xstep*Xstep*Xstep) # for the third derivative # ... etc. Examples: gauss=Exp( Power(Rarray(31,1.,1.) , 2) ) # N(0.,1.) distribution on a grid x = Rarray(361,180.,180.) # xarray grows from 0. to 180. a = Sin(x) + Random(0.1,0.1,361) # noisy sine b = Smooth(a,gauss) # gauss averaging # see how noise and smooth signals look plot x//x a//b display {180.,180.,30.,10.} # take the first derivative of Sin(x) c = Smooth(Sin(x),{1., 1.}) * 180.0 / Pi # plot the derivative plot x c display {"X","d(Sin(X))/dX","Derivative"}
Smooth ( M_source, [ i_halfwindow (1)> [<r_radius (1.)>]] ) → <M The values in the source matrix get transformed according to a Gaussian 2D transformation in which the values i,j get averaged with the values in the neighboring [in:i+n] [jn:j+n] cells , (2n+1)^2 in total, according to the gaussian weights calculated as exp( r^{2} / R^{2} ), where R is the r_radius parameter, and n is the i_windowSize parameter. The default parameters are 1 for the i_halfwindow (corresponding to 9 cell averaging) and the radius of 1.. Examples: Smooth(Matrix(10),0) # keeps the matrix intact Smooth(Matrix(10),3,1.5) # weighted average with 7*7 surrounding values (7=3*2+1) for each cell.
Smooth ( rs, R_property, r_smoothRadius )  Gaussian averaging of property array R_property of residues rs_ . The averaging is performed according to the spatial distance between residue Ca atoms. The function returns the rarray of the residue property AVERAGED in 3D using spherical Gaussian with sigma of r_smoothRadius. Each residue contributes to the smoothed property with the weight of exp(Dist_i_j^{2}/ r_smoothRadius^{2}). The interresidue distances Dist_i_j are calculated between atoms carrying the residue label (normally a_//ca). These atoms can be changed with the set label command. Array R_1 is normalized so that the mean value is not changed. The distances are calculated between Examples: nice "1tet" # it is a macro displaying ribbon++ R = Bfactor(a_/A ) # an array we will be 3Daveraging color ribbon a_/A Smooth(a_/A R 1.)//5.//30. # averaging with 1A radius color ribbon a_/A Smooth(a_/A R 5.)//5.//30. # with 5A radius color ribbon a_/A Smooth(a_/A R 10.)//5.//30. # with 10A radius # 5.//30. are appended for color scaling from 5. (blue) to 30.(red) # rather than automated rescaling to the current range set field a_/A Smooth(a_/A R 5.) show Select( a_/A "u>30." ) # select residues with 1st field > 30.
Smooth ( ali, [ i_gapExpansionSize ] )  returns a transformation of the initial alignment in which every gap is widened by the i_gapExpansionSize residues. This transformation is useful in modeling by homology since the residue pairs flanking gaps usually deviate from the template positions. The default i_gapExpansionSize is 1 (the gaps are expanded by one residue)
Smooth ( map , [ "expand" ] ) weighted 3Dwindow averaging Smooth( map )  returns map with averaged map function values. By default the value in each grid node is averaged with the six immediate neighbors (analogous to onedimensional averaging by Smooth(R,{1.,2.,1.}) . By applying Smooth several times you may effectively increase the window. This operation may be applied to "ge","gb","gs" and electron density maps lowvalues propagation Smooth( map "expand" )  returns map in which the low values were propagated in three dimensions to the neighboring nodes. This trick allows one to generate more permission van der Waals maps. This operation may be applied to "gh","gc" and electron density maps. Examples: m_gc = Smooth(Smooth(m_gc "expand"), "expand" ) See also: map , GRID.gcghExteriorPenalty .
SolveQuadratic( r_a r_b r_c  R_32 [all] ) → R_roots returns an array of real roots of a quadratic equation ax^{2} + bx + c = 0 By default only real roots are found. Option all : returns two complex numbers: {r1,i1,r2,i2} Example: rts = SolveQuadratic(1. 2. 1.) # one real root show rts #>R 1. Nof(rts) # number of roots 1 SolveQuadratic(1. 2. 3. all) # two complex roots #>R 1. 1.414214 1. 1.414214 See also: SolveQubic
SolveCubic( {r_a r_b r_c r_d  R_[a]bcd} [all] ) → R_realRootsR_6re,im returns an array of real roots of a qubic equation ax^{3} + bx^{2} + cx +d = 0 By default only real roots are found. Option all : returns three complex numbers: {r1,i1,r2,i2,r3,i3} Example: SolveQubic(1.,3.,3.,1.) # identical roots of 1. SolveQubic(1.,3.,3.,1.,all) # three pairs of roots See also: SolveQuadratic
functions to connect to a Molcart server or database file and run SQL queries. This function has the following properties:
Sql ( connect s_host s_loginName s_password s_dbName )  returns the logical status of connection to the specified server. The arguments are the following:
Sql ( s_SQLquery )  returns the table of the selected records. Some SQL commands are not really queries and do not return records, but rather perform certain operations (e.g. insert or update records, shows statistics). In this case an empty table is returned. An example: if !Sql( connect "localhost","john","secret","swiss") print "Error" id=24 T =Sql( "SELECT * FROM swissprothits WHERE featureid="+id ) sort T.featureid web T # Another example tusers = Sql("select * from user where User=" + s_usrName ) Sql(off) Sql ( off )  disconnects from the database server and returns the logical status. See also: molcart, query molcart
square root function. Sqrt ( real )  returns the real square root of its real argument Sqrt ( rarray )  returns rarray of square roots of the rarray elements. Sqrt ( matrix )  returns matrix of square roots of the matrix elements. Examples: show Sqrt(4.) # 2. show Sqrt({4. 6.25}) # {2. 2.5}
sphere selection function of atom centers within a range (or the ratio of atom distance to the sum of vw radii) . It returns a selection containing atoms, residues or molecules within a certain radius around the initial selection. It returns atom selection which can be then converted into residue and molecules with the Res and Mol functions respectively. The default value is defined by the selectSphereRadius . ICMshell variable which is equal to 5.0 A by default. Sphere (as_source grobR_xyzM_xyz [as_whereToSelect] [radius(5.)] ) → selection Sphere (as_sourceM_xyz as_whereToSelect radius objectmoleculeresidue ) → osmlre this function returns a selection of atoms in a certain vicinity of the following set of points:
The atoms will be searched in the specified selection as_whereToSelect
if the second selection is explicitly specified.
If only one atom selection is specified,
the atoms will be selected from the same object.
The selection level functions ( Res , Mol , and Obj ) can also be used to convert the atom selection into residues, molecules or objects, respectively (e.g. Res(Sphere(a_/15,4.)) ), if speed is not an issue or the explicit level option is not available.
For example, selection show Sphere( a_subA/14:15/ca,c,n,o , 5.2) Res(Sphere( a_1.2 a_2.)) # residues of a_2. around ligand a_1.2 Sphere( a_1.2 a_2. 7. residue) # same but much faster Adjusting for the van der Waals radii, vdW gap. Use negative distance values to indicate a different mode of the Sphere function. Sphere can also correct for the van der Waals radii if you specify the negative radius. Values < 1. indicate vdW gap ( 1.15 means 15% larger than the sum of vdW radii). In this case it is interpreted as a ratio of the interatomic distance to the sum of van der Waals radii. For example, Sphere( a_//a1 a_//a2 , 1.2 ) specifies the van der Waals gap of 1.2 , i.e. interatomic_distance / (R(a1) + R(a2)) will be compared with 1.2 The negative sign just flags the program to use the distance to vwlimit ratio instead of the distance. The value of 1.15 roughly corresponds to 3.5 . Example: read pdb "2ins" Sphere(a_1.1 a_1.2//!h* 3.4 ) # the traditional method Sphere(a_1.1 a_1.2//!h* , 1.1) # the corrected method
Sphere (M_xyz as_whereToSelect radius ring ) → as_ring_atoms this function returns a selection of atoms in rings which centers are in a certain vicinity of the set of points in M_xyz. Example: read pdb "2l8h" display xstick a_ make grob skin a_2l8h.a2 a_2l8h.a2 name="g_skin" color g_skin white color g_skin black distance Xyz( Sphere( Xyz(g_skin) a_N,A//RA 3.5 ring ) ring ) GROB.atomSphereRadius = 2.5 display solid smooth g_skin printf " Info> %.2f%% of ligand surface is exposed to aromatic contact\n" (1Mean(Mean(Color(g_skin))))*100 See also:
function to form SOAP request or to parse a result from the server. A SOAP message is special XML text which contains :
SoapMessage( s_methodName s_methodNamespace ) returns soapMessage object with specified method name. SoapMessage( soapMessage [ s_argumentName argumentValue ] ... ) adds a number of name/values pairs to the exiting soap message and returns a new soap message as a result SoapMessage( s_xmlSource ) parses xml source and returns soapMessage object. The following example form a SOAP request to the google search service.
# create a message with soap method 'doGoogleSearch' req = SoapMessage( "doGoogleSearch","urn:GoogleSearch" ) # add method arguments req = SoapMessage( req, "key","btnHoYxQFHKZvePMa/onfB2tXKBJisej" ) # get key from google req = SoapMessage( req, "q", "molsoft" ) # search 'molsoft' # some other mandatory arguments of 'doGoogleSearch' req = SoapMessage( req, "start" 0, "maxResults" 10 ) req = SoapMessage( req, "filter", no, "restrict", "", "safeSearch", no ) req = SoapMessage( req, "lr", "", "ie" "latin1", "oe", "latin1" ) HTTP.postContentType = "text/xml" read string "http://api.google.com/search/beta2" + " " + String(req) # parse the result and check it for errors res = SoapMessage( s_out ) if Error(res) != "" print "Soap error: ", Error(res) See SOAP services for more information.
function to return the sorted version of array. Sort ( sarrayiarrayrarraychemarray [reverse] )
 returns the sorted array. Option reverse toggles the sorting order.
count_unique=Nof(Sort(Unique({1, 11, 7, 2, 2, 7, 11, 1, 7}))) # counts unique elementsSee also: Unique( ), sort.
[ Split tree  Split regexp  Split multisep  Split chemical ] function. Overview:Split( s s_sepChars ) → S_words # to split into characters * # "" to split into characters Split( s s_sep exactregexp ) → S_words Split( S s_sepCols s_sepColNameValue [exactregexp] ) → T_words # "A:1 B:2 C:3.3" into columns A,B,C, inverse to Sum(t,{"t.A","t.B"} " " ":") Split( chem_1 [chiraltautomermolgroup] )→chem_multi # see also: enumerate .. Split( table_n.cluster [r_thresholdi_nGroups] ) → I_n_groupIndices # needs: make cluster t
Multiple spaces are treated as one space, while all other multiple separators
lead to empty fields between them. If s_Separator is an empty string
(""), the line will be split into individual characters. To split a multiline
string into individual lines, use Split( s_, "\n" ).
lines=Split("a 1 \n 2","\n") # returns 2array of {"a 1" " 2 "} flds =Split("a b c") # returns 3array of {"a" "b" "c"} flds =Split("a b:::c",":") # returns 4array of {"a b","","","c"} resi =Split("ACDFTYRWAS","") # splits into individual characters # {"A","C","D","F",...}See also: Field( ). Split ( s_multiFieldString s_separator exact )  returns sarray of fields separated exactly by s_separator
Split( table.cluster, [r_threshold][i_numberOfClusters] ) Returns iarray of cluster numbers for each row. Example: make tree t matrix "upgma" cl = Split( t.cluster, Max( t.cluster )/2 )
Split ( s_source, s_separator, regexp )  returns an sarray with the source string separated by regular expression Useful separators:
Examples: Split("a b \t\tc", "\s+", regexp) # returns 3array of {"a" "b" "c"} Split("a_asd_b_awe_c","_a.._", regexp) # returns { "a","b","c" }
Split ( S_source, s_separator1, s_separator2 [regexpexact] ) → T_table  takes a sarray as an input. Each entry of sarray has the following syntax: namesep2valuesep1namesep2value ... where name and value can be any text which does not contain sep1 or sep2 returns a table with columns name1, name2, etc. filled with corresponding values. Example: Split( { "a=1;b=2", "a=3;c=5" "d=1;b=1;e=7" } ";" "=" ) See also: Summultisep
Split ( X_1_with_n_molecules ) → X_n
add column t Split( Chemical( "O=O.NN" ) ) See also: Sum chemical other chemical functions
"static" rootmeansquare deviation function. Calculates deviation (or deviations with the matrix option) without superposition. Summary:
Srmsd(as) → r_tzRmsd Srmsd(as,as2,[alignautoexactpharmacophoretypevirtual]) → r Srmsd(as_Nmol,as_Kmol,[chemical] matrix) → M_NxK_srmsds Srmsd(as_Nmol,as_Kmol,[weight] matrix) → M_NxK_superposition_errors (uses gaussian weights with TOOLS.superimposeMaxDeviation) Srmsd(as,as2,ali) → r Srmsd(ms,ms2,as_subset,chemical [,output]) → r # R_2out deviations with option Srmsd(as,as2,r_scale) → r_RelativeDisplacementErrorPerc Srmsd(X_3D as) → R Srmsd(X_3D X_3D) → M_m_n Srmsd(X_3D ) → M_n_n Srmsd(X_3D as [pharmacophore]) → R
Chemical match Srmsd ( ms_select1 ms_select2 chemical [output] ) Srmsd ( ms_select1 ms_select2 as_subselect1 chemical )  returns the real rootmeansquare distance between two selected chemical (hetero) molecules according to the optimal chemical match but without 3D superposition. With the third selection argument, the deviation will be calculated only for the as_subselect1 atoms while the equivalence pairs are established using the first two selections. Option output will produce R_2out array with individual deviations for the matched pairs.
See also: Rmsd( ms1 ms2 chemical ) and superimpose command.
Different kinds of atom equivalences Srmsd ( as_select1 as_select2 [{ align  ali }  autoexactpharmacophoretypevirtual] )
 returns real value of rootmeansquare deviation (returns a matrix with the matrix option ).
Similar to function Rmsd, but works without optimal superposition,
i.e. atomic coordinates are compared as they are without modification.
Number of equivalent atom pairs is saved in i_out
(see alignment options).
Two version of the matrix option exist: Srmsd( as1 as2 matrix ) → M_dist aligns amino chains by residue number and returns a [ nofMol1:nofMol2 ] matrix.
Srmsd( as1 as2 chemical matrix ) or Srmsd( as1 as2 matrix chemical ) → M_dist
performs a chemical superposition
superimpose a_1.1 a_2.1 # two similar objects, each # containing two molecules print Srmsd(a_1.2//ca a_2.2//ca) # compare how second molecule # deviates if first superimposed Srmsd ( as_select [selftether] )  returns real rootmeansquare length of absolute distance restraints ( so called, tethers ) for the tethered atoms in ICMobject. With the selftether keyword the internal positions are used (they are set by the convert command or can be set manually). The "tether" version is equivalent to Sqrt(Energy("tz")/Nof(tether)) after show energy "tz" . Similarly, the "ts" terms can be used for the selftethers. Optimal path SRMSD and a full distance matrix for all pairs of molecules. This function returns the number of atom pairs (or selftethers) used in the calculation in i_out and the maximal deviation in r_2out . Matrix of static RMSDs Srmsd ( as1 as2 matrix [chemical] ) → M_nMol1_nMol2 returns the "optimal path" matrix of srmsd values where for each two molecules the smallest srmsd is accumulated. The dimensions of the matrix are Nof(Mol( as1 )) x Nof(Mol( as2 )) . This function will consider two residues equivalent if they have the same residue numbers and two atoms equivalent if they have the same names. If no equivalences are found the srmsd value of 999. is returned. Matrix of superposition errors Srmsd ( as1 as2 matrix ) → M_nMol1_nMol2_srmsds Srmsd ( as1 as2 matrix weight ) → M_nMol1_nMol2_percent_deviated_pairs In this case the selections are split into molecules (just as in the Srmsd ( as1 as2 matrix chemical ) and for each pair of molecules. The equivalence is found based on residue numbers and atom names and the returned values are rootmeansquaredistances per pairs of molecules. If option weight is specified, for each pairs of molecules the percent of pairs of equivalent atoms deviating beyond TOOLS.superimposeMaxDeviation is returned. Then a difference measure with weight option is calculated as n_matching = sum of exp (  distance^{2} / threshold^{2} ) is calculated for each pair of atoms. This sum is then subtracted from the total number of pairs and the measure is then divided by the number of atom pairs and multiplied by 100. ( n_different = n_pairs  n_matching ; perc_diff = 100.* n_different / n_pairs ) The threshold is defined in TOOLS.superimposeMaxDeviation (this parameter is also used in superimpose minimize command ). Pharmacophore distance Srmsd ( as_pharmTemplate as_chem [pharmacophore] )  returns real value of rootmeansquare deviation of pharmacophore points between as_pharmTemplate and as_chem. Example: read binary s_icmhome + "example_ph4.icb" parrayToMol t_3D.mol[4949] superimpose a_pharma. a_2. pharmacophore display a_2. Srmsd( a_pharma. a_2. pharmacophore ) See also: Rmsd superimpose create a pharmacophore object Srmsd ( X_chemarray as_pharmTemplate pharmacophore )  returns rarray value of rootmeansquare deviation of pharmacophore points between as_pharmTemplate and 3D chemicals from X_chemarray.
[ String substring  String date  String mol  Alignment_as_text  Ali_seq_project  Seq_ali_project  String alternative  String selection  String slide gui  Chem formula ] function. Summary:String() → s String() → s_empty String( as [namenumber]  [simple [atomresiduemoleculeobject]] ) → s_selection # see also: Name(<> full), l_showResCodeInSelection String( as alldotslnsmiles ) → s `Stringdate{String} ( date s_spec ) → s # see `Date String( ilr [n_decimals] pref ) → s_ String( blob_ [ 'base64''hex' ] ) # blob to string. see `Blob `readblob String( l_condition s_yes s_no ) # like this C expression l ? s1 : s2 String( alignmentmacromodelsequence ) → s String( s i_from i_len )  (fr to s) → s_substr String( s key hash ) (or 32 hash) → s_CRC32s_MD5(see md5sum unix tool) String( s n_repeats ) → s_repeated String( slide gui ) → s_layoutString String( table "tex""html" [header] ) → s_printTable String( icm_word  unknown ) → s_ String( X_chemarray  table mol ) → s_sdfFileText String( array  format ) → s_columnFormat
Detailed descriptions:
String ( string, html )  return URLencoded version of the input string argument. See also Tableurland Collection to parse URL encoded strings.
String ( collection, html )
 return URLencoded query string from the input collection argument. See also Tableurland Collection to parse URL encoded strings.
String ( w_img, html )  return inline html image representation.
String ( s_input, s_default )
 if the input s_input string is empty returns the s_default, otherwise returns the s_input string
file=s_tempDir//String(Energy("ener")) # tricky file name show Index(String(seq),"AGST") # use Index to find seq. pattern tenX = String("X",10) # generate "XXXXXXXXXX" show String(Random(1.,10.,30), plot ) read matrix show String(def," ..:*#") # redefine the projection symbolsSee also: Tostring , show map.
String ( i_from, i_to, string )
 returns substring starting from i_from and ending at i_to.
If i_from is less than i_to the string is inverted.
Zero value is automatically replaced by the string length, 1 is the last but one element etc.
String(1,3,"12345") # returns substring "123" String(4,2,"12345") # returns substring "432" String(1,0,"12345") # returns "12345" String(0,1,"12345") # returns INVERTED string "54321" String(1,1,"12345") # returns "4321"
String( date s_format ) the format specifications are described in the Date function. Examples: String( Date() "%A" ) # day of the week String( Date() "%B" ) # month
See also : Date
String( X ) → s_sdfFile generates a string buffer in mol/sdf file format. This can be used to read one or multiple chemicals from a table into 3D objects in ICM shell. Example: group table t Chemical("CC=O") read mol input=String(t.mol[1]) # creates 3D objects # to write as a file use write table mol t String( T mol ) → s_sdfFile generates string buffer in mol/sdf format for the table or table selection. All table fields are included into the result Example: add column t Chemical({"Cc1ccc(C)c(c1)c1c(C=C2C(N(CC(O)=O)C(=S)S2)=O)cn(c2ccccc2)n1", "COc1cccc(C=C2C(N(CCC(O)=O)C(=S)S2)=O)c1OCC=C"}) add column t Predict(t.mol,"MolLogP") name="MolLogP" String( t[1] mol )
String ( ali )  converts the alignment into a multiline string . You can further split it into individual lines like "NSGDG" with the Split(String(ali_)) command. The offset in a specific sequence and its number can be found as follows. Examples: read alignment s_icmhome+"sh3" offs=Mod(Indexx(String(sh3),"NSGDG"),Length(sh3)+1) # extract alignment into a string, (+1 to account for '\n') iSeq = 1 + Indexx(String(sh3),"NSGDG")/(Length(sh3)+1) # identify which sequence contains the pattern String ( ali tree )  returns a Newick tree string describing the topology of the evolutionary tree. The format is described at http://evolution.genetics.washington.edu/phylip/newicktree.html . Example: read alignment s_icmhome+"sh3" show String(sh3 tree)
String ( s_ali ali_from { seq  i_seqNumber } )  returns a projected string . The s_ali string contains characters defined for each position of alignment ali_from. The function squeezes out the characters which correspond to insertions into sequence seq_ . This operation, in effect, projects the alignment string s_ali onto sequence seq_. See also the Rarray(R_,ali_,seq_) function to project rarrays. Example (projection of the consensus string onto a sequence): read alignment s_icmhome+"sh3" # 3 seq. cc = Consensus(sh3) show String(Spec)//String(cc,sh3,Spec)
String ( s_seq { seq  i_seqNumber } ali_to s_gapDefChar )  projects the input string from seq_ to ali_to (the previous function does it in the opposite direction). The R_seq string contains characters defined for each position of the sequence seq_. The function fills the gap positions in the output with the r_gapDefChar character. Combination of this and the previous functions allow you to project any string s1 from one sequence to another by projecting the s1 of seq1 first to the alignment and than back to seq2 (e.g. String( String(s1,seq1,a,"X") , a, seq2) ). See also the Rarray( R_,seq_,ali_,r_gapDefault ) function to project real arrays. Example (transfer of the secondary structure from one sequence to another): read alignment s_icmhome+"sh3" # 3 seq. ssFyn = Sstructure(Fyn) set sstructure Spec String(String(ssFyn,Fyn,sh3,"_"),sh3,Spec) show Spec
String( l_condition s_choice1 s_choice2 ) This function is equivalent to the question mark operator in C, e.g. condition?choice1:choice2 Example: a=3 String( a>1 , "big a", "small a" )
String( { os  ms  rs  as } [ name  number ] [ i_number ] ) String( { os_1  ms_onOneObj } simple )
converts a selection into a compact string form.
Continuous blocks of selected elements in different molecules or objects are separated
by vertical bar (  ) which means logical or ( e.g. a_a.1:4a_b.2,14 )
You can also divide this selection info a string array with the Split function.
With option name , the oneletter residue code will be shown in addition to the number, regardless of the l_showResCodeInSelection system logical ( e.g. a_/^F23 instead of a_/23 ). Conversely option number shows only the number. By default (without the name option) the code is shown depending on the l_showResCodeInSelection flag. Options:
An example in which we generate text selection of the Crn leucine neighbors : nice "1crn" l_showResCodeInSelection = no nei = String( Res(Sphere( a_/leu a_/!leu , 4.)) ) show nei a_1crn.a/14:17,19:20 display xstick $neiAnother example with a loop over atom selection of carbon atoms: read pdb "2ins" for i=1, Nof( a_//c* ) print String( a_//c* i ) endfor See also: l_showResCodeInSelection
String( slide gui ) → s_layoutString retrieves the string with the window layout information which is stored in the slide. Example: sl = Slide(gui) undisplay window="all" # take a look display window=String( sl gui ) See also: Slide, display window.
String ( as { dot  all  smiles  sln } )  returns string with the following chemical information:
Molecules with a certain chemical formula (calculated without hydrogens) can be selected by the a_formula1,formula2.. selection . See also: Smiles , smiles , selection by molecule. Example: build string "se ala" # alanine show String(a_//!h* all ) # returns no hydrogen chemical formula: C3NO show String(a_//* all ) # returns chemical formula: C3H5NO show String(a_//* sln ) # returns SLN notation: NHCH(CH3)C=O show String(a_//* smiles) # returns SMILES string: [NH][CH]([CH3])C=O
secondary structure function. Sstructure ( rs )  returns string of secondary structure characters ("H","E","_", etc.) extracted from specified residues `rs_ . Sstructure ( { rs  s_seqStructure } compress )  returns the compressed string of secondary structure characters, one character per secondary structure segment, e.g. HHE means helix, helix, strand. Use the Replace function to change B to '_' and G helices to H helices, or simply all non H,S residues to coil (e.g. Sstructure(Replace(ss,"[!EH]","_"),compress) ) Example: show Sstructure("HHHHHHH_____EEEEE",compress) # returns string "HE" # read object "crn" show Sstructure( a_/A , compress) # returns string "EHHEB" Sstructure ( { seq  s_sequenceString } )  returns string of secondary structure characters ("H","E","_"). If this string has already been assigned to the sequence seq_ with the set sstructure command or the make sequence ms_ command, the function will return the existing secondary structure string. To get rid of it, use the delete sstructure command. Alternatively, if the secondary structure is not already defined, the Sstructure function will predict the secondary structure of the seq_ sequence with the Frishman and Argos method. If the specified sequence is not a part of any alignment of sequence group only a single sequence prediction will be effected (vide infra). Otherwise, a group or an alignment will be identified and a true multiple sequence prediction algorithm is applied. The multiple sequence prediction by this method reaches the record of 75% prediction accuracy on average for a standard selection of 560 protein chains under rigorous jackknife conditions. The larger the sequence set the better the prediction. Prediction accuracy for a single sequence is about 68%. To collect a set perform the fasta search ( Pearson and Lipman, 1988 ) with ktup=1 and generate a file with all the sequences in a fasta format. Method used for derivation of single sequence propensities. Seven secondarystructure related propensities are combined to produce the final prediction string. Three are based on longrange interactions involving potential hydrogen bonded residues in antiparallel and parallel beta sheet and alphahelices. Other three propensities for helix, strand and coil, respectively, are predicted by the "nearest neighbor" approach ( Zhang et al., 1992 ), in which short fragments with known secondary structure stored in the database (icmdssp.dat) and sufficient similarity to the target sequence contribute to the prediction. Finally, a statistically based turn propensity (also available separately via the Turn( sequence) function), is employed over the 4residue window as described by Hutchinson and Thornton (1994). The function also returns four real arrays in the M_out matrix [4, seqLength]. There arrays are:
Sstructure ( seqarray )  returns sarray of secondary structure strings stored in a sequence parray Examples: show Index(Sstructure(a_1crn.,"HHHHHH")) # first occurrence of # helix in crambin read sequence "sh3" # load 3 sequences (the full name is s_icmhome+"sh3") show Sstructure(Spec) # secondary structure prediction for one of them show Sstructure("AAAAAAAAAAAAA") # sec. structure prediction for polyAla read sequence "fasta_results.seq" group sequences a unique 0.05 # remove redundant sequences show Sstructure(my_seq_name) # the actual prediction, be patient plot number M_out display # plot 3 propensities and reliability
[ Sum chemical  Sum image ] function.Sum ( iarray )  returns the integer sum of iarray elements. Sum( { rarray  map })  returns the real sum of elements. Sum ( matrix )  returns the rarray of sums in all the columns. Sum ( sarray [ s_separator ] )  returns string of concatenated components of a sarray separated by the specified s_separator or blank spaces by default. See also the opposite function: Split . Examples: show Sum({4 1 3}) # 8 show Sum(Mass(a_1//*)) # mass of the first molecule show Sum({"bla" "blu" "bli"}) # "bla blu bli" string show Sum({"bla" "blu" "bli"},"\t") # separate words by TAB show Sum({"bla" "blu" "bli"},"\n") # create a multiple line string >>Summultisep h4 Concatenate multiple columns Sum( T_table { S_cols } s_sep1 s_sep2 ) → S_result  returns sarray where each element formed as follows: colname1sep2value1sep1colname2sep2value2 ... Empty values are skipped. This function can be used to 'shrink' sparse tables Example: add column t {"" "a" "" "" "b"} {"c" "" "j" "r" ""} {"a" "u" "" "" "b"} Sum( t ":", "=" ) See also: Split multisep
Sum ( chemarray [r_spacing=0.] )
Merges elements of This function can be used to merge several PDB ligands into one molecule Example: read pdb "1zkn" read mol input=String(Sum( Chemical( a_ibm,ibm2 exact )) ) split name="twoMolsInOne" See also: Split chemical other chemical functions
Sum ( imageArray_a imageArray_b [r_bweight(0.5)] ) creates an image array consisting of blended images from arrays imageArray_a and imageArray_b.Arrays should have the same size and each image pair in the arrays should have matching sizes as well. The r_bweight parameter specifies how much of the color in resulting image should be taken from the second array images. r_bweight should be a value between 0 and 1. See also: Image
function. Symgroup ( { s_groupName  os_object  i_groupNumber  m_map } number )  returns the integer number of one of 230 named space groups defined in ICM. Symgroup ( { i_groupNumber  os_object  m_map } )  returns the string name of one of 230 space groups defined in ICM. The number of transformations for all two versions is returned in i_out .
See also, Transform :
Transform ( i_groupNumber )
 returns the rarray of transformation matrices (12 numbers each) describing symmetry operations
of a given space group.
iGroup = Symgroup("P212121" number ) # find the group number=19 print "N_assymetric_units in the cell =", i_out show Transform(iGroup)) # shows 4 12membered transformations.
[ Table url_decoder  Alignment as table  Residue correspondences  Table matrix  Table pairs  Table stack  Table plot  Table model  Table model chem  Table distance  Protonation states table ] generic function return a table.Table(ali I_aliPos residuelabel) → T_posNumbers `alignmentastable{Table} (ali [number]) → T_seqColumns Table( map ["min""max"] ) → T_x_y_z_value `Tablematrix{Table} (matrix_nxm [S_colnames_m]) → T_with_m_columns `Tablepairs{Table} ( matrix_nxm [ S_rowtags_n S_coltags_m ] index ) → T_nm_ij_pairs Table( model termmerit) → T_statReport Table( T S_Tcolnames) → T_columnSubseletion Table( pairdist distance ) → T_atomsPairs Table( parray [s_colName]) → T_with_parray_column Table( collection ) → T_converted_from_the_collection Table( residue ) → T_icm_res_names_codes Table(seq) → T_resContent (name,n,freq) Table(seq site) → T_siteInfo (key,fr,to,list,desc) Table( stack [vs] ) → T_confTerms Table( s_svgTextNodesEdges plot ) → T_nodes_edges `Tableurl{Table} (URL_encoded_string_a=b&c=d&e=ff [crypt] ) → T_name_value
 returns a table of icm residues from the icm.res file loaded by the read library command with the following columns: .char .name .type .descExample: t = Table(residue) tt = t.type=="Amino" show tt # currently loaded amino acids if Index(tt.name,"tyr") != 0 print "legal residue name"
Table ( s_URL_encoded_String [ crypt ] )
read string # read from stdin in to the ICM s_out string a=Table(s_out) # create table a with arrays a.name and a.value show a # show the table for i=1,Nof(a) # just a loop accessing the array elements print a.name[i] a.value[i] endforSee also: Getenv( ).
Table ( alignment [ number ] )  returns the table of relative amino acid positions for each of the sequence in the alignment. Gaps are marked by zero. Note that here columns correspond to different sequences while rows correspond to alignment positions. In the next function this order is reversed. The first column of the table, .cons , contains sarray of consensus characters. All the other arrays are named according to the sequence names by default, or by the sequential number of a sequence in the alignment, if option number is specified. The table may be used to project numbers from one sequence to another. See also the Rarray( R_, ali_, seq_ ) function. This table may look like this: #>T pos #>consseq1seq2 " " 0 1 " " 0 2 C 1 3 " " 2 0 ~ 3 4 C 4 5 " " 0 6 # for the following alignment: # Consensus C ~C seq1 CYQC seq2 LQCNCP To calculate an array of mean scores for each column of a multiple sequence alignments use the Rarray( ali [ exact ] ) function. This array can be appended to the table. Example: read alignment "sh3" t = Table(sh3 number) # arrays t.1 t.2 t.3 t = Table(sh3) # arrays t.cons t.Fyn t.Spec t.Eps8 # cc = t.cons ~ "[AZ]" # all the conserved positions show cc # show aa numbers at all conserved positions show t.Fyn>=10 & t.Fyn<=20 # numbers of other sequences in this rangeSee also, the next function
Table( alignment, I_alignmentPositions , residue  label ) returns a table of corresponding residue numbers for the selected positions I_alignmentPositions . With option residue only the numbers are returned, while under the label option, the residue labels (e.g. Y25 ) are returned. If an alignment is linked to a 3D molecule, all cell of this row will show both sequence numbers, as well as residue numbers of the linked 3D molecule, see example below. The columns names are composed of letter 'p' for position and alignment position (eg p11, p12 .. ) Note that in contrast to the previous function, this function looks like an alignment and has the same orientation. Each row corresponds to a different sequence, the sequence name is stored in the first column, while other columns contain residue numbers in the selected alignment positions. Example: Table( aaa {1 11 13 16} label ) # aaa contains three sequences
Table ( matrix [ S_colnames ] ) → T  returns table with matrix columns named 'A', 'B', .. or according to the second argument. Example: t= Table(Matrix(3),Sarray(3,"A")+Count(3)) show t >T t #>A1A2A3 1. 0. 0. 0. 1. 0. 0. 0. 1. The inverse operation can be done with Matrix ( table , S_colNames ) function.
Table(matrix_nxm [S_rowtags_n S_coltags_m] index ) → T_nm_ij_pairs This function will return a table with three or five columns, named I,J,C or A,B,I,J,C containing a two indexes and (if provided) two names of elements and their Mij value. It will return all values. It the Example:
Table( stack [ vs ] )  return table of parameters for each conformation in a stack . If a variable selection argument is provided, the values of the specified variables are returned as well. % icm build string "ala his trp" montecarlo show stack iconf> 1 2 3 4 5 6 7 ener> 15.1 14.6 14.6 14.2 13.9 11.4 1.7 rmsd> 0.3 39.2 48.0 44.1 27.4 56.6 39.3 naft> 1 0 0 1 1 1 0 nvis> 4 1 1 4 4 4 1 t= Table(stack) show t #>T t #>ienerrmsdnaftnvis 1 15.126552 0.295555 1 4 2 14.639667 39.197378 0 1 3 14.572973 47.996203 0 1 4 14.220515 44.058755 1 4 5 13.879041 27.435388 1 4 6 11.438268 56.636246 1 4 7 1.654792 39.265912 0 1 t1= Table(stack v_//phi,psi) # show also five phipsi angles #>T #>enerrmsdnaftnvisv1v2v3v4v5 1 15.12 0.29 1 4 79.10 155.59 75.30 146.99 141.13 2 14.63 39.19 0 1 157.22 163.56 78.25 139.51 137.30 3 14.57 47.99 0 1 157.26 166.87 85.08 92.55 84.74 4 14.22 44.05 1 4 67.65 80.43 76.67 103.05 81.85 5 13.87 27.43 1 4 82.72 155.86 85.02 93.11 81.46 6 11.43 56.63 1 4 78.28 152.80 154.79 66.26 77.61 7 1.65 39.26 0 1 78.17 169.41 133.89 96.39 96.03 See also: Iarray stack function
Table ( s_graphviz_svg plot ) → T_nodes_edges_for_resorting takes the svg output of the neato tool from the graphviz dot package and parses it into rows for resorting to solve the problem of lines overlapping the nodes. The table contains the following columns:
Example: read string "/tmp/sgraph.svg" name="svg" # original svg with overlaping edges. tsvg = Table(svg, plot) sort tsvg.width write Sum(tsvg.tx) "/tmp/sgraph_sorted.svg"
Table( plsModelName [ term  merit ] ) returns a table with three columns: name mean rmsd, w (weight) and wRel columns. The header of the table contains the free term ( constant b ). The linear model can be represented as Ypred = b + w_{1*X1+w2*X2+...The} wRel column returns the following value:( Abs(w_{k)} * Rmsd(X_{k)} ) / Sum_k( Abs(w_{k)} * Rmsd(X_{k)} ) Example: A = Random(1. 10. 20) group table T A A*2. "B" Random(1. 10. 20) "C" Random(1. 10. 20) "D" write binary Apred delete Apred # read binary "Apred" Table( Apred term ) #>r .b 0.012402 #>r .self_R2 0.999998 #>r .test_R2 0.999885 #>r .self_rmse 0.002908 #>r .test_rmse 0.030066 #>T #>namemeanrmsdwwRel B 11.04767 4.620291 0.499992 99.726648 C 5.749607 2.681675 0.001182 0.13679 D 4.686537 2.686346 0.001178 0.136562
Table( s_buildInModelF_model X_chemarray [inverse] ) Returns table with the following columns
inverse option returns fragments which are not present in the model. ~w and ~wRel columns are omitted in this case. Example: tt = Table( "MolLogP", Chemical( "CCO" ) ) tt.ch_1 != 0 Table( "MolLogP", Chemical( "OOO" ) inverse ) tt_stat = Table( myModel, tt.mol inverse )
Table( hbondpairsatompair_distancesanglestorsions distance ) → T_atomsPairs  takes a distance object and returns a table with the following columns atom1 # selection , e.g. a_a.b/^T3/cn atom2 # second atom dist # distance in Angstroms color # color if present label # label of this distanceAngles and torsions will also have atom3 and atom4 columns. Example in which we find the shortest hydrogen bond in crambin: read pdb "1crn" convertObject a_ yes yes no no make hbond name="hbonds_crn" show Nof( hbonds_crn ) # counts distances t = Table( hbonds_crn distance ) sort t.dist show t[1] See also: make distance , make hbond , Nofdistance{Nof(d,distance)}
Table ( chemical charge )  returns the table with concentrations of various prononation state vs pH Table( chemical r_pH r_concCutoff charge )  returns the table with protonation states at given ph4 and percentage cutoff
tangent trigonometric function. Arguments are assumed to be in degrees. Tan ( { r_Angle  i_Angle } )  returns the real value of the tangent of its real or integer argument. Tan ( rarray )  returns rarray of the tangents of each component of the array. Examples: show Tan(45.) # 1. show Tan(45) # the same show Tan({30., 0. 60.}) # returns {0.57735, 0., 1.732051}
hyperbolic tangent function. Tanh ({ r_Angle  i_Angle } )  returns the real value of the hyperbolic tangent of its real or integer argument. Tanh ( rarray )  returns rarray of the hyperbolic tangents of each component of the array. Examples: show Tanh(1) # returns 0.761594 show Tanh({2., 0., 2.}) # returns 0.964028, 0., 0.964028
function the second moments for a multidimensional distribution. Tensor ( M)  returns the square matrix of second moments of K points in N dimensional space, M_{ki} (k=1,K,i=1,N) . The matrix NxN is calculated as < X_{i} >< X_{j} >  < X_{i} X_{j} > , where < .. > is averaging over a column k=1,K, and i,j=1,N. If xyz is a coordinate matrix Nx3, the Tensor function is identical to Transpose( xyz ) * xyz / Nof(xyz)
Example: build string "AAA" # a long molecules xyz = Xyz( a_//c* ) # a coordinate matrix of carbons # you can also do it with grobs: xyz = Xyz( g_myGrob ) a=Tensor(xyz) # compute 3 by 3 matrix of the second moments b=Eigen(a) # returns 3 axis vectors ax1= b[?,1] # this is the longest half axis ax2= b[?,2] # this is the second half axis ax3= b[?,3] # this is the shortest half axis len1 = Length(ax1) # long axis length len2 = Length(ax2) # mid axis length len3 = Length(ax3) # short axis length r = Matrix(3,3) # to make the rotation matrix from b normalize the axes r[?,1] = ax1 / Length( ax1 ) r[?,2] = ax2 / Length( ax2 ) r[?,3] = Vector( r[?,1], r[?,2] ) rotate a_ Transpose(r) # rotates the principal axes to x,y,z # x the longestThis commands are assembled in the calcEllipsoid M_xyz macro which returns ellipseRotMatrix , and three vectors: ellipseAxis1 , ellipseAxis2 and ellipseAxis3 See also: Rot, rotate, transform <> Example to orient the principal axes of the molecule along X,Y and Z (the longest axis along X, etc.). build string "se ala ala ala ala" # let is define the ellipsoid display virtual a = Tensor(Xyz(a_//!h*)) # Xyz returns matrix K by 3 b=Eigen(a) # 3x3 matrix of 3 eigenvectors b[?,1] = b[?,1] / Length( b[?,1] ) # normalize V1 in place b[?,2] = b[?,2] / Length( b[?,2] ) # normalize V2 b[?,3] = Vector( b[?,1], b[?,2] ) # V3 is a vector product V1 x V2 rotate a_ Transpose( b ) # b is the rotation matrix now # Transpose(b) is the inverse rotation set view # set default X Y Z view
function returning the oligonucleotide duplex melting temperature. Temperature ( { s_DNA_sequence  seq_DNA_sequence } [ r_DNA_concentration_nM [ r_Salt concentration_mM ] ] )  returns the real melting temperature of a DNA duplex at given concentration of oligonucleotides and salt. The temperature is calculated with the Rychlik, Spencer and Roads formula (Nucleic Acids Research, v. 18, pp. 64096412) based upon the dunucleotide parameters provided in Breslauer, Frank, Bloecker, and Markey, Proc. Natl. Acad. Sci. USA, v. 83, pp. 37463750. The following formula is used: Tm=DH/(DS + R ln(C/4)) 273.15 + 16.6 log[K+] where DH and DS are the enthalpy and entropy for helix formation, respectively, R is the molar gas constant and C is the total molar concentration of the annealing oligonucleotides when oligonucleotides are not selfcomplementary. The default concentrations are C=0.25 nM and [K+]= 50 mM. This formula can be used to select PCR primers and to select probes for chip design. Usually in primer design the temperatures do not differ from 60. by more than several degrees.
function returning time spent in ICM. Time ( string )  returns the string of time (e.g. 00:12:45 ) spent in ICM. Time ( )  returns the real time in seconds spent in ICM. Examples: if (Time( ) > 3660.) print "Tired after " Time(string) " of work?"
convert to integer values or arrays. Tointeger ( stringrealintegerlogical )  converts to integer Tointeger ( sarrayrarrayiarrayarray )  converts each element to integer, returns iarray. Tointeger ( R_source R_splitPoints I_values )  maps real numbers from the R_source to integers. The R_splitPoints array of a size n should contain numbers in increasing order. Those n points will be used as split points for n+1 intervals. I_values of size n+1 specifies numbers to be assigned to values in each of those intervals. Example in which we form two classes for positive and negative values. Useful, e. g. in classification problems . Tointeger( {1., 2., 3. 4. 5. 6.},{0.},{1,1} ) {1, 1, 1, 1, 1, 1} A more general splitter: Tointeger({1. 2. 3. 4. 5. 6.},{2.5,4.5},{2,4,6}) Tointeger ( S_source S_labels I_values ) Tointeger ( I_source I_labels I_values )  these functions recode source, replacing each value found in labels array by the respective value from the values array. Thus, values array should have the same number of elements as the labels array. Alternatively, it may contain an extra element, and that last element will be interpreted as the default value for everything from the source not listed in labels. Example: Tointeger( {"dit" "dah" "dah" "dah" "dit" "dah"} {"dit" "dah"} {0 1} ) 0 1 1 1 0 1 Tointeger( {"dit" "dah" "dah" "XXX" "dit" "dah" "YYY" "dah"} {"dit" "dah"} {0 1 100} ) 0 1 1 100 0 1 100 1 Tointeger( {1 5 1 5 6 7 6 1} {1 5} {2 3 0} ) 2 3 2 3 0 0 0 2 See also: Toreal( ), Tostring( )
convert to the lowercase. Tolower ( string )  returns the string converted to the lowercase. The original string is not changed Tolower ( sarray )  returns the sarray converted to the lowercase. The original sarray is not changed. Examples: show Tolower("HUMILIATION") read sarray "text.tx" #create sarray 'text' (file extension is ignored) text1 = Tolower(text)See also: Toupper( ).
convert to real values or arrays.
Toreal ( stringrealinteger )
 converts to real
Toreal ( S S_n_keys R_n1_values ) # R_values has n or n+1 elements  converts each key to a respective real value. If values contains n+1 elements, the last value is the deault value (used to convert all keys not in keys). Example: Toreal({"c","a","c","c"},{"c","a"},{1,2}) # two classes {1, 2, 1, 1} Toreal({"c","a","q","c","k"},{"c","a"},{1.8,2.3,0.5}) #with default value 0.5 {1.8, 2.3, 0.5, 1.8, 0.5} Support for special values in real arrays.Section rarray constant describes special values in real arrays that may appear in real columns of tables upon reading the Excel/csv files or property fields of the mol (or sdf) . Example: Create file 't.csv' that looks like this: 1.1 ND 3.3 INF >3. <2.To compare an array with special values with a specific special value use this: read csv "t.csv" t.A == Toreal({"ND"}) t.A != Toreal({"ND","INF"}) t.A == Toreal({">3."}) See also: Tointeger( ), Tostring( )
angle function. Torsion ( as )  returns the real torsion angle defined by the specified atom as_ and the three previous atoms in the ICMtree. For example, Torsion(a_/5/c) is defined by { a_/5/c , a_/5/ca , a_/5/n , a_/4/c } atoms. You may type: print Torsion( and then click the atom of interest, or use GUI to calculate the angle. Torsion ( as_atom1, as_atom2, as_atom3, as_atom4 )  returns the real torsion angle defined by four specified atoms. Examples: d=Torsion( a_/4/c ) # d equals CCaNC angle print Torsion(a_/4/ca a_/5/ca a_/6/ca a_/7/ca) # virtual CaCaCaCa # torsion angle
convert to integer values or arrays. Tostring ( stringrealinteger )  converts to string Tostring ( sarrayrarrayiarray )  converts each element to a string, returns sarray. Tostring ( seqarray )  returns sarray with sequences extracted from sequence parray elements. See also: Toreal , Tointeger , Sequence
convert to the uppercase. Toupper ( string )  returns the string converted to the uppercase. The original string is not changed Toupper ( sarray )  returns the sarray converted to the uppercase. The original sarray is not changed.
Toupper ( stringsarray 1 )
show Toupper("promotion") show Toupper("joseph louis gay lussac",1) Joseph Louis GayLussac read sarray "text.tx" text1 = Toupper(text)See also: Tolower( ).
translate onecharacter sequence to threecharacter notation. Tr123 ( sequence )  returns string like "ala glu pro". Examples: show Tr123(seq1)See also: Tr321( ). IcmSequence( ).
translate threecharacter sequence to onecharacter notation. Tr321 ( s )  returns sequence from a string like this: "ala glu pro". This function is complementary to function Tr123( ). Unrecognized triplets will be translated into 'X'. Examples: show Tr123("ala his hyp trp") # returns AHXT
matrix function. Trace ( matrix )  returns the real trace (sum of diagonal elements) of a square matrix. Examples: show Trace(Matrix(3)) # Trace of the unity matrix [3,3] is 3.
[ Dna translate ] translation function. 3D translation vector or DNA sequence translation.Trans ( R_12transformationVector )  extracts the R_3 vector of translation from the transformation vector.
Trans ( seq_DnaOrRnaSequence )  returns the translated DNA or RNA sequence ('' for a Stop codon, 'X' for an ambiguous codon) using the standard genetic code. See also: Sequence( seq_ reverse ) for the reverse complement DNA/RNA sequence. Example (6 reading frames): w=Sequence("CGGATGCGGTGTAAATGATGCTGTGGCTCTTAAAAAAGCAGATATTGGAG") show Trans(w), Trans(w[2:999]),Trans(w[3:999]) c=Sequence(w,reverse) show Trans(c), Trans(c[2:999]),Trans(c[3:999]) Trans ( seq_DnaOrRnaSequence { all  frame } [ i_minLen] [ s_startCodons] ) return a table of identified open reading frames in DNA sequence not shorter than i_minLen . The function was designed for very large finished sequences from the genome projects. Currently the Standard Genetic code is used. Option s_startCodons allows one to provide a commaseparated list of starting codons; if omitted, the default is "ATG" , another example would be "ATG,TTG" (for S.aureus). Option frame indicates that both start and stop codons need to be found. If they is not found or the fragment is too short, the table will be empty. Option all allows one to translate ALL POTENTIAL peptides by assuming that the start and/or stop codons may be beyond the sequence fragment. In this case, initially all 6 frames are produces. Later, some of them can be filtered out by the i_minLen threshold. The unfinished end codons will be marked by 'X'. The table has the following structure:
For example, if the fragment is in the complementary strand it may have the following parameters: #>frameleftrightdirlenseq 1 22 57 1 12 XCVXVAAESVASIn this case translation follows the reverse strand (frame=1), starts in position 57 of the original direct sequence and proceeds to position 22. Example: dna=Sequence("TTAAGGGTAA TATAAAATAT AAAGTTCGAA CAATACCTCA CTAGTATCAC AACGCATATA") T=Trans(dna frame 10) sort T.left show T
Transform( s_groupiGroupos_1map ) → R_12N_all_fract_transformations Transform( s_groupiGroupos_1map iTrans ) → R_12_fract_transformation_i Transform( s_group iTrans R_6cell ) → R_12_abs_transformation_i Transform( obj "bio" i_biomol ) → R_12N_abs_BIOMT_transformations Transform( s_symbolic_transformation ) → R_12 # not ready Transform( R_6 ) → R_12 Transform( M_4x4  M_3x3 ) → R_12_transformation Transform( R_12 inverse ) → R_12_inverse_transformation returns one or n transformations in the form of one 12*n long vector. Here os_1 means selection of one single object (e.g. a_ for the current object). The crystal symmetry and the biological symmetry can be imposed with the set symmetry command.
matrix function. Transpose ( matrix )  converts the argument matrix[n,m] into the transposed matrix [m,n] Transpose ( rarray )  converts real vector [n] into a onecolumn matrix [n,1] Examples: Transpose(a) # least squares fit Transpose({1. 2. 3.}) # [3,1] matrix Transpose( table [i_nameColumn] )  converts the argument table[nrows,ncols] into the transposed table [ncols,nrows] All columns in the result table will be assigned the same type which is determined from column types of the source table. The result type can be either iarray, rarray or sarray. Optional argument i_nameColumn specifies the column number in the source table which will be excluded from the transposition and it's values will be used to assign column names in the result table. Example:
multiple functions to trim array/matrix/string (see several function templates below). Trim ( R [ r_percentile [ i_mode ]] )  returns rarray of softly trimmed values. The obvious outliers are softly moved closer to the expected distribution. This is a clever autotrim which identifies outliers defined as values beyond the limits [a,b] projected from range of the r_percentile values adjusted to 100% with 10% of additional margin. The values within the limits are not changed but the outliers are brought closer to the majority bounds. If i_mode is 0, the outliers are assigned to the boundary values. If i_mode is 1, the values outside the range are scaled down according to this formulae: d_new = b + log(1.+(db)/(ba)) for high values and similarly for low values. Return values:
Trim({0. 1. 4. 6.}) # keeps values unchanged Trim({0. 1. 4. 6. 55.},0.9,1) # returns {0. 1. 4. 6. 11.3} Trim({33. 0. 1. 4. 6. 55.},0.9,1) # returns {3.5 0. 1. 4. 6. 11.3}
Trim ( R rainbowfix )
 a linear transformation to the [0., 1.] range, useful for generating a rainbow color index.
The fix option transforms to a fixed range of [1.,1.], useful for machine learning.
Trim("123456",3) # returns "123" Trim("123456",33) # returns "123456" Trim("123456",3,"..") # returns "123.." Trim ( string s_allowed_characters )  returns string with in which only the allowed characters are retained. All other characters are removed. Example: Trim("as123d","abcds") asd Trim ( string S_regularExpressionsToDelete )
 returns string in which all listed regular expressions are deleted.
 returns sarray of strings with removed trailing blanks. With option all it removes white space characters from both ends.
Trim( X [s_smarts ('[$([*;D1]~[*;R0])]') [i_maxSteps(999) i_minAtomsLeft (0)] ] ) → X_trimmed iteratively identifies the smarts patterns and deletes it. Arguments:
add column t Chemical({"C1C(CCNC)CNC1CCCC","",""} ) t.mol[2] = Trim( t.mol[1],"[*;D1]" ) t.mol[3] = Trim( t.mol[1] ) # the default will leave one attached atom See also:
Trim ( seq S_tagRegexps ) → seq_truncated This function finds the matching regular expressions in the source sequence and deletes it. Note that the order is important and the longer patterns need to precede the shorter ones. The pattern can be Nterminal (use ^) , a fragment in the middle, or Cterminal (use dollar $ ) There is a built in shell array called S_proteinTags that contains popular expression tags: ^.{0,11}HHHHHH ^.{0,5}HHHHH ^.{0,5}DYKDDDDK DYKDDDDK.{0,3}$ HHHHHH.{0,6}$ YPYDVPDY.{0:3}$ AWRHPQFGG$Feel free to modify it or provide your own list or fragments to be deleted. Example: read pdb sequence "1pme" # contains histag cleanseq = Trim(1pme_a S_proteinTags ) # built in shell array Align(1pme_a cleanseq) 1pme_a MSSSHHHHHHSSGLVPRGSHMAAAAAAGAG cleanseq SSGLVPRGSHMAAAAAAGAG
betaturn prediction function. Turn ( { seq  rs } )  returns rarray containing betaturn prediction index. The index is derived from propensities for i,i+1,i+2,i+3 positions for each aminoacid. Pi = pi+pi1+pi2+pi3, then high Pi values are assigned to the next three residues. The propensities are taken from Hutchinson and Thornton (1994). Examples: s = Sequence("SITCPYPDGVCVTQEAAVIVGSQTRKVKNNLCL") plot comment=String(s) number Turn(s) display # plot Turn predictionSee also the predictSeq macro.
[ Type soap  Type molcart ] generic function returning type.Type ( icm_object_or_keyword )  returns a string containing the object type (e.g. Type(4.32) and Type(tzWeight) return string "real" ). The function returns one of the following types: "integer", "real", "string", "logical", "iarray", "rarray", "sarray","table", "aselection","vselection","sequence", "alignment", "profile", "matrix", "map", "grob", "command", "macro", "unknown". Type (parray , 1 )  returns the parray element type, like "mol" or "model". Type ( as , 1 )  returns a string containing the level of the selection ("atom","residue","molecule","object"). Type ( os_object , 2 )
 returns a string (or an sarray with keyword object) containing the os_object (or current by default) molecular object type. Defined types follow the EXPDTA (experimental data) card of PDB file with some exceptions, see below:
The nonICM types can be changed with the set type object command, e.g. set type a_ "NMR"
The molecule type can be reset with the set type ms_ s_type command, e.g. ( set type a_2 "H" to switch to a heteroatom type. Examples: if (Type(a_1.1)!="Amino") goto skip: # deal only with proteins if (Type( ) == "NMR") print "Oh, yes!"See also: Type( ms moleculeall ) or Type( rs residueall ) for an array of oneletter molecule types or array of residue types Type ( as { atom  mmff } )  returns an iarray containing the ICM or MMFF atom types. Example: build string "his ala" show Type(a_//!vt* atom ) # icm types for nonvirtual atoms Type ( as_1 as_2 )  returns an integer containing the covalent bond type between the selected atoms. Type( osmsrs allobjectmoleculeresidue ) → S_types
 this function will always return a sarray with types for each selected unit. With all it will determine the level of selection from the selection.
Otherwise the level will be determined by the keyword. For molecules oneletter type code will be returned, e.g. "H" or "A" etc.
read pdb sequence "1dnk" Type( 1dnk_b, 1 ) nucleotide for i=1,Nof(sequence) if Type(sequence[i],1) == "nucleotide" rename sequence[i] "dna"+i endfor delete sequence "dna*"
Type( soapObject 2 ) See SOAP services for information.
Type( s_dbtable sql column )  returns sarray with SQL column types of the database table s_dbtable. See also: molcart, Name molcart
remove successive duplicates Unique ( sorted_array )  returns the array with all elements but one thrown away from the groups of successive equal elements. Unique ( unsorted_I_or_S_array [ sort  number ] )  returns the list of sorted unique values or their number of occurrences ( the number option). Unique(.. sort ) and Unique(.. number) arrays can be combined into a table (see example below). This table is similar to the [2,N] matrix returned by the Histogram function. Example: ii = {3 1 3 2 2 5 2 1} # let us form a table with values and frequencies add column t Unique(ii sort) Unique(ii number) show t
Unique ( table s_columnName )
 returns the table made unique by one of its columns.
Unique( {1 1 2 3 3 3 4} ) # returns { 1 2 3 4 } Unique( {1 1 2 2 1 1} ) # returns { 1 2 1 } See also: Sort
the output of a UNIX command. Unix ( s_unix_command )  returns the string output of the specified unix command. This output is also copied to the s_out string. This function is quite similar to the sys or unix command. However the function, as opposed to the command, can be used in an expression and be nested. Examples: show Unix("which netscape") # equivalent to 'unix which netscape' # if ( Nof(Unix("ls"),"\n") <= 1 ) print "Directory is empty" See also:
values of bond lengths, bond angles, phase and torsion angles. Value ( vs_var [R_referenceValues] )  returns rarray of selected variables. Both v_ (free) and V_ (all) variable selections can be used. The function considers variables only in the current object. If the real array of reference values is provided then the torsion angles are returned in a 360. period closer to the reference values. Examples: build string "ASD"; minimize # a short peptide ang=Value( v_//phi,psi ) # array of 4 phipsi values hbondlens=Value( V_//bh* ) # array of lengths for all HX bonds Value(v_//phi,psi {180.,180.,180.,180.}) # will convert 150. to 210.
Extracts a content from the SOAP message ( See SOAP services ). Value ( soapMessage )  returns either basic type (for strings integers or reals ) or SOAP object which may consists of these basic types grouped together into arrays or structures See SOAP services for more information.
[ Vectorproduct  Vectorsymmetrytransformation  LatentVector ] vector product between two 3Dvectors.
Vector ( R_vector1 R_vector2 )  returns rarray [1:3], which is the vector product with components { v1[2]*v2[3]  v2[2]*v1[3], v1[3]*v2[1]  v2[3]*v1[1], v1[1]*v2[2]  v2[1]*v1[2] }
By the way the vector dot product is just
Sum( R_n_vector1 R_n_vector2 )
Vector ( M_matrix )  transforms an augmented affine 4x4 space transformation matrix into a transformation vector.
See also:
Augment( ) function.
Vector ( PLS_model i_num )  returns ith latent vector of the PLS model See also: Nof latent learn predict
information about version of the current executable, or ICM license. Version ( session )  returns string with the FlexLM license information Version(session) Files searched:/home/don/icmd/license.dat;/usr/local/flexlm/licenses/license.dat;*.lic Version ( [ full  number ] )
 returns string containing the current ICM version.
The second field in the string specifies the operating system: "UNIX" or "WIN".
At the end there is a list of oneletter specifications of the licensed modules
separated by spaces (e.g. " G B R " ).
Option full adds a few fields:
Version ( graphics [ full ] )
 returns string containing the OpenGL graphics driver vendor information.
With the full option the output is more verbose and lists the supported OpenGL extensions
and a number of driverspecific limitations, like the maximum number of light sources
supported.
show Version( ) # it returns a string if (Real(Version( )) < 2.6) print "YOUR VERSION IS TOO OLD" if (Field(Version( ),2) == "UNIX") unix rm tm.dat if (Field(Version( ),2) == "WIN") unix del C:\tm\tm.dat if Version() == " D " print " Info> the Docking module license is ok" show Version( number ) # returned 3.103 today Version( graphic full ) GL_VENDOR = NVIDIA Corporation GL_RENDERER = GeForce 6600 GT/PCI/SSE2 GL_VERSION = 2.0.1 GL_EXTENSIONS = GL_ARB_color_buffer_float ... WGL_EXT_swap_control GL_MAX_VIEWPORT_DIMS = 4096 x 4096 GL_MAX_LIGHTS = 8 GL_MAX_CLIP_PLANES = 6 Version ( s_binaryFile [ binary  gui ] )  returns either string version of the binary file ( binary option ) or the version of the ICM executable used to save the file ( gui option ). Version("tmp.icb" gui) # returns string 3.025j if( Integer(Version("tmp.icb" binary ))> 6 ) print "OK"
volumes of grobs, spheres, residues, boxes and cells.
See detailed descriptions below
read grob "swissCheese" # divide one grob it into several grobs split g_swissCheese for i=3,Nof(grob) # see, all the holes have negative volume print "CAVITY" i, Volume(g_swissCheese$i) endfor See also: the Area( grob )} function, the split command and How to display and characterize protein cavities section. Volume ( r_radius )  returns real volume of a sphere, (4/3)Pi*R^{3} Volume ( s_aminoAcids )  returns real total van der Waals volume of specified aminoacids. Volume ( R_a_b_c_alpha_beta_gamma )  returns real volume of a cell with the crystallographic unit cell parameters parameters {a,b,c} for a parallelepiped or {a, b, c, alpha, beta, gamma} in a general case. Volume ( R6_xyzXYZ box ) volume of a 3D box defined by coordinates of two opposing corners (see also the Box function), e.g. read pdb "1xbb" Volume( Box( a_2 ) box ) Volume ( g_grob )  returns real volume confined by a grob. Examples: vol=Volume(1.) # 4*Pi/3 volume of unit sphere vol=Volume("APPGGASDDDEWQSSR") # van der Waals volume of the sequence vol=Volume({2.3,2.,5.,80.,90.,40.}) # volume of an oblique cell
parameters of the graphics window and graphics view. View( [ window ] )  returns rarray of 37 parameters of the graphics window and view attributes. Some facts:
Here are the components of the View vector:
Example on how to translate a defined physical coordinate to the front clipping plane or a center: # display something V = View() M1 = Matrix(V[ 1:16], 4) M2 = Matrix(V[17:32], 4) # Now any physical coordinate can be transformed into a screen coordinate: XX = Augment( Xyz(a_//c* ) ) # function Augment adds the needed 4th coordinate. show XX * M1 * M2 # atoms with a screen coordinate outside [1,1] will not be visible To rotate an your view around a screen X,Y, or Z axis by an angle use rotate view Rot( vector angle ) command. For example: rotate view Rot({1. 0. 0.} 90.) # for screen X coordinateor use rotateView macro
See also
set view and
set view.
Info(display)
rotateView macro
nice "1crn" # resize window write image window=2*View(window) # 2times larger image View( "x"  "y"  "z" ) returns rarray of 3 components of the screen X, Y, or Z axis. The vectors are normalized. Example: read pdb "1crn" display a_ # rotate to the desired view arrx = Grob( "ARROW" 10.*View("x") ) # make a 10A arrow arry = Grob( "ARROW" 10.*View("y") ) # make a 10A arrow display arrx,arry View( slide )  returns 37 rarray of the viewpoint parameters extracted from the slide .
View ( R_37_FromView, R_37_ToView, r_factor )
nice "1crn" # manually rotate and zoom r1= View() # save the current view # INTERACTIVELY CREATE ANOTHER VIEW r2= View() # save the new view for i=1,100 # INTERPOLATION set view View(r1,r2,i*0.01) endforSee also View (), set view and set view. View ( { "x""X""y""Y""z""Z" } )  returns rarray of 3 coordinates of the specified axis of the screen coordinate system. Example: build string "se ala" display # rotate it now show View("x") g1=Grob("ARROW",3.*View("x")) display g1
indicates that the previous ICMshell command has completed with warning. Warning()  returns logical yes if there was an warning in a previous command (not necessarily in the last one). After this call the internal warning flag is reinstalled to no. Warning ( string )  returns string with the last warning message. In contrast to the logical Warning() function, here the internal warning code is not reinstalled to 0, so that you can use it in expressions like if Warning() print Warning(string) . Example: read pdb "2ins" # has many warnings if Warning() s_mess = Warning(string) # the LAST warning only print s_mess
[ Xyz points  Xyz rings  Xyz mesh  Xyz fract  Xyz transformed xyz  Xyz chemical match  Xyz vector2matrix  Xyz axes ] function returning a matrix of x,y,z coordinates.
Xyz ( as  grob , [ {Default X,Y,Z} ] )
Xyz ( as residue )
coord=Xyz(a_//ca) # matrix of Cacoordinates show coord[i] # 3vector x,y,z of ith atom show Mean(Xyz(a_//ca)) # show the centroid of Caatoms
Xyz( as ring )  returns matrix [ number_of_rings_in_selection , 3] in which each row contains x,y,z of an ring from the selection Example: <> read pdb "2l8h" display a_N xstick g_ring_centers = Grob( Xyz( a_N//RA ring ) dot ) # centers or aromatic rings display g_ring_centers <>
Xyz ( as r_interPointDistance surface )
Xyz( M_abs_xyz, R_3_6cellobs ) → M_fract_xyz Xyz( M_fract_xyz, R_3_6cellobs, cell ) → M_abs_xyz Transforming absolute coordinates to fractional (i.e. the unit cell) coordinates and the inverse transformation. The cell parameters can be taken from an object or from the 3 or 6 cell parameters. Example:
Xyz( M_xyz, R_12abs_transformation [reversecelltransform] ) → M_xyz1_transformed Xyz( M_xyz, i_symm_transformation, s_sym_group, R3_cellR_6_cell [celltranslate]) → M_xyz_transformed Xyz( M_xyz, i_symm_transformation, s_sym_group, R_6cell//R_3center ) → M_xyz_transformed returns a new Nx3 coordinate matrix with the source coordinates transformed according to R_12abs_transformation or i_symm_transformation of the specified symmetry group. If i_symm_transformation is greater than the number of symmetry operations in the specified symmetry group, the transformation goes to the 26 neighboring crystallographic cells. The central cell can be determined in three different ways:
If option translate is provided or if {x,y,z} vector is appended to the 6membered cell array The coordinates will be translated after the transformation to the cells around {x,y,z} . Translation to the vicinity of automatically or statically defined center (option translate or {x,y,z} , accordingly) is also used by the transform command. The transform command does automated centering to the center of mass with the translate option or static with the translate={x,y,z} option. Also see the makeBioMT macro.
Xyz( as s_smiles ) → Xyz_match
Xyz( R_3N_x1y1z1x2y2z3...> ) → <M_Nx3_xyz
Xyz ( R_6cell axis ) → M_ABCvectors returns three rowvectors A, B and C corresponding to the R_6cell parameters. The same vectors can be obtained as columns of the Augment(R_6 ) function. Example: c6 = {10. 10. 10., 120. 120. 120.} Xyz(c6,axis)[1] # A vector Xyz(c6,axis)[2] # B vector Xyz(c6,axis)[3] # C vector

Copyright© 19892020, Molsoft,LLC  All Rights Reserved. Copyright© 19892020, Molsoft,LLC  All Rights Reserved. This document contains proprietary and confidential information of Molsoft, LLC. The content of this document may not be disclosed to third parties, copied or duplicated in any form, in whole or in part, without the prior written permission from Molsoft, LLC. 