PrevICM Language Reference
Functions
Next

[ Abs | Acc | Acos | Acosh | Align | Angle | Area | Asin | Asinh | Ask | Askg | Atan | Atan2 | Atanh | Atom | Augment | Axis | Bfactor | Boltzmann | Box | Bracket | Cad | Ceil | Cell | Charge | Chemical | Cluster | Color | Consensus | Corr | Cos | Cosh | Count | CubicRoot | Date | Deletion | Disgeo | Distance | Eigen | Energy | Error | Error soap | Exist | Existenv | Extension | Exp | Field | File | Find | Floor | Formula | Getarg | Getenv | Gradient | Grob | Group | Header | Histogram | Iarray | IcmSequence | Image | Index | Indexx | Insertion | Info | Info image | Integer | Integral | Interrupt | Label | Laplacian | Length | LinearFit | LinearModel | Log | Map | Mass | Moment | Match | Matrix | Max | MaxHKL | Mean | Min | Money | Mod | Mol | Name | Namex | Next | Nof | Norm | Normalize | NotInList | Obj | Occupancy | Path | Parray | Pattern | Pi | Potential | Power | Predict | Probability | Profile | Property | Putarg | Putenv | Radius | Random | Rarray | Real | Remainder | Reference | Replace | Res | Resali | Resolution | 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 sequence | Turn | Type | Unique | Unix | Value | Value soap | Vector | Version | Volume | View | Warning | Xyz ]

ICM-shell functions are an important part of the ICM-shell environment. They have the following general format: FunctionName ( arg1, arg2, ... ) and return an ICM-shell object of one of the following types: integer, real, string, logical, iarray, rarray, sarray, matrix, sequence, profile, alignments, maps, graphics objects, a.k.a. grob and selections.
The order of the function arguments is fixed in contrast to that of commands. The same function may perform different operations and return ICM-shell constants of different type depending on the arguments types and order. ICM-shell objects returned by functions have no names, they may be parts of algebraic expressions and should be formally considered as 'constants'. Individual 'constants' or expressions can be assigned to a named variable. Function names always start with a capital letter. Example:
 
 show Mean(Random(1.,3.,10))  


Abs


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.

Examples:

 
 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" 


Acc


accessibility selection function. It returns residues or atoms with relative solvent accessible area greater than certain threshold. Important: The surface area must be calculated before this function call. The Acc function just uses surface values, it does not reevaluate them. Therefore, make sure that the show area command (or show energy, minimize , etc. with the "sf" surface term turned on), has been executed before you use the Acc function. If you specify the threshold explicitly, it must range from 0.0 to 1.0, otherwise it is set to 0.25 for residue selections and 0.1 for atom selections.
Acc ( rs , [ r_Threshold ] )
- returns residue selection, containing a subset of specified residues `rs_ for which the ratio of their current accessible surface to the standard exposed surface is greater than the specified or default threshold (0.25 by default). ICM stores the table of standard residue accessibilities in an unfolded state calculated in the extended Gly-X-Gly dipeptide for all amino acid residue types. It can be displayed by the show residue type command, or by calling function Area( s_residueName ), and the numbers may be modified in the icm.res file.
The actual solvent accessible surface, calculated by a fast dot-surface algorithm, is divided by the standard one and the residue gets selected if it is greater than the specified or default threshold. ( r_Threshold parameter is 0.25 by default).
Acc ( as_select, [ r_Threshold ] )
- returns atom selection, containing atoms with accessible surface divided by the total surface of the atomic sphere in a standard covalent environment greater than the specified or default threshold (0.1). Accessibility at this level does not make as much sense as at the residue level. The standard surface of the atom was determined for standard amino-acid residues. Note that hydrogens were NOT considered in this calculation. Therefore, to assign surface areas to the atoms use
show surface area a_//!h* a_//!h*
command or the
show energy "sf"
command.
You may later propagate the accessible atomic layer by applying Sphere( as_ , 1.1), where 1.1 is larger than a typical X-H distance but smaller than the distance between two heavy atoms. (the optimal r_Threshold at the atomic level used as the default is 0.1, note that it is different from the previous ).
Examples:
 
                                   # let us select interface residues  
 read object s_icmhome+"complex" 
                                   # display all surface residues 
 show surface area 
 display Acc( a_/* ) 
                                   # now let us show the interface residues 
 display a_1,2 
 color a_1 yellow 
 color a_2 blue 
 show surface area a_1 a_1         # calculate surface of  
                                   # the first molecule only  
 
                                   # select interface residues  
                                   # of the first molecule  
 color red Sphere(a_2/* a_1/* 4.) & Acc(a_1/*)      
 
 read object 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  


Acos


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.}  


Acosh


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}  


Align


[ sequence | structural alignment | sub_alignments ]

family of the alignment functions. These function return an alignment icm-shell object and perform


Pairwise sequence alignment or sequence-structure alignment


Align ( [ sequence1, sequence2 ] [ area ] [ M_scores ] )

- returns ZEGA- alignment. If no arguments are given, the function aligns the first two sequences in the sequence list. For sequence alignments, the ZEGA-statistics of structural significance ( Abagyan, Batalov, 1997) is given and can be additionally evaluated with the Probability function. The reported pP value is -Log(Probability,10).

Returned variables:


Simple pairwise sequence alignment
Align( )
Align( seq1 seq2 ) - returns an alignment. The alignMethod preference allows you to perform two types of pairwise sequence alignments: "ZEGA" and "H-align". If you skip the arguments, the first two sequence are aligned.
Example:
 
   read sequences s_icmhome+"sh3.seq" # read 3 sequences 
   print Align(Fyn,Spec)              # align two of them  
   Align( )                           # the first two 
   a=Align( sequence[1] sequence[3] ) # 1st and 3rd 
   if(r_out > 5.) print "Sequences are struct. related"  

Aligning 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 residue-residue substitution values in the course of the alignment (see also accFunction ).
The weights must be positive and less than 2.37 . Try to be around or less than 1. since relative accessibilities are always in [0.,1.] range. Values larger than 2.37 do not work well anyway with the existing alignment matrices and gap parameters. Use the Trim function to adjust the values, e.g. Trim( myweights , 0.1,2.3 ) ).
E.g.
 
 read pdb "1lbd" 
 show surface area  
 make sequence 
  Info> sequence  1lbd_m  extracted  
 1lbd_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 alpha-helix in the first sequence preferably aligns with alpha-helix in the second one.
In this case you can prepare a matrix of extra scores for each pair of positions in two sequences, e.g.
 
 seq1 = Sequence("WEARSLTTGETGYIPSA") 
 seq2 = Sequence("WKVEVNDRQGFVPAAY") 
 Align() 
 # Consensus   W.#.  .~~.~G%#P^ 
           WEARSLTTGETGYIPS-- 
           WKVE--VNDRQGFVPAAY 
 m = Matrix(17,16,0.) 
 m[10,4] = 3. # reward alignment of E in seq1[10]  and E in seq2[4] 
 Align(seq1 seq2 m ) 
 # Consensus   W.#      E    ~G%#P^ 
           WEARSLTTGE----TGYIPS-- 
           WKV------EVNDRQGFVPAAY 

The alignSS macro shows a more elaborate example in which extra scores are prepared to encourage alignments of the same secondary structure elements.
Warning. The alignment procedure is rather subtle and may be sensitive to the gap parameters and the comparison matrix. Avoid matrix values comparable with gap opening penalty.

See also: Probability( ali .. ) for local alignment reliability.



Local pairwise structural alignment


[ alignment-from-tethers ]

Two types of structural alignments or mixed sequence/structural alignments can be performed with the Align function.
Align( seq_1 seq_2 distance [ i_window ] [ r_seq_weight ] ) - performs local structural alignment, using distance RMSD as structural fitness criterion. The RMSD is calculated in a window i_window and the dynamic programming algorithm combines structural scores with sequence alignment scores if r_seq_weight > 0.,
Align( seq_1 seq_2 superimpose [ i_window ] [ r_seq_weight ] ) - performs local structural alignment, using superposition followed by coordinate RMSD calculation as structural fitness criterion. The RMSD is calculated in a window i_window and the dynamic programming algorithm combines structural scores with sequence alignment scores if r_seq_weight > 0.,
In both cases the function uses the dynamic algorithm to find the alignment of the locally structurally similar backbone conformations.
The alignment based on optimal structural superposition of two 3D structures may be different from purely sequence alignment
Preconditions:

The residue-label-carrying atoms (see the set label a_ command) will be used for structural superpositions. r_seq_weight is used to add sequence amino acid substitution values to the 3D similarity signal.

See also: align ms1 ms2 function


Deriving an alignment from tethers between two 3D objects
Align ( ms ) - returns alignment between sequences of the specified molecule and the template molecule to which it is tethered. The alignment is deduced from the tethers imposed.


Example:

 
 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  

Extracting pairwise alignment sequences from a multiple alignment


Align ( ali, seq_1, seq_2 ) - returns a pairwise sub- alignment of the input alignment ali_, reorders of sequences in the alignment according to the order of arguments.
Extracting a multiple alignment of a subset of sequences from a multiple alignment
Align ( ali, I_seqNumbers ) - returns a reordered and/or partial alignment . Sequences are taken in the order specified in I_seqNumbers.

Examples:

 
             # 14 sequences  
 read alignment msf s_icmhome + "azurins"  
             # extract a pairwise alignment by names  
 aa = Align(azurins,Azu2_Metj,Azur_Alcde)  
             # reordered sub-alignment extracted by numbers  
 bb = Align(azurins,{2 5 3 4 10 11 12})    

Resorting alignment in the order of sequence input with the Align ( ali_, I_seqNumbers ) function.
Load the following macro and apply it to your alignment. Example:
 
 macro reorderAlignmentSeq( ali_ ) 
  nn=Name(ali_)  # names in the alignment order 
  ii=Iarray(Nof(nn)) 
  j=0 
  for i=1,Nof(sequence)  # the original order 
   ipos = Index( nn, Name(sequence[i] ) ) 
   if ipos >0 then 
     j=j+1 
     ii[j] = ipos 
   endif 
  endfor 
  ali_new = Align( ali_ ii ) 
  keep ali_new 
 endmacro 


Angle


a family of functions calculating planar angles. The most detailed is Angle ( table ) (see below). They calculates planar angle in degrees.
Angle ( as_atom ) - returns the planar angle defined by the specified atom and two previous atoms in the ICM-tree. For example, Angle(a_/5/c) is defined by C-Ca-N atoms of the 5-th residue. You may type:
 
 print Angle(  # and then click the atom of interest. 

Angle ( as_atom1 , as_atom2 , as_atom3 ) - returns the planar angle defined by three atoms.
Angle ( R_3point1 , R_3point2 , R_3point3 ) - returns the planar angle defined by the three points.
Angle ( R_vector1 , R_vector2 ) - returns the planar angle between the two vectors.

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 ( as|rs|ms|os 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).
Examples:

 
 d=Angle( a_/4/c )                         # d equals N-Ca-C angle  
 print Angle( a_/4/ca a_/5/ca a_/6/ca )    # virtual Ca-Ca-Ca planar angle  

The rotation angle corresponding to a transformation vector is returned as r_out by the Axis( R_12 ) function.



Area


[ Area contact matrix ]

calculates surface area. A quick guide:

Area( grob [error] ) ⇒ r

Area( as | rs ) ⇒ R_atomAreas|R_resAreas # needs surface calculation beforehand

Area( rs type ) ⇒ R_maxAreas_in_GLY_X_GLY

Area( as R_typeEyPerArea energy ) ⇒ R_atomEnergies

Area( seq ) ⇒ R_relAreasPerResidue

Area( s_icmResType ) ⇒ r

Area( rs rs_2 ) ⇒ M_contactAreas

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:


Area ( grob [error] ) - returns real surface area of a solid graphics object. Option error makes it return the fraction of the surface that is not closed to detect the holes or missing patches in what supposed to be a closed surface. (e.g.


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 pre-calculated solvent accessible areas or energies for selected atoms `as_ . This areas are set by the show area surface|skin 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
Area( a_/15:30/* ) # areas of this atoms
#
# Now let us redefine the first three solvation parameters
# of icm.hdt and calculated E*A contributions of selected atoms
#
Area( a_/15:30/* {10., 20. 30.} energy) 

Area ( rs ) - returns rarray of pre-calculated solvent accessible areas for selected residues `rs_ . These accessibilities depend on conformation.
Area ( rs type ) - returns rarray of maximal standard solvent accessible areas for selected residues `rs_ . These accessibilities are calculated for each residue in standard extended conformation surrounded by Gly residues. Those accessibilities depend only on the sequence of the selected residues and do NOT depend on its conformation. To calculate normalized accessibilities, divide Area( rs_ ) by Area( rs_ type )
Example:
 
read object 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.
Area( seq ) ⇒ R_relAreasPerResidue

- 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 : "pre-calculated" above means that before invoking this function, you should calculate the surface by show area surface , show area skin or show energy "sf" commands.
Examples:

 
 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) display 
See also: Acc( ) function.

Area contact matrix


(also see the simplified distance-based contacts strength calculation below)
Area ( rs_1 rs_2 ) - returns rarray of areas of contact between selected residues. You can do it for intra-molecular residue contacts, in which case both selections should be the same, i.e. Area(a_1/* a_1/*) ; or, alternatively, you can analyze intermolecular residue contacts, for example, Area(a_1/A a_2/A). See also the Cad function, and example in plot area in which a contact matrix is calculated via interatomic Ca-Ca distances. The table of the pairwise contact area differences is written to the s_out string which can later be read into a proper table via: read column group name="aa" input=s_out and sorted by the area (see below).
Example:

 
 read object 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 Ca-Cb 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 Ca-Cb vector (2.3A) and calculates the distance matrix between those point. Then the distances are converted into the contact strength:

All three parameters can be redefined, e.g.

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 non-matching gapped regions
m2=Area( a_1cbn.a/!Cg a_1cbn.a/!Cg distance )
diff = Sum(Sum(Abs(m1-m2)))/Sum(Sum(Max(m1,m2)))  
simi = 1.-diff 
printf "  Info> dist=%.2f similarity=%.2f or %1f%\n" diff simi,100.*simi



Asin


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.}  


Asinh


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} 


Ask


interactive input function. Convenient in macros.
Ask( s_prompt, i_default )
- returns entered integer or default.
Ask ( s_prompt, r_default )
- returns entered real or default.
Ask ( s_prompt, l_default )
- returns entered logical or default.
Ask ( s_prompt, s_default [simple] )
- returns entered string or default. Option simple suppressed interpretation of the input and makes quotation marks unnecessary.
Examples:
 
 windowSize=Ask("Enter window size",windowSize) 
 s_mask=Ask("Enter alignment mask","xxx----xxx") 
 
 grobName=Ask("Enter grob name","xxx") 
 display $grobName 
 
 show Ask("Enter string, it will be interpreted by ICM:", "")  
          #e.g. Consensus( myAlignm ) 
 
 show Ask("Enter string:", "As Is",simple)     
          #your input taken directly as a string 

See also: Askg



Askg


interactive input function that generates a GUI dialog. Return entered text Askg( s_prompt, i_default ) ⇒ s_returnsTheInputString

E.g.


Askg( "Enter your name", ""  ) # empty default 
Askg( "Enter your name", "Michael"  )

Return the pressed button. Askg( s_Question, "Reply1/Reply2/.." simple ) ⇒ s_theReply

Makes a GUI dialog with the question and several alternatives separated by a slash. This dialog returns one of the string selected ,e.g. "Yes", "No" , or "Cancel" for the "Yes/No/Cancel" argument. Example:


s = Askg("Do you like bananas?","Yes/No/Fried only",simple)
if s=="Fried only" print "Impressive" 

Creating a special chemical dialog for library enumeration.This one is very specialized and is used in combi-chem generator.

Askg( chem_scaffold , enumerate ) ⇒ s_makeLib_React_Args

Askg( chem_reaction , enumerate ) ⇒ s_makeLib_React_Args

prompts for arguments for the enumerate library or make reaction commands to create a combinatorial library. To use this function you need to have the chemical array objects with Markush-scaffolds or reactions, plus the building blocks loaded into ICM. The function returns a string with the agruments for the enumerate library or make reaction commands. E.g.


args = Askg( scaff1 enumerate )
enumerate library scaff1 $args

Askg( s_dialogDeclaration ) ⇒ "yes"/"no"

Generates a dialog from GUI dialog description text. Values from each input field can be accessed either by :

$field_num

or

Getarg( i_field_num gui )


buf  = "#dialog{\"Select InSilco Models\"}\n"
buf += "#1 l_Passive_GUT_Absorption (yes)\n"
buf += "#2 l_ToxCheck (no)\n"
buf += "#3 l_hERG_QSAR (yes)\n"
buf += "#4 s_Comment_Here ()\n"

Askg(buf)

print $1, $2, Getarg( 3 gui ), $4

Using Askg in shell, html-docs and table tool panels. These variants of the Askg function can also be used as a part of an ICM script in dialogs generated from built-in html documents, or in actions associated with tables.

See also : gui programming


Atan


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.}  


Atan2


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}  


Atanh


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 }  


Atom


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( as|rs|ms|os ) ⇒ 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 ) # i-th 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 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 sub-selection of as that has tethers .

Atom( vs i ) # i-th 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
Examples:

 
 asel=Acc(a_2/his)             # select accessible His residues of  
                               # the second molecule  
 show Atom(asel)               # show atoms of these residues 
 show Atom( v_//phi )          # carbonyl Cs 
See also: the Res, Mol, and Obj functions.

Augment


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 12-transformation vector, use the Vector( M_4x4 ) function.

See also: Vector (the inverse function), symmetry transformations, and transformation vector.
Augment ( R_6Cell )
- returns 4x4 matrix of oblique transformation from fractional coordinates to absolute coordinates for given cell parameters {a b c alpha beta gamma}.
This matrix can be used to generate real coordinates. It also contains vectors A, B and C. See also an example.
Example:
 
 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.



Axis


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

Bfactor


crystallographic temperature factors or custom atom parameters.
Bfactor ( [ as | rs ] [ simple ] ) - returns rarray of b-factors for the specified selection of atoms or residues. If selection of residue level is given, the average residue b-factors are returned. B-factors can also be shown with the command show pdb.
Option simple returns a normalized b-factor. This option is possible for X-ray objects containing b-factor information. The read pdb command calculates the average B-factor for all non-water atoms. The normalized B-factor is calculated as (b-b_av)/b_av . This is preferable for coloring ribbons by B-factor since these numbers only depend on the ratios to the average. We recommend to use the following commands to color by b-factor:
 
 color ribbon a_/ Trim(Bfactor( a_/ simple ),-0.5,3.)//-0.5//3. # or 
 color a_// Trim(Bfactor( a_// simple ),-0.5,3.)//-0.5//3.  # for atoms 
This 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 B-factor of Ca-atoms  
 show Bfactor(a_//!h*)        # array of B-factors of heavy atoms  
 color a_//* Bfactor(a_//*)   # color previously displayed atoms  
                              # according to their B-factor  
 color ribbon a_/A Bfactor(a_/A) # color the whole residue by mean B-fac. 


Boltzmann


returns the real Boltzmann constant = 0.001987 kcal/deg.
Example:
 
 deltaE = Boltzmann*temperature  # energy  


Box


the 3D graphics box function. This box can be displayed with the display box command or by left-double-clicking on a grob, and interactively moved and resized with the mouse. One can select atoms inside a box by this operation: as_ & Box( )
Box ( [ display ] ) - returns the 6- rarray with {Xmin ,Ymin ,Zmin ,Xmax ,Ymax ,Zmax } parameters of the graphics box as defined on the screen. With the display keyword, the function returns {0. 0. 0. 0. 0. 0.} if the box is not displayed (by default it returns the last 6 values).
Box ( center ) - returns the 6- rarray with Xcenter,Ycenter,Zcenter,Xsize,Ysize,Zsize parameters of the graphics box as defined on the screen.
Box ( as [ r_margin ] ) - returns the 6- rarray with Xmin,Ymin,Zmin,Xmax,Ymax,Zmax parameters of the box surrounding the selected atoms. The boundaries are expanded by r_margin (default: 0.0 ).


Examples:

 
 build string "se ala his"  # a peptide  
 display box Box(a_/2 1.2)  # surround the a_/2 by a box with 1.2A margin 
 color a_//* & Box( )  

Box ( { g | m | R_6box } [ r_margin ] )
- returns the 6- rarray with Xmin,Ymin,Zmin,Xmax,Ymax,Zmax parameters of the box surrounding the selected grob or map. The boundaries are expanded by r_margin (default: 0.0 ).

Bracket


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.

Cad


[ Cad1 | Cadalign ]

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:

Comparing two conformations of the same molecule via residue-residue contact conservation.


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 measure is a normalized sum of differences between residue-residue contact areas in two conformations. The measure was calibrated on a set of pairs of conformations. The average distortion due to a noncrystallographic symmetry is about 5%, the average CAD between a pair of models in an NMR entry is 15%. Note that the paper uses an additional factor of 1.8 (i.e. CAD=1.8*Cad()) to bring the scale down to 0:100%, because about 40% of the contacts are trivial contacts between the neighboring residues. However, in evaluation of the docking solutions coefficient 1.8 should not be used. Loops are somewhat intermediate, but still a coefficient of 1.8 is recommended for consistency.
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 residue-residue contact areas.
Options:
Examples:
 
# Ab initio structure prediction, Overall models by homology  
   read pdb "cnf1"   # one conformation of a protein  
   read pdb "cnf2"   # another conformation of the same protein 
   show 1.8*Cad(a_1. a_2.)   # CAD=0. - identical; =100. different 
   show 1.8*Cad(a_1.1 a_2.1) # CAD between the 1st molecules (domains) 
   show 1.8*Cad(a_1.1/2:10 a_2.1/2:10) # CAD in a window 
   PLOT.rainbowStyle = 2 
   plot area grid M_out comment=String(Sequence(a_1,2.1)) link display 
 
# Loop prediction: 0% - identical; ~100% totally different 
#    CAD for loop 10:20 and its interactions with the environment 
   show 1.8*Cad(a_1.1/10:20 a_1.1/* a_2.1/10:20 a_2.1/*)   
#    CAD for loop 10:20 itself 
   show 1.8*Cad(a_1.1/10:20 a_1.1/10:20 a_2.1/10:20 a_2.1/10:20)   
 
# Evaluation of docking solutions: 0% - identical; 100% totally different 
   read pdb "expr"   # one conformation of a complex  
   read pdb "pred"   # another conformation of the same complex 
   show Cad(a_1.1 a_1.2 a_2.1 a_2.2)  # CAD between two docking solutions  
# 
# ANOTHER EXAMPLE: the most changed contacts  
   read object "crn" 
   copy a_ "crn2" 
   randomize v_ 5. 
   Cad(a_1. a_2.) 
   show s_out 
   read column group input= s_out name="cont" 
   sort cont.1 
   show cont 
# the table looks like this (the diffs can be both + and -): 
#>T cont 
#>-1-----------2-----------3---------- 
   -39.        a_crn.m/38  a_crn.m/1 
   -36.4       a_crn.m/46  a_crn.m/4 
   -32.1       a_crn.m/46  a_crn.m/5 
   -29.8       a_crn.m/30  a_crn.m/9 
   -25.2       a_crn.m/37  a_crn.m/1 
... 
   42.5        a_crn.m/43  a_crn.m/5 
   45.1        a_crn.m/44  a_crn.m/6 
   45.2        a_crn.m/43  a_crn.m/6 
   55.3        a_crn.m/46  a_crn.m/7 
   56.         a_crn.m/45  a_crn.m/7 


Comparing two different, but structurally homologs proteins, via residue-residue contact conservation.


Cad ( rs_A1 [ rs_A2] rs_B1 [ rs_B2] alignment )


Ceil


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( ).

Cell


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.

Charge


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.

Chemical function. Converting and Generating library compounds.


Converting 3D objects to chemical arrays.

Chemical( ms|os [exact] [hydrogen] [unique] [pharmacophore] )

returns an array of chemicals from a molecular selection of 3D molecular objects, e.g. a_H for hetero-molecules By default the selected molecules will be converted to 2D graphs. However with the exact option the original 3D coordinates will be retained in the elements of the chemical array. If you want to preserve explicitly drawn hydrogens hydrogen option should be used. Note that the number of chemicals in the array will be determined by the selection level. At the object level multiple molecules of the same object will be merged into one array element. With unique option duplicates will be excluded from the result.

Example:


read pdb "1ch8"
group table t_2D Chemical(a_H)   # convert to 2D chemical table 
group table t_3D Chemical(a_H exact)  # convert to 3D chemical table 
group table t_3D_hyd Chemical(a_H exact hydrogen) # convert to 3D chemical table and preserve hydrogens

With pharmacophore option the function generates pharmacophore points for the input selection.

Example:


read object s_icmhome + "biotin.ob" name="biotin"
read mol input = String(  Chemical(a_ pharmacophore )) name="biotin_ph4"
display xstick 
display wire a_biotin.

To display supported pharmacophore types and use show pharmacophore type command

Converting smiles to chemical arrays:

Chemical( S_smiles|s_smiles )

returns an array of chemicals from a string arrays of smiles.

Example:


add column t Chemical({"N[C@@](F)(C)C(=O)O", "C[C@H]1CCCCO1"})

See also: chemical functions

Generating combinatorial compounds from a Markush structure and R-group 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 R-group 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 R-group 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 R-group arrays and the Nof



Cluster


[ Collection ]

Cluster( I_NxM_NearestNeighb i_M_totalNofNearNeighbors i_minNofCommonNeighbors ) ⇒ I_N_clusterNumbers
function returns iarray of cluster numbers for each or N points.
The input to the first function is an array of M nearest neighbors (defined by the second argument i_M_totalNofNearNeighbors) for each of N points. For example for an array for 5 points, and i_M_totalNofNearNeighbors = 3 it can be an array like this: {3,4,5, 1,3,4 1,2,5 2,3,5 1,2,3} . The points will be grouped into the same cluster if the number of neighbors they share is larger or equal than i_minNofCommonNeighbors . This clustering algorithm is adaptive to the cluster density and does not depend on absolute distance threshold. In other words it will identify both very sparse clusters and very dense ones. The nearest neighbor array can be calculated by the with the Link( I_bitkeys , nBits, nNearestNeighbors ) function.
Cluster( M_NxNdist r_maxDist ) ⇒ I_N_clusterNumbers
This function identifies the i_totalNofNeighbors nearest neighbors from the full distance matrix M_NxNdist for each point and assembles points sharing the specified number of common neighbors in clusters.
All singlets (a single item not in any cluster) are placed in a special cluster number 0 . Other items are assigned to a cluster starting from 1.
Example with a distance matrix:
 
# let us make a distance matrix D 
# we will cook it from 5 vectors {0. 0. 0.} 
 m=Matrix(5,3)  # initialize 5 vectors 
 m[2,1:3]={1. 0. 0.}   # v2 
 m[3,1:3]={1. 1. 0.}   # v3 
 m[4,1:3]={1. 1. 1.}   # v4 
 m[5,1:3]={1. 0.1 0.1} # v5 close to v2 
 
 D = Distance( m )  # 5x5 distance matrix created 
 
 Cluster( D , 0.2 ) # v2 and v5 are assigned to cluster 1 
 Cluster( D , 0.1 ) # radius too small. All items are singlets 
 Cluster( D , 2.  ) # radius too large. All items are in cluster 1 


Collection


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.

Collection( table_row ) - returns a collection object for the table row. Collection( t[1] )

Color


[ Color from gradient | Color image ]

returns RGB numbers.
Color ( g_grob ) - returns matrix of RGB numbers for each vertex of the g_grob (dimensions: Nof ( g_grob),3).
See also: color grob matrix .
Example:
 
 build string "se his" 
 display xstick 
 make grob image name="g_" 
 display g_ only smooth 
 M_clr = Color( g_ ) 
 for i=1,20    # shineStyle = "color" makes it disappear completely 
   color g_ (1.-i/20.)*M_clr 
 endfor 
 color g_ M_clr  

Color( M_rgb ) ⇒ S_colorNames

- returns sarray of color names approximating the rgb values in the matrix. The color names and definitions are taken from the icm.clr file. Example:


m = Matrix(3)
Color(m) # returns {"red","blue1","green"}

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 )
- returns rarray of three RGB components of the background color.


Interpolating colors by gradient


Color( r_value s_gradient [ r_from r_to ] ) - returns 3-element rarray with RGB components describing the color.

Color( R_N_values s_gradient [ r_from r_to ] ) - returns matrix with N rows and 3 columns where each row is the RGB representation of the interpolated color for the respective value in the R_N_values array.

Examples:


s = "red/lime/blue"
Color( 0.  s 0. 1. ) 
Color( 0.5 s 0. 1. )
Color( 1.0 s 0. 1. )
Color( 0.1 s 0. 1. )
Color( 0.8 s 0. 1. )
Color( {0.1 0.8} s 0. 1. )
Color( {1. 8.} s 0. 10. )

Color( 0.1 "red/lime/blue,0:1" )
Color( {0.1 0.8} "red/lime/blue,0:1" )
Color( {1. 8.} "red/lime/blue,0:10" )

Image color functions


Color( imageArray background )

returns sarray with background colors of the images in imageArray_.The color of the top left pixel of the image is returned as the background color currently.

See also: Image, image parray


Consensus


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 ( ms|rs )

surface accessible areas projected on the selected residues via linked sequence and alignment.



Corr


linear correlation function (Pearson's coefficient R )
Corr ( R_X, R_Y ) ⇒ r_correlation
- returns the real value of the linear correlation coefficient. Probability of the null hypothesis of zero correlation is stored in r_out .

Note: this function returns R , not R2 . Taking it to the 2nd power can be a humbling experience.
Examples:

 
 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.

Cos


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  


Cosh


hyperbolic cosine function.
Cosh ( { r_Angle | i_Angle } ) - returns the real value of hyperbolic cosine of its real or integer argument. Cos(x)=0.5( eiz + e-iz )
Cosh ( rarray ) - returns rarray of hyperbolic cosines of each component of the array.
Examples:
 
 show Cosh(1.)                           # 1.543081  
 show Cosh(1)                            # the same  
 
 show Cosh({-1., 0., 1.})                # returns {1.543081, 1., 1.543081}  


Count


function creates an iarray.
Count ( [ i_Min, ] i_Max ) - returns iarray of numbers growing from i_Min to i_Max. The default value of i_Min is 1.
Examples:
 
 show Count(-2,1)         # returns {-2,-1,0,1}  
 show Count(4)            # returns {1,2,3,4}  
See also the Iarray( ).
Count ( array )
- returns iarray of numbers growing from 1 to the number of elements in the array.

Count ( I|R|S_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
 #>-A-----------unique------identity---
    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


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

Date


Date( [i_nof] ) ⇒ e_currentDates

returns an date array of current system date and time.

Example:


print "Today is :" Date()

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_date|S_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:
formatdescription
%a or %AThe weekday name according to the current locale, in abbreviated form or the full name.
%b or %B or %hThe month name according to the current locale, in abbreviated form or the full name.
%cThe date and time representation for the current locale.
%CThe century number (0-99).
%d or %eThe day of month (1-31).
%DEquivalent to %m/%d/%y. (This is the American style date, very confusing to non-Americans, especially since %d/%m/%y is widely used in Europe.)
%HThe hour (0-23).
%IThe hour on a 12-hour clock (1-12).
%jThe day number in the year (1-366).
%mThe month number (1-12).
%MThe minute (0-59).
%nArbitrary whitespace.
%pThe locale’s equivalent of AM or PM. (Note: there may be none.)
%rThe 12-hour clock time (using the locale’s AM or PM). (%I:%M:%S %p)
%REquivalent to %H:%M.
%SThe second (0-60; 60 may occur for leap seconds; earlier also 61 was allowed).
%tArbitrary whitespace.
%TEquivalent to %H:%M:%S.
%UThe week number with Sunday the first day of the week (0-53). The first Sunday of January is the first day of week 1.
%wThe weekday number (0-6) with Sunday = 0.
%WThe week number with Monday the first day of the week (0-53). The first Monday of January is the first day of week 1.
%xThe date, using the locale’s date format.
%XThe time, using the locale’s time format.
%yThe year within century (0-99). When a century is not otherwise specified, values in the range 69-99 refer to years in the twentieth century (1969-1999); values in the range 00-68 refer to years in the twenty-first century (2000-2068).
%YThe year, including century (for example, 1991).

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


[ Decriptor ]

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 sub-alignment of rs_Fragment and seq_fromAli will be considered. The alignment must be linked to the object. With this function (see also Insertion function) one can easily and quickly visualize and/or extract all indels in the three-dimensional structure. The default i_addFlanks parameter is 1. String options:
See example coming with the Insertion( ) function description.

>>>Det{Det} h3-- Det
determinant function.
Det ( matrix )
- returns a real determinant of specified square matrix.
Examples:
 
 a=Rot({0. 0. 1.}, 30.)     # Z-rotation matrix by 30 degrees  
 print Det(a)               # naturally, it is equal to 1.  


Disgeo


Solves the so called "DIStance GEOmetry" problem (finding coordinates from a distance set). This function can be used to visualize in two or three dimensions a distribution of homologous sequences:
 
 group sequence se1 se2 se2 se4 mySeqs 
 align mySeqs 
 distMatr=Distances(mySeqs) 

or any objects between which one can somehow define pairwise distances. Since principal coordinates are sorted according to their contribution to the distances and we can hardly visualize distributions in more than three dimensions, the first two or three coordinates give the best representation of how the points are spread in n-1 dimensions. Another application is restoring atomic coordinates from pairwise distances taken from NMR experiments.
Disgeo ( matrix )
- returns matrix [1:n,1:n] where the each row consists of n-1 coordinates of point [i] sorted according to the eigenvalue (hence, their importance). The first two columns, therefore, contain the two most significant coordinates (say X and Y) for each of n points. The last number in each row is the eigenvalue [i]. If distances are Euclidean, all the eigenvalues are positive or equal to zero. The eigenvalue represents the "principal coordinate" or "dimension" and the actual value is a fraction of data variation due to the this particular dimension. Negative eigenvalues represent "non-Euclidean error" in the initial distances.
Example:
 
 read sequences s_icmhome+"zincFing"   # read sequences from the file, 
 list sequences              # see them, then ...  
 group sequence alZnFing     # group them, then ...  
 align alZnFing              # align them, then ...  
 a=Distance(alZnFing)        # a matrix of pairwise distances  
 n=Nof(a)                    # number of points  
 b=Disgeo(a)                 # calculate principal components  
 corMat=b[1:n,1:n-1]         # coordinate matrix [n,n-1] of n points  
 eigenV=b[1:n,n]             # vector with n sorted eigenvalues  
 xplot= corMat[1:n,1] 
 yplot= corMat[1:n,2] 
 plot xplot yplot CIRCLE display # call plot a 2D distribution  


Distance


[ Distance iarray | Distance rarray | Distance ~~as_ | Distance ~~as_ rarray | Distance matrix | Distance Tanimoto | Distance 2 matrices | Distance tether | Distance Dayhoff | Distance in alignment | Distance 2 alignments | Distance tree | Distance chemical ]

generic distance function. Calculates distances between two ICM-shell objects, bit-strings or molecular objects, or extracts distances from complex ICM-shell objects.

  Distance( <I><I> | <R><R> | <as> <as> | <seq> <seq> ) => <r_dist>
  Distance( <S|s>, <s>) => <R|r>
  Distance( <ali> <ali> [exact] ) => <r>
  Distance( <S> <S> [simple]) => M
  Distance( <Mnk> ) => <Mnn>
  Distance( <Mnk> <Mmk> ) => <Mnm>
  Distance( <M_xyz>|<as> <M_xyz>|<as> <r_dist> ) => <l_yes_if_closer_than_dist>
  Distance( <seq> <seq> [identity|evolution|new|fast|number|reverse] )
  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( <bitvecArr[n]> <bitvecArr[m]> ) => <M_nm> #tanimoto
  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>] [pharmacophore] ) => M_nxm_chemical_Tanimoto_distances
  Distance( <I_keys1> <I_keys2> <i_nBits>|<R_nbitWeights> [simple] ) => M : Tanimoto|weighted 
  Distance( <tree> [<i_at>=1] split ) => <r_splitLevel>
  Distance( <tree> all|modify ) => <R_splitLevels|splitLevelTStats>
  Distance( <g> wire|grid [<i_maxDist(1000000)>] ) => <M_shortestPaths>
See detailed descriptions below.

Distance between iarrays


Distance ( iarray1, iarray2 )
- returns the real sqrt of sum of (I1i -I2i )2 .

Distance between vectors


Distance ( R_X, R_Y ) - returns the real Cartesian distance between two vectors of the same length. D = Sum( ( Xi - Yi )2 )

Distance ~~as_


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_ rarray


Distance ( as_1 , as_2, rarray )

- returns the rarray of distances in Angstroms between the two specified selections containing the same number of atoms (1-1, 2-2, 3-3, ...).

See also: Distance ( as1 as2 all )

Distance matrix


Distance ( M_coor ) - returns the square matrix of distances between the rows of the input matrix M_coor. Each row contains m coordinates (3 in 3D space). For example: Distance(Xyz(a_//ca)) returns a square matrix of Ca-Ca distances.

Tanimoto distance between two arrays of bit-strings


Distance( X_chem_n X_chem_m ) ⇒ M_nxm_distances

Distance( I_keys1 I_keys2 nBits | R_nBitWeights [simple] ) ⇒ M_distances
- returns the matrix of Tanimoto distances between two arrays of bit-strings. Each array of N-strings is represented by an iarray I_keys of N*( nBits/32 ) elements (e.g. if nBits is 32 , each integer represents 1 bit-string, if nBits i 64, I_keys1 has two integers for each bit string, etc.). The returned matrix dimensions are N1 x N2 . The distance is defined as 1. - similarity , where The Tanimoto similarity between bitstrings is defined as follows: The number of the on-bits in-common between two strings divided by the number of the on-bits in either bit-string.
You can provide a relative weight for each bit in a bit-string as a rarray R_weights. In this case the weighted Tanimoto distance is calculated as follows:

 
  distWeighted = 1. - Sum( Wi_of_common_On_Bits ) / Sum( Wi_of_On_Bits ) 

With option simple the similarity calculation is modified so that the number of bits in common is divided by the number of bits in the second bit-string. For example:
 
Distance({3} {1} 32 simple ) # returns 0. 
Distance({1} {3} 32 simple ) # returns 0.5 

Example:
 
Distance({1 2 3},{1 2 3},32) 
 #>M 
 0. 1. 0.5 
 1. 0. 0.5 
 0.5 0.5 0. 
The diagonal distances are 0; no bits are share between 1 (100..) and 2 (010..) (distance=1.) and one of two bits is shared between 1 (100..) and 3 (110..).
Instead of the number of bits, one can provide the relative weights for each bit. The dimension of the bit-weight array then becomes the size of the bit-string. The weighted Tanimoto is calculated.

See also:


Distance matrix between two sets of coordinates


Distance ( M_coor1 M_coor2 ) - returns the matrix of distances between the rows of the two input matrices. Each matrix row may contain any number of coordinates coordinates (3 in 3D space).
For example: Distance(Xyz(a_/1:5/ca) Xyz(a_/10:12/ca) returns a 5 by 3 matrix of distances between Ca-s of the two fragments.

Distance( M_xyz1|as1 M_xyz2|as2 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.
if Distance ( as1 as2 r_dist ) then ...

is a more efficient version of this condition:

if Nof( Sphere( as1 as2 r_dist )) > 0

Distance tether


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:
 
read pdb "1crn" 
convert tether # keeps tethers to the pdb original 
deviations = Distance( a_//!h*,vt* , 9.9)  
perResDevs = Group( deviations, a_//!h*,vt* ,"max") # find max.devs per residue 
display ribbon 
color ribbon a_/* perResDevs 
 
# Another example  
 Distance( a_//T ) # selects only tethered atoms 
 #>R 
   1.677 
   1.493 
   1.386 
   1.435 
   1.645 
   1.570 
   2.165 
   1.399 

Distance Dayhoff


Distance( seq1 seq2 [identity|evolution|new|fast|number|reverse] ) ⇒ r

Distance( seqArr[n] seq ) ⇒ R_n

- returns the real measure of similarity between two aligned sequences. Zero distance means 100% identity. The distance is calculated by the following two steps:

  1. d1 = 1.0 - (nResidueIdentities/Min(Length(Seq1), Length(Seq2)) (d1 belongs to [0.,1.] range)
  2. if there is no identity option the distance is corrected: Distance(Seq1,Seq2) = DayhoffTransformation( d1 )

Transformation practically does not change small distances d1, whereas large distances, especially above 0.9 (10% sequence identity) are increased to take occasional reversals into account. Distances d1 within [0.9,1.0] are transformed to [5.17, 10.] range.

Distance between sequences or alignment sequences


Distance ( alignment )

Distance( seqArr[n] ) ⇒ M_nn

Distance( seqArr[n] seqArr[m] ) ⇒ M_nm

- returns matrix of pairwise sequence-sequence distances in the alignment. These distances are calculated with the fast option as follows

 
 1.-(nResidueIdentities-gapPenalty)/Min(Length(Seq1), Length(Seq2)) 
where gapPenalty is 3 for each gap.
Without the fast option the distances are calculated based on comparison matrix and gap penalties. These distances are more sensitive but there is no simple mapping between them and percent identity based distances.
Example:
 
 read alignment msf s_icmhome+"azurins"            # read azurins.msf  
 NormCoord = Disgeo(Distance(azurins))   # 2D sequence diversity in  

Distance between two alignments


Distance ( ali_1 ali_2 [ exact ] )

- returns the real distance between two alignments formed by the same sequences.
The distance is defined as a number of non-gap columns identical between two alignments.
Two different normalizations are available:
The default normalization is to the shorter alignment. ( Distance ( ali_1 ali_2 ) ). In this case the number of equivalent pairs is calculated and is divided by the total number of aligned pairs in the shorter alignment. This method detects alignment shifts but does not penalize un-alignment of previously aligned residue pairs. D = (La_min - N_commonPairs)/La_min In the following alignment the residue pairs which are aligned in both alignments are the same, therefore the distance is 0.

 
 show a1   # La1 = 3 
 ABC---XYZ 
 ABCDEF--- 
 show a2   # La2 = 6 
 ABCXYZ 
 ABCDEF 
 Distance(a1,a2)   # a1 is a sub-alignment 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   

The distance of the cluster splitting level


Distance( treeArr i_at separator )

- return the current value of the cluster splitting level set by split command.

Chemical similarity distance


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 ph4-type 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 ph4-type triplets.

Example:


Distance( Chemical({ "CCC", "CCO"}) Chemical("CC" ))

Zero distance for non-identical compounds.Sometimes non-identical 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


Eigen


eigenvalues/eigenvectors function.
Eigen ( M )
- 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.
Example:

 
 A = Matrix(3, 3, 0.)      # create a zero square matrix... 
 A[1:3,1] = {1.,-2.,-1.}   # and set its elements 
 A[2,2] =  4. 
 for i = 1, 3-1            # the matrix must be symmetric 
   for j = i+1, 3 
     A[i,j] = A[j,i] 
   endfor 
 endfor 
 X = Eigen(A)              # calculate eigenvectors... 
 V = R_out                 # and save eigenvalues in rarray V 
 printf "eigenvalue 1 eigenvalue 2 eigenvalue 3\n" 
 printf "%12.3f %12.3f %12.3f\n", V[1], V[2], V[3] 
 printf "eigenvector1 eigenvector2 eigenvector3\n" 
 for i = 1, 3 
   printf "%12.3f %12.3f %12.3f\n", X[i,1], X[i,2], X[i,3] 
 endfor 


Energy


function.
Energy ( string )
- returns the real sum of pre-calculated 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:
Examples:
 
 read object s_icmhome+"dcLoop.ob"
 show energy 
 print Energy("vw,14,hb,el,to")  # ECEPP energy  
 
 read stack s_icmhome+"dcLoop.cnf" 
 load conf 0 
 print Energy("func")  # extract the best energy without recalculating it 

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. Use unfix only V_//S to restore standard fixation.
This function can be used to evaluate normalized residue energies for standard amino-acids 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.
This function will calculate residue energies for all terms and set-ups with the following exceptions:
The s_energyTerms argument allows 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  


Error


function indicates that the previous ICM-shell 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 )
- returns string with the last error message. It also returns integer code of the last error in your script in i_out . In contrast to the logical Error() function, here the internal error code is not reinstalled to 0, so that you can use it in expressions like if( Error ) print Error(string) .
Error ( i_error_or_warning_code ) ⇒ l Error ( number ) ⇒ s - returns logical yes if an error or warning with the specified code occurred previously in the script. This call also resets the flag (e.g. Error(415) ). This is convenient to track down certain warnings or errors in scripts (e.g. detecting if 'readpdb{read pdb} found certain problems).
Option number will return a string will previously set error and warning messages.
To clear all bits use the clear error command.

Examples:

 
 read pdb "1mng"  # this file contains strange 28-th residue  
 if (Error) print "These alternative positions will kill me" 
 
 read pdb "1abcd"  # file does not exist 
 read pdb "1mok" 
 clear error 
See 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(-t2) 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 (for SOAP messages)


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.



Exist


[ Exist-pattern | Exist molcart ]

function indicates if an ICM-entity exists or not.
Exist ( s_fileName [ write | read | directory ] ) - returns logical yes if the specified file or directory exists, no otherwise. Options:

Exist ( key, s_keyName ) - returns logical yes if the specified keystroke has been previously defined. Examples: Exist(key, "F1" , Exist( key, "Ctrl-B" ) See also: set key command.
Exist ( object ) - returns logical yes if there is at least one molecular object in the shell, no otherwise.
Exist ( os1 stack ) - returns logical yes if there is a built-in object stack , no otherwise.
Exist ( box ) - returns logical yes if the purple boxis displayed, no otherwise.
Exist ( view ) - returns logical yes if the GL - graphics window is activated, no otherwise.
Exist ( gui ) - returns logical yes if the GRAPHICS USER INTERFACE menus is activated, no otherwise.

Exist ( grob display ) - returns logical yes if the grob is displayed.
Exist( connect ) - returns logical yes if the mouse rotations are connected to a graphical object ( grob ) or a molecular object.

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( ). E.g.


 Exist(variable, "aaa")  # returns no
 aaa=234
 Exist(variable, "aaa")  # returns yes
Examples:
 
 if (!Exist("/data/pdb/") then 
   unix mkdir /data/pdb 
 endif 
 
 if(!Exist(key,"Ctrl-B")) set key "Ctrl-B" "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

Database information


Exist( s_dbtable sql table )

- returns logical yes if the specified table exists in the database

See also: molcart

Existenv


function indicating if an UNIX-shell 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( ) .

Extension


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]   


Exp


exponential mathematical function (ex).
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


[ 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,":")  # colon 
Alternative characters can be specified sequentially, e.g.
 
 Field("a%b:c",3,"%:")  # percent OR colon 
Multiple 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 colons 
You can combine a single-character 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( ).

User field from a selection


Field( as|rs|ms|os [s_fieldName] )
Field( { rs | ms | os } [ i_fieldNumber ] )

Field( os 15 )


returns rarray of user-defined field values of a selection. Some fields are filled upon reading a pdb file
Atoms. Only one user defined field can be set to atoms, e.g.

 
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 
color a_/* Field( a_/A  2 )                       # color by it 

Standard fields:


See also:

File


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 cross-platform 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:

  1. type character:
    • 'f' - regular file
    • 'd' - directory
    • 'l' - symbolic link
    • 'c' - character special file
    • 'p' - pipe
  2. 'r' if you can read the file (or from the directory)
  3. 'w' if you can write to this file (or directory)
  4. 'x' if you can execute this file (or cd to this directory)
  5. file size in bytes
To get a string with any field use Field(File( s_name), i_fieldNumber) . To get the size, use Integer(Field(File( s_name),5)).
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 icm-shell 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


[ 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 closest value in array


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 text in tables.


Find ( table s_searchWords )
- returns table containing the entries matching all the words given in the s_searchWords string.
If s_searchWords is "word1 word2" and table contains arrays a and b this "all text search" is equivalent to the expression :

 
 (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 "two|three" regexp )  # matches last two rows

Find chemical substructures.


[ Find-seq ]

Find( mol_array, array_of_chemical_patterns S_labels )

Find( mol_array, table_with_chemical_patterns )

returns a 'sarray of chemical-pattern 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:

The patterns can be specified using the wild cards permitted by the Molsoft chemical editor.

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

: Find( sequence )

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.



Floor


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 .
See also: Ceil( ).

Formula


Formula( chem-array )

- returns the sarray of compounds' molecular formulas.


Getarg


function returning the value for an argument to ICM or an icm-script. 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

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 icm-script 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( list [delete] )

returns sarray of non-option arguments (usually they are file names).

Getarg( name )

returns sarray of arugment names

Getarg( set )

returns sarray of arugment values

Getarg( delete )

deletes all arguments and returns the number of them

Testing if the argument exists Getarg( s_argName [find|test] )

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 .

Getenv


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") # error 
See also: Existenv( ), Putenv( ) .

Gradient


function.
Gradient( )
- returns the real value of the root-mean-square gradient over free internal variables.
Gradient ( vs_var )
- returns the rarray of pre-calculated energy derivatives with respect to specified variables.
Gradient ( as | rs )
- returns the rarray of pre-calculated energy derivatives with respect to atom positions (G[i] = Sqrt(Gxi*Gxi+Gyi*Gyi+Gzi*Gzi))
The function returns atom-gradients 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 pre-calculated by one of the following commands: show energy, show gradient, minimize .


Example:

 
 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  


Grob


[ Grob-select-by-color ]

function to generate graphics objects.
Grob ( "arrow", { R_3 | R_6 } )
- returns grob containing 3D wire arrow between either 0.,0.,0. and R_3, or between R_6[1:3] and R_6[4:6].
Grob ( "ARROW", { R_3 | R_6 } )
- returns grob containing 3D solid arrow. You may specify the number of faces by adding integer to the string: e.g. "ARROW15" (rugged arrow) or "ARROW200" (smooth arrow).
See also: GROB.relArrowSize.
Examples:
 
 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 Alt-X, Alt-Q and Alt-W 
 display g red   

Grob ( "torus", r_radius r_radius2 [i_quality] ) - returns grob containing a solid torus.

Grob ( "ellipsoid", r_radius r_radius2 [i_quality] ) - returns grob containing a solid ellipsoid.

Grob ( "cylinder", r_radius r_height [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


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 6-dim. 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 function


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
returns an array of atoms properties aggregated to a per-residue array. One of the following functions can be applied to the atomic values:

The function name is case-insensitive (you may use "Min" or "MIN").
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


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 .


Histogram


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 mid-points 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


[ 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( R|S|I ) ⇒ 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( rs|ms|os ) ⇒ I_nAtomsInEachRes|Mol|Obj


Creating or converting into an iarray


Iarray ( i_NumberOfElements [ i_value ] )
- returns iarray of i_NumberOfElements elements set to i_value or zero. You can also create an zero-size 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}  

Reversing the order of elements in an integer array.


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)

Generating a compressed integer bit vector for Tanimoto calculations.


Iarray( I_nBitVector key ) - returns a shorter vector of integers if n/32 elements, in which every 32 array values of zeros and non-zeroes 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:


Iarray( ~~as_ ): relative atom numbers of a selection


- 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 

Iarray( [as_|rs_] number ): residue numbers of a selection


- 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 ): numbers of visits for all stack conformations


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 } 


IcmSequence


creates a "sequence" for an ICM molecular object. Output is in icm.se -file format.
IcmSequence ( { sequence | string | rs }, [ s_N-Term, s_C-Term ] )
- returns multiline string with full (3-char.) 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 one-letter coding:
If the source of the icm-sequence is a 3D object, the proline ring puckering is analyzed and residue name prou is returned for the up-prolines (the default is pro ).
The N-terminal and C-terminal 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 C-terminal residue:
 
IcmSequence( a_/* ) # C-terminal 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 mol-sequence file and further edited for unusual amino-acids (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 chains  
In the last command the ampersend means that the C-terminal 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 10-res. peptides 

See also icm.se for a detailed description of the ICM-sequence file format.

Image


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:

methoddescription
"fast" the fastest method, has the lowest quality of scaling
"bilinear" usually about 1.5-2x times slower than "fast" but produces images of higher quality
"glu" driver-dependent, requires the graphics to be enabled, may have limitations on evenness of requested dimensions. The quality is usually high, the speed depends on driver implementation.

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") )

See also: image parray, Sum image, Color image


Index


[ Index chemical | Index string | Index regexp | Index table selection | Index table label | Index unique elements | Index element in array | Index tree ]

family of functions. It returns either an integer or an integer array of indices in an array or a table.

Index of compounds in chemarray with matching chemical patterns.


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
 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 of a substring.


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 positions  
Another 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 sp-1 
endwhile 

Index of an expression or an array of expressions


Index ( s_source|S_N_source, { s_pattern| S_N_patterns }, exact | simple | regexp )

Options:


Index numbers of selected table rows


Index ( T_tableExpression_orSelection ) ⇒ I_matchingRows

Index ( T_table_with_graphical_selection_or_rows selection ) ⇒ I_matchingRows
- returns an integer array of order numbers (indices) of rows selected by the table expression. Example in which we find which value of column B corresponds to a value in column A:

 
   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 numbers of labeled table rows


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

Indexes of unique elements in an array


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 numbers of selected table rows


Index ( S_data, s_value ) ⇒ i_FirstMatchingElement

Index ( I_data, i_value ) ⇒ i_FirstMatchingElement #: Index ( , ) => i_FirstMatchingElement
- returns integer value indicating the first array element number exactly matching the value string or real, or 0 otherwise. To return an array of matches in an array, use the all option (see below).
Examples:

 
 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  

Index ( S_data, s_value all ) ⇒ I_matchPositions

Index ( I_data, i_value all ) ⇒ I_matchPositions
- returns iarray listing all positions where the value was encountered.

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 ( object )
- returns integer value of sequential number of the current object in the molecular object list, or 0 if no objects loaded. (Note that here object is used as a keyword.)
Examples:

 
 l_commands = no 
 read pdb "1crn" 
 read object s_icmhome+"crn" 
 printf "The object a_crn. is the %d-nd, while ...\n", Index(object) 
 set object a_1. 
 printf "the object a_1crn. is the %d-st.\n", Index(object) 

Cluster selection and centers


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

Indexx


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 meta-characters 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  


Insertion


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 sub-alignment 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 three-dimensional structure. The default i_addFlanks parameter is 0.
String options:
Examples:
 
 read pdb "1phc.a/"   # read the first molecule form this pdb-file 
 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( )         # on-line 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 


Info


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 [map|mmff] )

- 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.

Image details


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.


Integer


function converting to integer type.
Integer ( l_value )
- returns 0 or 1.

Integer ( r_toBeRounded )
- returns the integer nearest to real r_toBeRounded in the direction of the prevailing rounding mode magnitude of the real argument.
Integer ( string ) - converts string into integer, ignores irrelevant tail. see also Tointeger Reports error if conversion is impossible.
Examples:

 
 show Integer(2.2), Integer(-3.1)      # 2 and -3  
 jj=Integer("256aaa")                  # jj will be equal to 256  

See also: Iarray( ), Tointeger( )



Integral


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.
Integral ( R r_xIncrement )

- 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

E.g. Integral({2.,4.,2.},1.) will return 0.,3.,6., while Integral({2.,4.,2.}) will return partial sums 2.,6.,8.
Integral ( R_Y R_X )

- calculates the integral rarray of the function represented by R_Y on the set of abscissa values R_X.
Examples:

 
# 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 increment  
Let us integrate 3*x2-1, determined on the rarray of unevenly spaced x. The expected integral function is x3-x
    
 x=Rarray(100 ,-.9999, .9999 ) 
 x=x*x*x 
 plot display x Integral((3*x*x-1.) x) cross 


Interrupt


function.
Interrupt
- returns logical yes if ICM-interrupt (Ctrl-Backslash, ^\) has been received by the program. Useful in scripts and macros.
Examples:
 
 if (Error | Interrupt) return 


Label


function returning a molecular/grob label string.
Label ( g ) ⇒ s - returns the string label of the grob. See also: set grob s_label .
Label ( rs )
- returns sarray of residue labels of the selected residues rs_ composed according to the resLabelStyle preference , e.g. { "Ala 13","Gly 14"}
See also: Name function (returns residue names), and Sarray( rs [append|name|residue]) function returning selection strings.
Label ( os_objects )
- returns sarray of long names of selected objects.
See also: Name function which returns the regular object names and the most detailed chemical names of compounds.
Label ( vs_var )
- returns sarray of labels of selected variables.
Examples:
 
 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


Laplacian operator


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 xi

Length


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 ( seqarray )

- returns iarray with lengths of sequence parray elements.

Length ( {iarray | rarray } )
- returns the real vector length (distance from the origin for a specified vector Sqrt(Sum(I[i]*I[i])) or Sqrt(Sum(R[i]*R[i])), respectively).
Examples:

 
 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



LinearFit


the linear regression function.
LinearFit( R_X , R_Y , [ R_Errors] )
- returns a 4-element 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:
Wi = 1/R_Errorsi 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 Yi , i=1:n values and several parameters Xi,j (i=1:n,j=1:m) potentially correlating with Yi 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 ( Y2 = Y - X*W ) and redo the calculation to find W2 , etc. A proper way of doing it, however, is to calculate the eigenvalues of the covariance matrix.

LinearModel


LinearModel( T_weights )

creates a linear regression prediction-model 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


Log


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



Map


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( ) function
Examples:

 
 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 m2 
See also : make grob map to generate contour around a particular selection

Mass


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


Moment( as_nObj|X_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:

Note: for a linear molecule, the third component of the moment of inertia will be zero.

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


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)

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


[ Matrix new | Matrix sub | Matrix symmetrical | Matrix residue comparison | Matrix table | Matrix tensor | Matrix residue areas | Matrix alignment | Matrix boundary | Matrix stack | Matrix histogram | Matrix grob connectivity ]

function.

Matrix : create new matrix.


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_n_diagonal ] )

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( rarray [ n ] ) - converts vector[1:n] to one-row matrix[1:1,1:n]. If you provide a positive integer argument, the input rarray will be divided into rows of length n. If the argument is negative, it will be split into columns of length n. Examples,

 
 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>  non-matching dimension [4] and vector size [6] 

Matrix : extract a sub-matrix


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 symmetrization, extraction of left and right triangles.


Matrix( M_square { left | right } ) - generate a symmetrical 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 of residue substitution values.


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 

Converting table columns into matrix


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 resulting from a tensor product fo two vectors.


Matrix( R_A R_B )
- returns tensor product of two vectors or arbitrary dimensions: M_ij = R_A[i]*R_B[j]
Examples:

 
 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 of residue-residue contacts


Matrix ( rs_1 rs_2 )

- returns matrix of contact areas. See also: Cad, Area .

Matrix of inter-sequence distances


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 ( ali, number ) - returns a matrix of alignment. It contains reference residue numbers for each sequence in the alignment, or -1 for the gaps. The first residue has the reference number of 0 (make sure to add 1 to access it from the shell).

Matrix from the electrostatic boundary element calculation


Matrix ( boundary ) - returns values generated by the make boundary command for each atom.

Matrix of distances between the stack conformations


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 containing a histogram


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. 

Connectivity Matrix for Grob Vertices


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:



Max


[ Max image graphic ]

maximum-value function.
Max ( { rarray | map } )
- returns the real maximum-value element of a specified object
Max ( iarray ) - returns the integer maximum-value element of the iarray.

Max ( R1_n R2_n ) ⇒ R_max_n - returns the rarray of maximal values.
Max ( index { iarray | rarray } ) - returns the integer index of the maximum-value element of the array (or one of them if many).

Max ( clsuterObject ) - returns 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 4
see also Min(.. ) and the group .. command.
Max ( matrix ) - returns the rarray of maximum-value 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.


Max ( integer1, integer2, ... ) - returns the largest integer argument.
Max ( real1, real2, ... ) - returns the largest real argument.
Max ( S s_leadingString ) returns the maximal trailing number in array elements consisting of the s_leadingString and a number. If there are no numbers, returns 0. E.g. Max({"a1","a3","a5"},"a") returns 5.
Max( *grob | *macro | *sequence | *alignment | *profile | *table | *map )
returns the maximal number of shell objects of the specified class. To increase this shell limit, modify the icm.cfg file.
Max ( grob s_leadingString ) returns the maximal number appended to grob names:

 
  g_skin_1 
  g_skin_2 
This function is equivalent to Max( Name(grob), s_leadingString ) (see the previous function).

Examples:
 
 show Max({2. 4. 7. 4.})          # 7. will be shown  


Recommended setting for GRAPHICS.quality in images


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)

MaxHKL


an array of three maximal crystallographic h,k,l indices at a given resolution.
MaxHKL( { map | os | [ R_6CellParameters ] }, r_minResolution ) ⇒ I3
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 .



Mean


average-value function.
Mean ( { rarray | map } )
- returns the real average-value of elements of the specified ICM-shell objects.
Mean ( iarray )
- returns the real average-value of the elements of the iarray.
Mean ( matrix )
- returns rarray [1:m] of average values for each i-th 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 


Min


minimum-value function.
Min ( { rarray | map } ) - returns the real minimum value element of a specified object
Min ( index { iarray | rarray } ) - returns the integer index of the minimum-value 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 4
see also Max(.. ) and the group .. command.

Min ( iarray ) - returns the integer minimum-value element of the iarray.

Min ( R1_n R2_n ) ⇒ R_min_n - returns the rarray of minimum values.
Min ( matrix ) - returns the rarray of minimum-value element of each column of the matrix. To find the minimum value use the function twice (e.g. Min(Min(m)) )

Min ( matrix_nm matrix_nm ) ⇒ M_min_nm - returns the matrix with the smaller values of the two input matrices of the same dimensions.


Min ( integer1, integer2 ... ) - returns the smallest integer argument.
Min ( real1, real2, ... ) - returns the smallest real argument.
Examples:

 
 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


Money


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"  


Mod


remainder (module) function. Similar to, but different from Remainder() function:
functiondescriptionexample
Mod(x,y)brings x to [0 , y] rangeMod(17.,10.) => 7.
Remainder(x,y)brings x to [-y/2 , y/2] rangeRemainder(17.,10.)=> -3.

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 


Mol


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 up-to-date version of this function is String( X )
Examples:

 
 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


[ Name chemical property | Name soap | Name close sequence | Name string | Name tree | Name chemical | Name sequence | Name object parray | Name image | Name molcart ]

generic function returning strings or string arrays with names of things.
Name ( ) - returns empty string.
Name ( s_Path_and_Name ) - returns file name sub- string if full path is specified
Name( s_hint [ simple | unique | object ] ) Opions: Examples:
 
  Name( " %^23 a 2,3 xreno-77-butadien" simple)     
 23_a_2_3_xreno_77_butadien 
 
  a=1 
  Name("a",unique) 
 a1 
Unique 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: html-objects and scripts Name( string [ html | command ] ) returns the list of html documents or scripts in ICM shell
Name ( { iarray | rarray | sarray | matrix | map | grob | alignment | table | profile | sequence | chemical | reaction | slide | model | tree } selection ) - returns a string array of names of selected objects for the specified class.
Name ( as ) - returns sarray of names of selected atoms.

Name ( as|rs|ms|os field ) - returns sarray of unique names of assigned tags (fields), see also set field name .
Name ( as sequence ) - returns sarray of chemical names of the selected atoms according to the icm.cod file (one-letter chemical atom names are low case, e.g. "c", two-letter names start from an upper-case letter, like "Ca"). The names from the periodic table are used in the wrGaussian macro.
Name ( rs ) - returns sarray of names of selected residues. To obtain a one-letter code sequence, use Sequence( rs_ ) and to convert it to a string use String( Sequence( rs_ )) .
Name ( ms ) - returns sarray of names of selected molecules.

Name ( chem_array ) - returns sarray of names of chemicals in an array ( see also )
Name ( ms sequence ) - returns sarray of names of sequence linked to the specified molecules ms_ or empty strings.
Name ( ms alignment ) - returns sarray of names of alignments linked to the specified molecules ms_ or empty strings
Name ( ms swiss ) - returns sarray of names of swissprot names corresponding to the specified molecules ms_ or empty strings . See also the set swiss command.
Name( os ) - returns sarray of names of selected objects. E.g. Name( a_ )[1] returns string with the name of the current object.
Name ( vs ) - returns sarray of names of selected variables.
Name ( alignment ) - returns sarray of constituent sequence names.
Name ( table ) - returns sarray or constituent table ICM-shell object names.
Name ( sequence ) - returns string name of specified sequence.

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( gui {html|table|alignment} )

- returns sarray of shell objects in the order of their tabs appear in the GUI. Notice that the order of tabs corresponding to html-documents, tables or alignments can be changed with drag and drop. It will lead to a different order retuned by the Name function.

Name( foreground {html|table|alignment|slide} ) -returns name of the currently active object 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 ) function


Name( chemical property )

- returns sarray of names of loaded predictive models (e.g. "MolLogP") for chemicals.

List name of the fields in SOAP struct object


Name( soapStruct )

See SOAP services for further information.

Find the name of the closest sequence in an alignment


Name( ali seq ) ⇒ s_nameOfTheClosestSequence

Example:


read alignment s_icmhome+"sh3" # alignment
readUniprotWeb "FYN_HUMAN" 
Name(sh3,FYN_HUMAN) # returns "Fyn"

Name( string .. ) function


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( tree .. ) function


Name( tree-parray i_parrayIndex [index|label|matrix|sort|split] ) - returns string names of different properties of the tree cluster object. The following names can be returned:

Names of chemicals


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

Names of sequences


Name( seqarray )

- returns sarray with stored names of sequence parray elements

See also: set name sequence

Names of objects in array


Name( objectArray )

- returns sarray with names of objects in the objectArray_

See also: object parray

Names of images


Name( imageArray )

- returns sarray with names of images

See also: image parray

Information from databases


Name( sql )

- returns current database connectionID string, which can be used as the connect= option with almost all Molcart commands to specify the connection. See also molcart connection options

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


[ Namex sequence | Namex image ]

comment (or description) function.
Namex ( os )
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")  

Sequence comments


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] ) 

Image comments


Namex ( imageArray ) - returns sarray with comments associated with images

See also: image parray, Name image .



Next


[ Next covalent neighbors ]

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  

Covalent neighbors of an atom


Next ( as { bond | tree } ) - selects atoms forming covalent bonds with the selected single atom. Option tree allows to select only atoms above a given atom in an icm-tree.

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


[ Nof tree | Nof chemical | Nof distance | Nof library | Nof molcart | Nof latent | Nof soap ]

Number-OF-elements function.
Nof ( className )

- 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 two-level 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 ( hbondChunkArray|distChunkArray 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 ( matrix ) - returns integer number of rows in a matrix (see also Length( matrix) function which returns number of columns).
Nof ( table ) - returns integer number of number of rows in a table

Nof ( map ) - returns integer number of grid points in a map.
Nof ( grob ) - returns integer number of points in graphics object.
Nof( { os | ms | rs | as | vs } ) - returns integer number of selected objects, molecules, residues, atoms or variables respectively.

Nof( { as on|off ) - returns integer number of atoms that are hidden ( off ) or present ( on ). See also set as on | off .

Nof ( { atoms | residues | molecules | objects | conf | stack | tether | vrestraint } ) - returns the total integer number things.


Nof ( library ) - returns 1 if the force field parameter library is loaded and 0 otherwise.
Nof ( library ) - returns 1 if the mmff library is loaded and 0 otherwise.
Nof ( plane ) - returns the number of active graphical planes
Nof ( site [ ms | seq ] ) - returns integer number of sites in the selected molecule or the current object or sequences.

Nof ( os1 stack ) - returns integer number of conformations in a built-in stack of a specified object.
Nof ( { s_stackFileName | s_objFileName } ) - returns integer number of conformations in a specified file
Example:

 
 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 ICM-shell variables. This selection does not work the following types: aselection, vselection, string , object .
Examples:

 
 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 ( {table|alignment|grob} display )

- returns integer number of displayed ICM-shell variables.


Nof( grob display )   # number of meshes displayed in 3D
Nof( table display )  # number of spreadsheets visible in GUI

Counting clusters


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

Counting various properties/patterns in chemical arrays.


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 [ 1|2|3 ] ) - returns the number of chiral or racemic centers as follows:

Example: add column t Nof(t.mol chiral 3) "nRacemicCenters"

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

Counting number of atom pairs, triples and quadruplets in distance objects


Nof( distobject distance )

counts number of records in the distance parrays created by the following commands.

The full information can be exported into a table with the Table(.. distance) function.

Example:


read pdb "1crn"
convertObject a_ yes yes no no
make hbond  name="hbonds_crn"
show Nof( hbonds_crn ) # counts distances

Counting chemical combinatorial library sizes.


Nof( scaffold library ) - returns the total library size

Nof( scaffold group ) - returns iarray of substituent R-group array sizes

See also: link group , chemical , Chemical .

Database information


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

Number of latent vectors of the PLS model


Nof( PLS_model i_num - returns number of latent vectors of the PLS model

See also: learn predict

Number of elements in the soap object


Nof( soapObject ) - counts numbers of element in complex SOAP object (array or structure)

See SOAP services for information.


Norm of a vector


returns different norms of a vector, e.g. its euclidian 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 case-insensitive):

Examples:


  Norm ( {3., 4.}, "euclidean" )
  Norm ( {1. 3. 3. 6. 3. 4. 5.7 7.}, "RMSD" ) # case insensitive

See also: Normalize


Normalize


normalize vectors or real arrays according to different transformations.
Normalize ( R_vector s_type ) - returns the normalized rarray (i.e. the input vector) by dividing each vector element by its norm (see the s_type definitions in the Norm () function. Note that this form of normalization is NOT suitable for elements of a column in a table. To standardize data in a table column and remove outliers use Trim

Normalize ( matrix ) - returns the matrix linearly transformed into the [0.,1.] range.

The following would hold true for any valid s_type and vector v with non-zero norm:


  Norm( Normalize( v, s_type ) s_type ) == 1.

Examples:


  2.*Normalize ( {3., 4.}, "euclidean" )  #make euclidean length 2.

See also: Norm


NotInList


NotInList ( S_list S_testedItems )

returns sarray of S_testedItems elements which are not in the first list. Example:


NotInList({"cc","aa","bb"} {"aa","dd","ee"}) # returns {"dd","ee"}

Obj


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 water  
See also: Atom, Res, Mol .

Occupancy


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 Ca-atoms  
 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 


Path


function.
Path ( ) - returns the working directory (same as Path(directory).

Path ( s_FullFileName ) - returns header sub- string with the path.
Path ( s_FullFileName full ) - returns the full file name including absolute directory, and the filename with extension
Examples:

 
 sPath=Path("/usr/mitnick/hacker.loot") # returns "/usr/mitnick/"  
 Path("~/.cshrc" full )
 /home/crepe/.cshrc
See 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 "/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 )
- returns a path to the ICM executable. ICM binary can also be found in the Version(full) string.

Versions before 3.5-2 used Path(unix) syntax.
Path ( directory )
- returns the current working directory.
Path ( last )
- returns the path of the last icm-shell script called by ICM.

Path ( preference )
( obsolete Note, that the current version of ICM stores user preferences in the ~/.config/Molsoft.con file under Linux.)

returns the path to the directory in which the user preferences file "icm.ini" is stored. This file is always stored in the s_icmhome , but a user can save his or her own preferences in the s_userDir/config/icm.ini file.
Example:

 
read all Path(preference)+"icm.ini" # restore the settings 


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/" 

Parray


function containing an array of chemical compounds. These compounds can be read from the mol/sdf files into binary chemical representation stored in ICM chem-tables.
Parray ( s_smiles smiles )

Parray ( s_molFileText mol )

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 ) - returns a sequence parray containing all sequences loaded into ICM

Parray ( sequence|object 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 


Pattern


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 ICM-consensus 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



Pi


function (or rather a reserved name).
Pi - returns the real value of Pi ( 3.14...).
Examples:
 
 print Pi/2. 


Potential


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"  


Power


mathematical function.
Power ( r_base, { r_exp | i_exp} ) - returns real r_baser_exp or r_basei_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, R_exp ) - returns rarray with R_exp powers of the according R_base elements. Input arrays should have the same size.

Power ( r_base, M_exp ) - returns matrix of the r_base taken to the M_exp powers.
Example:

 
 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 n-th 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 right-hand 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)      # a-matrix to the third is  
                            # three consecutive rotations  

See also: Log


Predict


Predict( chem_array )

returns table with six chemical properties by default (without the model name):

Predict( chem_array s_property|model )

returns rarray with the following properties : "DrugLikeness","MoldHf","MolLogP","MolLogS","MolPSA","Volume" 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
#>-DrugLikeness-MoldHf------MolLogP-----MolLogS-----MolPSA------Volume-----
   -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

Probability


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 L-Length( 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 are given in the description of the Score function. Each score has a different distribution which was carefully derived from all-to-all comparisons of sequence of protein domains.
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 color-code the regions of insignificant sequence-structure 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 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= 1-exp(-exp(-Lambda*Sum(score in window)/K)), where Lambda and K are coefficients depending on the residue comparison matrix.
This example allows 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 P-value) 
 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 


Profile


function.
Profile ( alignment ) - creates profile from an alignment

Property


Property ( grob option ) - returns various advanced grob properties as logical.

Available options:


See also set property

Putarg


Putarg( s_name s_value )

- adds a name-value pair to the list of ICM arguments. Returns no in case of error.

See Getarg .


Putenv


function to change or add value to environment.

Putenv ( " s_environmentName = s_environmentValue " )

-returns a logical yes if the named shell-environment variable is created or modified.
Putenv ( )

- function to push the icm or icm-script 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.


Examples:

 
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.



Radius


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 surface ) - returns the rarray of the 'hydration' atomic radii.
These radii are used in construction of the solvent-accessible (surface) and can be found (and possibly redefined) in the icm.hdt file.
Radius ( as charge ) - returns the rarray of the 'electrostatic' atomic radii.
These radii are used for building the skin (analytical molecular surface) for electrostatic dielectric boundary calculation with electroMethod = "boundary element". These parameters can be found (and possibly redefined) in the icm.vwt file.

Random


[ Random string ]

evenly distributed random function.
Random ( ) - returns a pseudo-random real in the range from 0. to 1.
Random ( i_max ) - returns a pseudo-random integer distributed in [1, i_max ]
Random ( i_min , i_max ) - returns a pseudo-random integer distributed in [ i_min , i_max ]
Random ( r_min , r_max ) - returns a pseudo-random real evenly distributed in [ r_min , r_max ]
Random ( r_min , r_max , i_n ) - returns a rarray [1: i_n ] with pseudo-random 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 pseudo-random 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 pseudo-random 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 pseudo-random 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 3-vector 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 strings


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: "A-Z", "\\w", "\\dA-Fa-f", "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) "\\dA-Z" ) # returns 10-element sarray with 20-character strings containing random digits and capital letters
Random( 100, {"rock","paper","scissors"} ) # returns 100-element sarray consisting of words "rock", "paper" and "scissors" in random order
Random( 100, Random( Iarray(10,3) "a-z" ) ) # returns 100-element sarray containing 10 random words from the "a-z" alphabet

Rarray


[ rarray sequence projection | Rarrayinverse | R property transfer via alignment | Rarray properties | RarrayAlignment ]

real-array function.
Rarray ( i_NofElements ) - returns a rarray; creates zero-initialized rarray [1: i_NofElements]. You can also create an zero-size 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 ( M [ i_flag ] ) - extracts different groups of elements of the matrix and casts them into a rarray. The possibilities are the following:

  1. all elements by rows (the default)
  2. all elements by columns
  3. the upper triangle,
  4. the lower triangle,
  5. the diagonal elements
  6. the upper triangle without diagonal elements
  7. the lower triangle without diagonal elements

Examples:
 
 a=Rarray(54)                     # create 54-th 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 sequence projection


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_.

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 :
  1. seq1 to ali : RA = Rarray( R1 seq1 ali r_gapValues )
  2. ali to seq2 : R2 = Rarray( RA ali seq2 )
Now R2 has the same dimension as seq2. Values aligned with seq1 are transferred by alignment, other values are set to r_gapValues .
See also:
String( s_,R_,ali_,seq_ )function to project strings
Rarray( R_seq seq_ ali_to r_gapDefault )function to project from sequence to alignment
Probability()function

Reversing the order of elements in an array


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.} 

Transfer real sequence properties by alignment


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 
 #>-cons--------Fyn---------Spec--------Eps8-------n--- 
    " "         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.

Assign arbitrary amino-acid property to a sequence


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 amino-acid sequence.
Example with a hydrophobicity property vector:
 
 s= Sequence("TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN") # crambin sequence 
# 26-dim. 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)              # h-array for each sequence position 
 hh = Smooth(Rarray(s,h), 5) # window average 

Calculating array of alignment strength values for each column


Rarray ( ali [ exact | simple ] )
- 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*(n-1)/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 amino acid contributed values from about -0.5 to 1. depending on the residue similarity.
If option simple is specified, each pair with identical residues contributes 1. while each pair of different amino-acids contributes 0.. The result is divided by n(n-1)/2 , and the square root is taken. The values returned with the simple option are therefore between 0. (all residues are different)
To project the resulting array to a specific sequence, use the Rarray( R_ ali_ seq_ ) function (see above).
To calculate conservation with respect to a particular set of residues in a structure, use the Score( rs_ [ simple ] ) function.
Example:
 
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  


Real function


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 non-numerical characters.
Examples:
 
 s = "5.3"         
 a = Real(s)      # a = 5.3  
 s = "5.3abc"     # will ignore 'abc'    
 a = Real(s)      # the same, a = 5.3  
See also: Toreal

Remainder function.


Returns the remainder; similar to, but different from the Mod function.
functiondescriptionexample
Remainder(x,y)brings x to [-y/2 , y/2] rangeRemainder(17.,10.)=> -3.
Mod(x,y)brings x to [0 , y] rangeMod(17.,10.) => 7.

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 | n-x/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 
 read object s_icmhome+"dcLoop.ob"
 copy a_ "dcLoop2"
 set object a_2.
 read conf s_icmhome+"dcLoop.cnf" 2
 phiPsiVec1 = Value(v_1.//phi,psi)    
 phiPsiVec2 = Value(v_2.//phi,psi)    
              # average angular  
              # deviation  
 angDev=Mean(Abs(Remainder(phiPsiVec1-phiPsiVec2)))   
              # cut and paste these examples into the ICM-shell 
 print Remainder(13,10 )  Mod(13,10 ) 
 print Remainder(17,10 )  Mod(17,10 ) 
 print Remainder(-13,10 ) Mod(-13,10 ) 
 print Remainder(-17,10 ) Mod(-17,10 ) 

Reference


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


[ Replace exact | Replace simple | Replace regexp | Chemical replace ]

- text substitution function.
Replace ( s_source s_icmWildcard s_replacement ) - returns a string, which is a copy of the source string with globally substituted substrings matching s_icmWildcard by the replacement string s_replacement.
Example:
 
 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 ) - returns a sarray with multiple substitutions.
Replace ( S s_icmWildcard s_replacement ) - returns a sarray with multiple substitutions to a single string.

Replace a matching element of an array with another string.


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" .

A straight forward substitution. Replace without any interpretation of the search string.


Replace( s|S 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 using regular expressions


Replace( s|S s_regexp s_by regexp [i_field=0] ) ⇒ s|S

- replace the s_regexp in the source string or array by s_byRegexp using regular expressions. The latter is a string which may contain back-references.

Example:


  read string "t.html"
  s_out = Replace( s_out, "(?n)<i>(.*?)</i>", "<b>\\1</b>" regexp )   # replace italic with bold

Note that "(?n)" modifier is needed to make '.' match newline too.

Dehtml-tagging of the html text in a string or a string array:Prep work in html conversion is usually this: <> S = Replace( S, "
","\n", exact) 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)

Chemical replace


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 R-groups. Note that all atoms except the ones connected to the R-groups 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)


Res


residue selection function.
Res ( { os | ms | rs | as } [ append ] )

Res ( { rs [ append ] )
- selects residue(s) related to the specified objects ( os_), molecules ( ms_) or atoms ( as_), respectively. Option append extends the selection with the terminal residues (like Nter and Cter in peptides)
Examples:

 
 show Res( Sphere(a_1/1/* 4.) )   # show residues within 4 A  
                                  # vicinity from the firsts one  

See also: Atom ( ), Mol ( ), Obj ( ).

Res(ali ..): from sequence positions in sub-alignment to residue selection


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.



Resolution


- returns the X-ray resolution in Angstroms.
Resolution ( ) - returns the real resolution of the current object.
Resolution ( os_object ) - returns the rarray X-ray 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 pdb-file. The function returns 9.90 if resolution is not found.
Resolution ( T_factors [ R_6cell ] ) - returns the rarray of X-ray 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


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 )


Rfactor


crystallographic R-factor.
Rfactor ( T_factors ) - returns the real R-factor residual calculated from the factor-table elements T_factors.fo and T_factors.fc. Reflections marked with T_factors.free = 1 are ignored.



Rfree


crystallographic free R-factor.
Rfree ( T_factors ) - returns the real R-factor residual calculated from the factor-table elements T_factors.fo and T_factors.fc. Only reflections marked with T_factors.free = 1 will be used.

Rmsd


Root-Mean-Square-Deviation function.
Rmsd ( { iarray | rarray | matrix | map } )
- returns the real standard deviation (sigma) from the mean for specified sets of numbers
Rmsd ( as_tetheredAtoms ) returns the real root-mean-square-deviation 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 root-mean-square distance between two selected chemical (hetero) molecules after an optimal chemical superposition via graph-matching 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 )

- returns real array of root-mean-square distances between each element of chemarrayand ms_select2.

Rmsd ( as_pharmTemplate as_select2 pharmacophore )

- returns the real root-mean-square 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 [ { { ali|align } | exact } ] )
- returns the real root-mean-square-distance between two aligned sets after these two sets are optimally superimposed using McLachlan's algorithm.
Virtual atoms. Be default, the first two virtual atoms ( vt1 and vt2 ) are automatically excluded from both selections unless the virtual option is explicitly specified.
The optional third argument defines how atom-atom alignment is established between two selections (which can actually be of any level atom selection `as_ , residue selection `rs_ , molecular selection `ms_ , or object selection `os_ , see alignment options). Number of equivalent atom pairs is saved in i_out . Two output selections as_out and as2_out contain corresponding sets of equivalent atoms. This function also returns the transformation in the R_out array.
See also: superimpose and Srmsd ().
Examples:

 
 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- Ca-atoms 
 
 print Rmsd(a_1./4,29/ca a_2.1/2,102/cb exact) # exact match  


Rot


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 3-dimensional 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 z-axis  
 rotate a_* Rot({0. 0. 1.},30.) 

Rot ( R_3pivotPoint R_3axis , r_Angle )
- returns rarray of transformation vector of rotation around 3-dimensional 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


[ 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 ( s_wildCard directory [simple|all] ) - 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 sub-folders.

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 ONE-dimensional sarray . To split a string into individual lines, or to split a string into a sarray of characters, use the Split() function.
Sarray ( iarray|rarray|sarray ) - converts input arrays into an sarray.
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",..} . 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 one-letter 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 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 side-chain 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"} 

Getting selected entries from index table


this function allows 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


[ Score overlap | Score model | Score predictions | Score sequence | Score conservation | Score alignment ]

function.

A measure of overlap between two arrays


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.
Examples:
 
 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 

Quality measures of a regression or classification model.


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:
measure abbreviation/formula description
"tpos" TP number of true positives
"fneg" FN number of false negatives
"fpos" FP number of false positivers
"tneg" TN number of true negatives
"accuracy" Q=(TP+TN)/(TP+TN+FP+FN) fraction of correctly predicted label assignments
"sensitivity" TP/(TP+FN) fraction of correction predicted positive labels
"specificity" TN/(TN+FP) fraction of correction predicted negative labels
"mathews" (TP*TN-FN*FP)/Sqrt((TP+FN)(TP+FP)(TN+FN)(TN+FP)) Mathews correlation
"precision" PR=TP/(TP+FP)
"recall" RE=TP/(TN+FP) same as sensitivity
"f1" 2*PR*RE/(PR+RE)
Note that only "acuracy", and "mathews" are overall measures symmetrical with respect to the label. Frequently a method is characterized by an area under a recall - precision curve.

Quality measures to evaluate a regression method predicting numerical values, e.g. Partial Least Squares, or Kernel Regression.

measure formula description
"r2" r=Mean((X-))/(Stdev(X)*Stdev(Y)) ; r2=r*r correlation squared
"rmse" Sqrt(Sum((Xpred-Xobs)^2 )/N) root-mean-squared error
"expavg"

Scoring prediction quality from an array of errors and predicted scores


Score ( R_En, R_Dn, wE, wD ) ⇒ r_PredictionQuality
Evaluates 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:

For example, if you predicted n conformations with energies E[n] and calculated RMSD deviations D[n] for each of those conformations from the correct conformation, the quality of your prediction will be calculated by this function.
The Q-value is calculated as follows:
Q = - Log( Sum( exp(- wE#(Ei-Emin) -wD*Di )) / Sum(exp(- wE#(Ei-Emin))) )
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.

Aligning and scoring pairwise sequence alignment


Score ( sequence1, sequence2 )
- returns the real score of the Needleman and Wunsch alignment.
Each pair of aligned residues contributes according to the current residue comparison table, which is normalized so that the average diagonal element is 1. Insertions and deletions reduce the score according to the gapOpen and gapExtension parameters. Approximately, the score is equal to the number of residue identities.
To calculate an array of mean scores for each column of a multiple sequence alignments use the Rarray( ali [ exact ] ) function. i_out returns the number of identical residues.
Examples:

 
 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_n-m+1_scores

returns an array of scores of sliding no-gap sequences.

Score ( seq_n, rs_N ) ⇒ r_no_gap_score

Score ( seq_n, rs_N all ) ⇒ T_N-n_scores_ids_for_all_frames

these two functions return the match or no-gap-alignment 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 non-loopsecondary 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( ).

Conservation score from an alignment projected to a structure


Score ( rs, [ simple | comp_matrix | evolution | info ] )

- returns the rarray of alignment-derived conservation values for the selected residues. For each residue Ri in the residue selection rs_ the following steps are taken:

The default mode shows positions with residues of the same type as more conserved than positions with residues of different types.
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 

Scoring an existing alignment


Score ( ali, [ { identity | similarity | comp_matrix | sort } ] )
- returns the real score of the given alignment calculated by different methods:
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


[ 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 center of mass ]

Selection of atoms according to their coordinates or properties, transferring a selection to another object, or selecting by relative object-specific atom numbers stored in an integer array, or by sequence distance.


Select atoms forming an abnormally long covalent bond


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 atoms on rotatable (or non-rotatable) branches.


Select ( as fix | unfix ) select atoms of the fixed or rotatable branches, for the fix or unfix options, respectively.


Select atoms with a certain number of covalently bonded neighbors.


Select( as bond i_NofBondedAtoms )

- returns a sub-selection 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

Select by number of sub-elements.


This functions allow 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" )
selects objects by number of molecules in them
Select ( ms "n==nofResidues" )
selects molecules by number of residues in them

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 displayed or explicitly selected atoms


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) 

Expand selection to the bonded terminal atoms: hydrogens, polar hydrogens or all.


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:

Example:
 
  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 N-terminal hydrogens


Select by coordinates, bfactor, occupancy or by user field


Select ( as s_condition [ r_Value] ) - returns a sub-selection of atom selection as_ according to the specified condition s_condition.
Three example conditions:
"X >= 2.0" , "Bfactor != 25." , "charge == 0." . Allowed properties and their aliases (case does not matter, the first character is sufficient) are as follows:

Note: do not forget to calculate surface in advance with the show area command. Allowed comparisons: (== != > < >= <=). The value can either be specified inside the string or used as a separate argument r_Value.
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 an equivalent selection in a different object


Select ( as_sourceSelection os_targetObject )
- returns the source selection as_sourceSelection from a source object which is transferred to another object ( os_targetObject ). The two objects must be identical in content. Example:

 
 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 residues by a string array of selection expressions


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 residues by a string array of selection expressions


Select ( os_sourceObject I_atomNumbers )
- returns atom selection of relative atom numbers in specified object os_sourceObject. The iarray can be generated with the Iarray ( as_ ) function. This function allows to pass selections between ICM sessions.

Add small unselected residue ranges to a fragmented residue selection


Select ( rs_fragmented_selection [smooth|margin] 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 atoms interacting with a given selection


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 by alignment distance and sequence length mismatch


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:

Example:

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 )

Selecting residues by centers of mass


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:

See also Xyz( as residue ) .

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".



Sequence


[ 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("HFGD--KLS AREWDDIPYQ")  
                                   # non-characters will be squeezed out 
 a=Sequence("ACTGGGA", nucleotide)  
 Type(a , 2)  # returns the type-string : 
 nucleotide 

Sequence ( ali ) - returns a chimeric sequence which represents the strongest character in every alignment position.
Sequence ( profile ) - returns a chimeric sequence which represents the strongest character in every profile position.

reverse complement dna sequence function


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 

create sequence array


Sequnce( S ) - converts sarray of sequence strings to protein sequence parray

Example:


add column T Sequence( {"MISLIAALAVDRVIGPWNLPADLAWFKRNTLDKPVIMGRHTWESIGRPLPGRKNIILSSQPGTDDRVTWVKSVDEAIAACGDVPEIMVIGGGRVYEQFLPKAQKLYLTHIDAEVEGDTHFPDYEPDDWESVFSEFHDADAQNSHSYCFEILERR", "STAGKVIKCKAAVLWEEKKPFSIEEVEVAPPKAHEVRIKMVATGICRSDDHVVSGTLVTPLPVIAGHEAAGIVESIGEGVTTVRPGDKVIPLFTPQCGKCRVCKHPEGNFCLKNDLSMPRGTMQDGTSRFTCRGKPIHHFLGTSTFSQYTVVDEISVAKIDAASPLEKVCLIGCGFSTGYGSAVKVAKVTQGSTCAVFGLGGVGLSVIMGCKAAGAARIIGVDINKDKFAKAKEVGATECVNPQDYKKPIQEVLTEMSNGGVDFSFEVIGRLDTMVTALSCCQEAYGVSVIVGVPPDSQNLSMNPMLLLSGRTWKGAIFGGFKSKDSVPKLVADFMAKKFALDPLITHVLPFEKINEGFDLLRSGESIRTILTF"} ) name="seq"
add column T Length(T.seq) name="len"
set name T.seq {"6dfr", "8adh"}
sq1 = T.seq[1]

See also: sequence parray.



Shuffle


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.. 


Sign


transfer-of-sign 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.
Examples:

 
 Sign(-23)  
 -1 
 Sign(-23.3)  
 -1. 
 Sign({-23,13})  
 {-1,1} 
 Sign({-23.0,13.1})  
 {-1.,1.} 


Sin


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.}  


Sinh


hyperbolic sine function.
Sinh ( { real | integer } ) - returns the real hyperbolic sine of its real or integer argument. Sinh(x)=0.5( eiz - 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


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


Slide( )

- returns a compact binary representation of the entire graphical view (also known in ICM as a slide). Slides include the following:

In addition slides may contain window layout information, sufficient to restore the view which was used when the slide was created.

The data is packed into a single-element 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.


Smiles


convert chemical structure into a Smiles string.
Smiles ( as )

Smiles ( chem [unique] [cartesian] )

- 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 = "CCCCC|3D: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 | Smooth matrix | Smoothrs | Smooth alignment | Smooth map ]

sliding window averaging, convolution, 2D and 3D-Gaussian smoothing, map smoothing and function derivatives.

Smooth


Smooth ( R_source, [ i_windowSize ] ) - returns the window-averaged 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.)                   # x-array 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 two-dimensional averaging of matrix values


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 [i-n:i+n] [j-n:j+n] cells , (2n+1)^2 in total, according to the gaussian weights calculated as exp( r2 / R2 ), 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: three-dimensional averaging of residue properties


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_j2/ r_smoothRadius2).
The inter-residue 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 3D-averaging 
 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: expanding alignment gaps


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: transforming three-dimensional map functions.


Smooth ( map , [ "expand" ] )
weighted 3D-window 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 one-dimensional 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
low-values propagation
Smooth( map "expand" ) - returns map in which the low values were propagated in three dimensions to the neighboring nodes. This trick allows 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 .

SolveQuadratic : roots of quadratic equation


SolveQuadratic( r_a r_b r_c | R_3|2 [all] ) ⇒ R_roots

returns an array of real roots of a quadratic equation ax2 + 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

SolveQubic : roots of cubic equation


SolveCubic( {r_a r_b r_c r_d | R_[a]bcd} [all] ) ⇒ R_realRoots|R_6re,im

returns an array of real roots of a qubic equation ax3 + bx2 + 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

Sql


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

Sqrt


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


sphere selection function. 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 . ICM-shell variable which is equal to 5.0 A by default.

Sphere (as_source| grob|R_xyz|M_xyz [as_whereToSelect] [radius(5.)] ) ⇒ selection

Sphere (as_source|M_xyz as_whereToSelect radius object|molecule|residue ) ⇒ os|ml|re

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 function can be much accelerated if you specify the desired level of the resulting selection explicitly (e.g. molecule ,or residue, or object in the second function template). For example, if you just want to know molecules around a selection, you can say Sphere( a_1 a_2 6. molecule )

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 using the sign of the radius. Sphere can also correct for the van der Waals radii if you specify the negative radius. For example, Sphere( a_//a1 a_//a2 , -1.2 ) means that the interatomic_distance - (R(a1) + R(a2)) will be compared with 1.2 It means that the argument of -1.2 is equivalent to the distance of 1.2+1.6+1.6 = 4.4 for two carbons )

The negative sign just flags the program to use the adjustment.


SoapMessage


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.


Sort


function to return the sorted version of array.
Sort ( sarray|iarray|rarray|chem-array [reverse] )

- returns the sorted array. Option reverse toggles the sorting order.
Examples:

 
 count_unique=Nof(Sort(Unique({1, 11, 7, 2, 2, 7, 11, 1, 7})))  # counts unique elements
See also: Unique( ), sort.

Split


[ Split tree | Split regexp | Split multisep | Split chemical ]

function.
Split ( s_multiFieldString, s_Separators ) - returns sarray of parts of the input string separated by s_Separators.

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 multi-line string into individual lines, use Split( s_, "\n" ).
Examples:

 
 lines=Split("a 1 \n 2","\n")  # returns 2-array of {"a 1" " 2 "}   
 flds =Split("a b c")          # returns 3-array of {"a" "b" "c"}   
 flds =Split("a b:::c",":")    # returns 4-array 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 tree cluster by threshold or number of clusters.


Split( table.cluster, [r_threshold]|[i_numberOfClusters] )

Returns iarray of cluster numbers for each row.

Example:


cl = Split( t.cluster, Max( t.cluster )/2 )

Split by a regular expression


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 3-array of {"a" "b" "c"}

Split("a_asd_b_awe_c","_a.._", regexp) # returns { "a","b","c" }

Split by two separators


Split ( S_source, s_separator1, s_separator2 [regexp|exact] ) ⇒ 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: Sum-multisep

Split a chemical into individual molecules


Split ( X_1_with_n_molecules ) ⇒ X_n
Splits a single multimolecular entry (e.g. a compound plus water molecules) into individual molecules. It always return at least one element.

 
 add column t Split( Chemical( "O=O.NN" ) )

See also: Sum chemical other chemical functions


Srmsd


"static" root-mean-square deviation function. Calculates deviation without superposition.
Srmsd ( ms_select1 ms_select2 chemical [output] )

Srmsd ( ms_select1 ms_select2 as_subselect1 chemical )

- returns the real root-mean-square 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.

Srmsd ( as_select1 as_select2 [{ align | ali } | auto|chemical|exact|pharmacophore|type|virtual|matrix] ) - returns real value of root-mean-square 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).
Virtual atoms. Be default, the first two virtual atoms ( vt1 and vt2 ) are automatically excluded from both selections unless the virtual option is explicitly specified.

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
Examples:

 
 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 root-mean-square length of absolute distance restraints ( so called, tethers ) for the tethered atoms in ICM-object. 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 .

Srmsd ( as1 as2 matrix [chemical] )

returns the "optimal path" srmsd where for each molecule the smallest rmsd is accumulated. The function also returns M_out with Srmsd values for all pairs of molecules. The dimensions of the M_out matrix will be 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.

Srmsd ( as_pharmTemplate as_chem [pharmacophore] )

- returns real value of root-mean-square 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



String


[ String substring | String mol | Alignment_as_text | Ali_seq_project | Seq_ali_project | String alternative | String selection | String slide gui | Chem formula ]

function.
String ( seq ) - converts sequence into a string
String ( i ) - converts integer into a string . see Tostring
String ( r [ i_nOfDecimals] ) - converts real into a string . It also allows to round a real number to a given number of digits after decimal point.
String ( s, i_NofRepeats ) - repeat specified string i_NofRepeats times
String ( string, all ) - adds flanking quotes and extra escape symbols to write this string in a form interpretable in shell in $string expression.

String ( string, html ) - return URL-encoded version of the input string argument. See also Table-urland Collection to parse URL encoded strings.

String ( collection, html ) - return URL-encoded query string from the input collection argument. See also Table-urland Collection to parse URL encoded strings.
String ( s_input, s_default ) - if the input s_input string is empty returns the s_default, otherwise returns the s_input string
String ( string, i_offset, i_length ) - returns substring of length i_length. If i_length is negative returns substring from the offset to the end.
String ( { iarray | rarray | matrix } plot [ s_translateString ] ) - converts numbers into a string or ascii characters (the "Ascii art", i.e. 12345 -> "..:*#").
The range between the minimal and maximal values is equally divided into equal subranges for each character in the string. This function is useful for ascii visualization of arrays and matrices. The default translation string is ".:*0#". Another popular choice is "0123456789".
Examples:

 
 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 symbols
See also: Tostring , show map.

Extracting a substring or reversing the order of characters in a string


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.
Examples:

 
 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" 

Export a chemical or chemical array as sdf text.


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 )

Converting an alignment into text


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) 

Projecting properties from alignment to a member sequence.


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) 

Projecting properties from member sequence to alignment


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 

Returning one of two alternatives depending on a condition


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( selection ): converting selections into the text form


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:4|a_b.2,14 ) You can also divide this selection info a string array with the Split function.
Option i_number allows to print only i-th element of the selection. It is convenient in scripts. For atom selections it will also show full information about each atom, rather than only the ranges of atom numbers.
This string form is convenient used for several purposes:


With option name , the one-letter 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 $nei 
Another 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

Retrieve window layout string from a slide


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.

Chemical formula


String ( as { dot | all | smiles | sln } )
- returns string with the following chemical information:
option description example
all chemical formula e.g. C2H6O
dot chemical formula with dot-separated molecules e.g. C2H6O.C3H8
smiles smiles string e.g. [CH3][CH2][OH]
sln sln notation e.g. CH3CH2OH

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  


Sstructure


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 jack-knife 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 secondary-structure related propensities are combined to produce the final prediction string. Three are based on long-range interactions involving potential hydrogen bonded residues in anti-parallel and parallel beta sheet and alpha-helices. 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 4-residue 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: Note that these propensities are not directly related to the prediction. Usually the reliability level of 0.8 guaranties prediction accuracy of about 90%. Do not be surprised if the propensities are all zero for a fragment. It may just mean that the statistics is too scarce for a reliable estimate.
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


[ 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  

>>Sum-multisep 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 ( chemical )


Sum ( chemarray [r_spacing=0.] )

Merges elements of into one molecule. If is equal to zero no translation will be done. Otherwise elements will be arranges in XY plane with specified spacing at X axis.

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

Blending images


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


Symgroup


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.

Examples:

 
 iGroup = Symgroup("P212121" number )  # find the group number=19 
 print "N_assymetric_units in the cell =", i_out  
 show Transform(iGroup))  # shows 4 12-membered transformations.


Table


[ Table url_decoder | Alignment as table | Residue correspondences | Table matrix | Table pairs | Table stack | Table model | Site table | Table distance ]

generic function return a table.

Table: decoding a URL string


Table ( s_URL_encoded_String [ crypt ] )
- returns the table of "name" and "value" pairs organized in two string arrays. The URL-encoding is a format in which the HTML browser sends the HTML-form input to the server either through standard input or an environmental variable. The URL-encoded string consists of a number of the "name=value&name=value..." pairs separated by ampersand ( & ). Additionally, all the spaces are replaced by plus signs and special characters are encoded as hexadecimals with the following format %NN. The Table function decodes the string and creates two string arrays united in a table.
Option crypt allows to interpret doubly encoded strings (e.g. ' ' is translated to '+' which then converted into a hexadecimal form). Frequently the problem can be eliminated by specifying the correct port. Example: you need to set a="b c" and d="<%>". Normal server will convert it to a=b+c&d=%3C%25%3E. Double encoding leads to a=b%2bc&d=%253C%2525%253E. To parse the last string, use the crypt option.
To see all the hidden symbols (special attention to '\r'), set l_showSpecialChar =yes.
Examples:

 
 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] 
 endfor 
See also: Getenv( ).

Converting alignment into a table


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 
#>-cons----seq1-----seq2------- 
   " "       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         LQC-NCP  

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 ~ "[A-Z]"  # 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 range 
See also, the next function

Outputting a table of residue numbers for corresponding positions


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.

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
seq 1 11 13 16 comment
1fyn_a L10,90 D12,92 A15,95 this sequence is linked to molecule a
Spec D1 L11 D13 E16 Spec sequence positions starting from 1
Eps8 K1 K11 D13 A16 Eps8 sequence positions starting from 1

Converting matrix into table columns


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
 #>-A1---A2---A3----
    1.   0.   0.         
    0.   1.   0.         
    0.   0.   1.         

The inverse operation can be done with Matrix ( table , S_colNames ) function.

Converting a square symmetrical matrix to a table with pairs of elements.


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:

Extracting parameters of stack conformations


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 
 #>-i--ener--------rmsd--------naft--------nvis------- 
    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 phi-psi angles 
 #>T 
 #>-ener----rmsd--naft-nvis------v1------v2------v3------v4-------v5----- 
    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

Column weights in PLS models and relative contributions of the descriptors.


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 + w1*X1+w2*X2+...The wRel column returns the following value:( Abs(wk) * Rmsd(Xk) ) / Sum_k( Abs(wk) * Rmsd(Xk) )

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
 #>-name--------mean--------rmsd--------w-----------wRel-------
    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

Retrieving sequence site information


Table( site seq ) ⇒ T_allSites

Example:


read pdb "1f88"
make sequence
Table( 1f88_a site)
 #>T
 #>-key---------fr----------to----------list--------desc-------
    CARBOHYD    15          15          ""          "glycosylation site                                 "
    CARBOHYD    2           2           ""          "glycosylation site                                 "

Exporting a table from an interatomic distance object of hydrogen bond parray.


Table( hbondpairs|atompair_distances|angles|torsions 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 distance
Angles 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 , Nof-distance{Nof(d,distance)}

Tan


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}  


Tanh


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  


Tensor


function the second moments for a multidimensional distribution.
Tensor ( M)
- returns the square matrix of second moments of K points in N -dimensional space, Mki (k=1,K,i=1,N) . The matrix NxN is calculated as
< Xi >< Xj > - < Xi Xj > , 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 longest 
This 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 


Temperature


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. 6409-6412) based upon the dunucleotide parameters provided in Breslauer, Frank, Bloecker, and Markey, Proc. Natl. Acad. Sci. USA, v. 83, pp. 3746-3750. 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 self-complementary. 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.

Time


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?" 

Tointeger


convert to integer values or arrays.

Tointeger ( string|real|integer|logical ) - converts to integer

Tointeger ( sarray|rarray|iarray ) - 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( )


Tolower


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( ).

Toreal


convert to real values or arrays.

Toreal ( string|real|integer ) - converts to real
Toreal ( sarray|rarray|iarray ) - converts each element to a real, returns a real array. see Rarray( ).

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 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( )


Torsion


angle function.
Torsion ( as ) - returns the real torsion angle defined by the specified atom as_ and the three previous atoms in the ICM-tree. 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 C-Ca-N-C angle  
 
 print Torsion(a_/4/ca a_/5/ca a_/6/ca a_/7/ca)  # virtual Ca-Ca-Ca-Ca  
                                                 # torsion angle  


Tostring


convert to integer values or arrays.

Tostring ( string|real|integer ) - converts to string

Tostring ( sarray|rarray|iarray ) - converts each element to a string, returns sarray.

Tostring ( seqarray ) - returns sarray with sequences extracted from sequence parray elements.

See also: Toreal , Tointeger , Sequence


Toupper


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 ( string|sarray 1 )
Examples:

 
 show Toupper("promotion") 

 show Toupper("joseph louis gay lussac",1) 
 Joseph Louis Gay-Lussac
 
 read sarray "text.tx" 
 text1 = Toupper(text) 
See also: Tolower( ).

Tr123


translate one-character sequence to three-character notation.
Tr123 ( sequence ) - returns string like "ala glu pro".
Examples:
 
 show Tr123(seq1)               
See also: Tr321( ). IcmSequence( ).

Tr321


translate three-character sequence to one-character 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 


Trace


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.  


Trans


[ 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.

Six frame DNA/RNA sequence translation


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 to provide a comma-separated 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 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:
 
#>-frame-------left--------right-------dir---------len---------seq-------- 
   -1          22          57          -1          12          XCVXVAAESVAS 
In 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 family of functions.


Transform( s_group|iGroup|os_1|map ) ⇒ R_12N_all_fract_transformations

Transform( s_group|iGroup|os_1|map 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.


Transpose


matrix function.
Transpose ( matrix ) - converts the argument matrix[n,m] into the transposed matrix [m,n]
Transpose ( rarray ) - converts real vector [n] into a one-column 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:



Trim


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 auto-trim 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.+(d-b)/(b-a)) for high values and similarly for low values.
Return values: By default r_percentile is 0.9 and i_mode is 0 . Example:
 
 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 ( I_iarray i_lower i_upper ) - returns iarray clamped into the specified range. Values smaller than i_lower are replaced with i_lower, and values greater than i_upper are replaced with i_upper.
Trim ( R_rarray r_lower r_upper ) - returns rarray clamped into the specified range.
Trim ( i i_lower i_upper ) - returns integer clamped into the specified range (e.g. Trim(6,1,3) returns 3).
Trim ( r r_lower r_upper ) - returns real clamped into the specified range.
Trim ( M_matrix r_lower r_upper ) - returns matrix clamped into the specified range.
Trim ( m_gridMap r_lower r_upper ) - returns map clamped into the specified range. It means that all values above r_upper are set to r_upper, and all values below r_lower are set to r_lower.
Trim ( string [ all ] ) - returns string with removed trailing blanks and carriage returns. If option all is specified, both leading and trailing blank characters will be removed.
Trim ( string maxNofCharacters [s_appendWhenTruncated] ) - trims to the maximal number of characters, it may appends specified trailing string if truncated.


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.
Trim ( S_sarray [ all ] )

- returns sarray of strings with removed trailing blanks. With option all it removes white space characters from both ends.


Trim irrelevant expression tag sequences from the domain sequence.


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 N-terminal (use ^) , a fragment in the middle, or C-terminal (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 his-tag
 cleanseq = Trim(1pme_a S_proteinTags ) # built in shell array
 Align(1pme_a cleanseq)
 1pme_a        MSSSHHHHHHSSGLVPRGSHMAAAAAAGAG
 cleanseq      ----------SSGLVPRGSHMAAAAAAGAG



Turn


beta-turn prediction function.
Turn ( { seq | rs } ) - returns rarray containing beta-turn prediction index. The index is derived from propensities for i,i+1,i+2,i+3 positions for each amino-acid. 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 prediction  
See also the predictSeq macro.

Type


[ 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:
"ICM" ready for energy calculations. Those objects are either built in ICM or converted to the ICM-type.
"X-Ray" determined by X-ray diffraction
"NMR" determined by NMR
"Model" theoretical model (watch out!)
"Electron" determined by electron diffraction
"Fiber" determined by fiber diffraction
"Fluorescence" determined by fluorescence transfer
"Neutron" determined by neutron diffraction
"Ca-trace" upon reading a pdb, ICM determines if an object is just a Ca-trace.
"Simplified" special object type for protein folding games.
The non-ICM types can be converted to "ICM" with the convert command or convertObject macro.

The non-ICM types can be changed with the set type object command, e.g.


set type a_ "NMR"


Type ( { ms | rs }, 2 ) - returns the string type of the specified molecule or residue. Legal types are "Amino", "Hetatm", "Nucl", "Sugar", "Lipid", "empty". Residues of the "Amino" type can be selected with the 'A' character (e.g. a_/A). See also a one-letter code for the type which is used in selections, ( e.g. a_A,H ).

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 molecule|all ) or Type( rs residue|all ) for an array of one-letter 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 non-virtual atoms 

Type ( as_1 as_2 ) - returns an integer containing the covalent bond type between the selected atoms.

Type( os|ms|rs all|object|molecule|residue ) ⇒ 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 one-letter type code will be returned, e.g. "H" or "A" etc.
Type( seq , 1 ) - returns the string type of the sequence. Two types are recognized: "protein" and "nucleotide" . An example in which we rename and delete all DNA sequences from the session:

 
 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*" 

Returns specific type of the SOAP object


Type( soapObject 2 )

See SOAP services for information.

Information from databases


Type( s_dbtable sql column )

- returns sarray with SQL column types of the database table s_dbtable.

See also: molcart, Name molcart


Unique


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.
Examples:


 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



Unix


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:



Value


values of bond lengths, bond angles, phase and torsion angles.
Value ( vs_var ) - returns rarray of selected parameters. The function considers variables only in the current object.
Examples:
 
 ang=Value(a_/14:50/phi,PSI)          # array of phi-psi values 
 hbonds=Value(a_//bh*)                # array of lengths for all H-X bonds  
(Note use of special torsion PSI in the first example.)

Value from SOAP message


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.



Vector


[ Vectorproduct | Vectorsymmetrytransformation | LatentVector ]

vector product between two 3D-vectors.

Vector product


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 symmetry transformation


Vector ( M_matrix ) - transforms an augmented affine 4x4 space transformation matrix into a transformation vector.

See also: Augment( ) function.

Latent Vector


Vector ( PLS_model i_num ) - returns i-th latent vector of the PLS model

See also: Nof latent learn predict



Version


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 one-letter specifications of the licensed modules separated by spaces (e.g. " G B R " ).
Option number just has the version itself (e.g. 3.1-03a )

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 driver-specific limitations, like the maximum number of light sources supported.
See also: show version.
Example:

 
 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.1-03 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" 


Volume


volumes of grobs, spheres, residues and cells.
Volume ( grob ) - returns real volume of a solid graphics object (would not work on dotted or chicken wire grobs). ICM uses the Gauss theorem for calculate the volume confined by a closed surface:
V = 1/3 * Sum( A * n * R )
where A is a surface area of a triangle, n a normal vector, and R is is a vector from an arbitrary origin to any vertex of the triangle. It is important that the grob is closed, otherwise, strictly speaking, the volume is not defined. However, small surface defects will not affect substantially the calculation. ICM minimizes possible error by rational choice of the origin, which is mathematically unimportant for an ideal case. To define directions of the normals the program either takes the explicit normals (i.e. they may be present in an input Wavefront file) or uses the order of points in a triangle. ICM-generated grobs created by the make grob [ potential | matrix | map] command have the correct vertex order (the corkscrew rule), while the make grob skin command calculates explicit normals. The best way to make sure that everything is all right is to display grob solid and check the lighting. If a grob is lighted from the outside, the normals point outwords, and the grob volume will be positive. If a grob is lighted from the inside (as for cavities), the normals point inwords and the volume will be negative. If the lighting, and therefore normals, are inconsistent you are in trouble, since Mr Gauss will be seriously disappointed, but he will issue a fair warning from the grave. The surface area is calculated free of charge and is stored in r_out . The surface defect fraction, a relative area of the missing triangles, is returned in r_2out . Normally this fraction should be zero.
Example:
 
 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*R3
Volume ( s_aminoAcids ) - returns real total van der Waals volume of specified amino-acids.
Volume ( R_unitCellParameters ) - returns real volume of a cell with parameters {a,b,c} for a parallelepiped or {a, b, c, alpha, beta, gamma} in a general case.
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  


View


parameters of the graphics window and graphics view.
View( [ window ] ) - returns rarray of 37 parameters of the graphics window and view attributes. (Note: Versions before 2010 returned 36 parameters, however the new version understands the old format as well). With the window option the function returns only WindowWidth and WindowHeight . See also set view and set view. Info(display)
Example (how to save the image with 3 times larger resolution):
 
 nice "1crn"  # resize window 
 write image window=2*View(window) # 2-times 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 )
- returns rarray of the interpolated view between the from and to view at the intermediate point 0≤ r_factor≤1. If r_factor is out of the [0,1] range, the operation becomes extrapolation and should be used with caution. The camera view is changed in such a manner that the physical space is not distorted (the principal rotation is determined and interpolated, as are translation and zoom)
Example:

 
 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) 
 endfor 
See 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 


Warning : the ICM warning message


indicates that the previous ICM-shell 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 : atom coordinates and surface points


[ Xyz points | Xyz mesh | Xyz fract | Xyz transformed xyz | Xyz chemical match | Xyz vector2matrix | Xyz axes ]

function returning a matrix of x,y,z coordinates.

Xyz : coordinates of atoms or vertexes


Xyz ( as | grob , [ {Default X,Y,Z} ] )

Xyz ( as residue )
- returns matrix [ number_of_selected_atoms , 3] in which each row contains x,y,z of the selected atoms. Option residue will return the mean coordinates of groups of selected atoms in each selected residue.
Examples:

 
 coord=Xyz(a_//ca)          # matrix of Ca-coordinates  
 show coord[i]              # 3-vector x,y,z of i-th atom  
 show Mean(Xyz(a_//ca))     # show the centroid of Ca-atoms  

Sparse surface mesh points


Xyz ( as r_interPointDistance surface )
- returns a subset of representative points at the accessible surface which are spaced out at approximately r_interPointDistance distance. This distance from the van der Waals surface (or skin ) is controlled by the vwExpand parameter.
Example:
 
 build string "ala his trp" 
 vwExpand = 3. 
 mxyz = Xyz( a_ 5. surface ) 
 display skin white 
 dsXyz mxyz 
 color a_dots. red 

Sparse surface mesh points


Xyz( M_abs_xyz, R_3_6cell|obs ) ⇒ M_fract_xyz

Xyz( M_fract_xyz, R_3_6cell|obs, 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:

Applying crystallographic transformation


Xyz( M_xyz, R_12abs_transformation [reverse|cell|transform] ) ⇒ M_xyz1_transformed

Xyz( M_xyz, i_symm_transformation, s_sym_group, R3_cell|R_6_cell [cell|translate]) ⇒ 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 6-membered 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.

Chemically matching a smiles string to a selection


Xyz( as s_smiles ) ⇒ Xyz_match

Converting 3*N vector to a Nx3 coordinate matrix


Xyz( R_3N_x1y1z1x2y2z3...> ) ⇒ <M_Nx3_xyz

Axis vectors of a crystallographic cell


Xyz ( R_6cell axis ) ⇒ M_ABCvectors

returns three row-vectors 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


Prev
write vs_var
Home
Up
Next
Macros