ASL Examples

This topic gives some examples of the use of the ASL in real-life situations. Note that while these examples all use lower-case, the ASL expressions themselves are not case sensitive.

Defining a set to refer to a ligand and/or receptor.

The exact command depends on the nature of your system. If the ligand and the receptor are separate entries then you can use

set ligand entry.name <ligand_name>

where <ligand_name> is the name of the entry that contains the ligand. Similarly

set receptor entry.name <receptor_name>

for the receptor with entry called <receptor_name>.

In order to define sets that work with multiple ligands it's also possible to define the ligand as everything that is not part of the receptor. A definition of:

set ligand not set receptor

identifies the ligand as anything that's not part of the receptor.

If the ligand and the receptor are part of the same entry then molecule numbers are the best way to define the ligand and the receptor. Assuming the receptor is molecule 1 and the ligand molecule 2:

set ligand mol.num 2
set receptor mol.num 1

Note however that the use of molecule numbers in set definitions should be avoided where possible as these depend on the order in which the project entries are included into the Workspace. If it is possible to use entry names, then these should be used.

The subsequent examples assume that sets for the receptor and the ligand have been defined using one of the methods defined above.

The set of atoms within a given distance of the ligand

One common task is to do something with the set of atoms within a given distance of the ligand. For example to only display those atoms or to include them in a substructure region for a MacroModel calculation. These examples will use the "displayonlyatom" command but the ASL which follows can be used with any other command that uses ASL.

To only display atoms within 5.0 Angstroms of the ligand:

displayonlyatom within 5.0 set ligand

A common variation is to display complete residues which have any of their atoms within a given distance of the ligand:

displayonlyatom fillres within 5.0 set ligand

It's also possible to restrict the expression so that it only applies to receptor atoms within a given distance of the ligand. Here the Boolean "and" operator is used to restrict the displayed atoms to the receptor only:

displayonlyatom set receptor and fillres within 5.0 set ligand

Because this is a lengthy expression it's often convenient to make this into a set itself:

set active_site set receptor and fillres within 5.0 set ligand

An equivalent form of this is:

set active_site (! set ligand) & fillres within 5.0 set ligand

Note that "!" is a standard alias for "not" and similarly "&" for "and".

Sidechain and backbone

The ASL has standard aliases for the definition of sidechain and backbone atoms in proteins. For example to only display the atoms of the backbone:

displayonlyatom backbone

These aliases can be used with operators to build up more complicated expressions. For example to only display the sidechain of the receptor:

displayonlyatom sidechain and set receptor

To display only the sidechains of the atoms within 5.0 Å of the ligand:

displayonlyatom sidechain and set receptor and fillres within 5.0 set ligand

Atoms of a given type

There are a variety of ways to specify atoms of a given type. For example to specify all carbons, nitrogens and oxygens the following is used:

atom.ele C,N,O

To specify non-hydrogen atoms:

not atom.ele H

To specify the alpha carbons in a protein:

atom.ptype CA

To specify all sp2 carbons there are two choices. The first relies on knowing that the MacroModel atom type for such an atom is C2 and using:

atom.mtype C2

The other (assuming no formally charged or radical carbons are present) uses the number of attachments to the atom:

atom.ele C and atom.att 3

To specify polar hydrogens:

atom.ele H and not /C0-H0/

or

atom.ele H and not atom.mtype H1

Water molecules

The ASL has a standard alias water. For example to delete all water molecules the Maestro command is:

delete atom water

Restricting an operation to the atoms that are currently displayed in the Workspace

Often you will be working with only a subset of the atoms in the Workspace displayed. If an operation is to be performed only on the atoms that are displayed then the atom.displayed property can be used. For example to change the color to green of all the atoms currently displayed in the Workspace and to leave alone the undisplayed Workspace atoms:

coloratom color=green atom.disp

To only do it for the atoms that are displayed and in the receptor:

coloratom color=green atom.disp and receptor

Specifying molecules

All molecules with between 30 and 100 atoms:

mol.atoms 30-100

All molecules with over 100 atoms:

mol.atoms >100

All molecules with a molecular weight over 300:

mol.weight > 300.0

All molecules that contain a halogen:

fillmol atom.ele F,Cl,Br,I

Specifying atoms using linear substructure notation.

The ASL supports the use of a SMILES-like linear substructure notation to specify atoms with a particular bonding arrangement. The atoms are referred to by MacroModel atom types (see MacroModel Atom and Bond Types), but there are wildcard types that can be used to allow the expression to apply to any atoms of a given element type.

Some examples:

Any five-membered ring:

/00-00-00-00-00-1/

Aromatic six-membered carbon rings(C2 is sp2 carbon):

/C2-C2*C2-C2*C2-C2*1/

Amide groups:

/C2(*O2)-N2/

Methyl groups:

/C3(-H1)(-H1)(-H1)/

Water:

/H2-O3-H2/

Guanadinium group:

/N2(-H3)-C2(*N4(-H4)(-H4))-N2(-H3)(-H3)/

Using wildcard characters

Most string-type property values can use wildcard characters. Some examples:

All PDB atom names beginning with C

atom.ptype C*

All entries that begin with lig:

entry.name lig*

Using SMARTS expressions

The ASL supports the use of a SMARTS expression. Some examples:

smarts. CCC

matches all three-carbon subsequences,

smarts. [R] and atom.ele N

matches all ring nitrogens,

smarts. C1CCCCCC1

matches all six-membered carbon rings.