Metaphorics Logo

Action Clause


 
Magnet Documentation
SEA Reference
   Selections
   Expressions
   Actions
   Examples

printf("format",expression,...)

Prints expressions per format

accept(atom1, atom2,"name",expression)

Marks the atom pair (atom1, atom2) as having interaction of type "name" and with the value of the expression.

keep()

Marks the current pose for output to the stream on stdout. The default is not output.

reject()

Unmarks the current pose for output to the stream on stdout. Undoes any previous accept.

getid(0 or 1)

Returns ligand ID string

getatinfo(atom)

Returns atom ID string

set(variable, expression)

Sets variable to value of expression.

setrealatomprop(atom,"propertyname",expression)

Sets the named real atom property to the value of expression

One of the main actions which is available is accept(atom, atom, typestring, value) which marks an atom pair as having a particular type of interaction and value. For example,

{accept(l1, r1, "H", dist(l1,t1))} 

which would mark the atoms corresponding to l1 and r1 from the select clauses as having interaction type "H" (which can be an arbitrary string) with a value set to be the distance between the two atoms. The type string and value are arbitrary and depend on how the output will be used by later programs. The result of an accept action is dependent on the program in which the SEA language is embedded. In some cases, an accept will result in output being generated in a molecular output file. In all cases, an accept action can be tested by a later notdef() function. The type can be used in subsequent rules in a notdef function to prevent other rules from being applied to the corresponding atom pair. For example, a subsequent rule could include notdef(l1,r1,"H") in the expression clause which would evaluate to false for any pair of atoms which had previously been included by the accept example above. Thus the rule with the corresponding notdef function would not have its action clause triggered for those pairs of atoms.

Another major action function is printf . This action is modeled after the printf statement in C (and a number of other computer languages). The format string is used, as in C, to control the format an content of the output to standard output. Since the values returned by all SEA functions and expressions are either string or floating point (double), only those format specifiers which deal with float or string are applicable.

The keep() and reject() actions set or clear a flag which triggers output of the current ligand pose. The default is to do no output of the poses. However, in filtering applications of SEA, it is useful to be able to indicate that a particular pose should be kept or rejected. Multiple rules can have keep() and reject() actions and the final one for a particular pose will determine the output state for that pose.

getatinfo() and getid() are convenience functions which return strings that may be useful in printf actions. getatinfo(atom) returns a string with the residue name and number, chain id and atom name (or whatever of those is defined from the input). getid returns a string with the ligand name and optionally an appended conformation number (as name_number) if the argument to getid is 1. If zero, the ligand name alone is returned.

setrealatomprop is used to set real atom property values for designated atoms. These values can be used in later expressions (in either expression or action clauses).


© Metaphorics, LLC
info@metaphorics.com