Atom Selection Syntax

Atom Selection in the SilcsBio GUI

The SilcsBio GUI uses the same atom selection syntax as the NGL molecular structure viewer. This syntax is described at https://nglviewer.org/ngl/api/manual/selection-language.html and is reproduced below for convenience.

Keywords

  • all, *

  • sidechain

  • sidechainAttached (not backbone or .CA or (PRO and .N))

  • backbone

  • protein

  • nucleic

  • rna

  • dna

  • hetero

  • ligand (( not polymer or hetero ) and not ( water or ion ))

  • ion

  • saccharide/sugar

  • polymer

  • water

  • hydrogen

  • helix

  • sheet

  • turn (not helix and not sheet)

  • small (Gly or Ala or Ser)

  • nucleophilic (Ser or Thr or Cys)

  • hydrophobic (Ala or Val or Leu or Ile or Met or Pro or Phe or Trp)

  • aromatic (Phe or Tyr or Trp or His)

  • amid (Asn or Gln)

  • acidic (Asp or Glu)

  • basic (His or Lys or Arg)

  • charged (Asp or Glu or His or Lys or Arg)

  • polar (Asp or Cys or Gly or Glu or His or Lys or Arg or Asn or Gln or Ser or Thr or Tyr)

  • nonpolar (Ala or Ile or Leu or Met or Phe or Pro or Val or Trp)

  • cyclic (His or Phe or Pro or Trp or Tyr)

  • aliphatic (Ala or Gly or Ile or Leu or Val)

  • bonded (all atoms with at least one bond)

  • ring (all atoms within rings)

Expressions

  • residue number: 1, 2, 100

  • residue number range: 3-40 (Note that around the dash - no spaces are allowed)

  • chain name: :A

  • atom name: .CA, .C, .N, …

  • model: /0, /1, …

  • residue name: ALA, GLU, SOL, DMPC, …

  • numeric residue name: [032], [1AB], …

  • list of residue names: [ALA,GLU,MET], [ARG,LYS], …

  • element name: _H, _C, _O, …

  • alternate location: %A, %B, … or % for non-alternate location atoms

  • insertion code: ^A, ^B, … or ^ for residues with no insertion code

Some of these expressions can be combined (in this order) - residue number (range), insertion code, chain name, atom name, alternate location, model - like this

// select C-alpha atoms of residue 10 with insertion code A
// from chain F in model 0 at alternate location C
10^A:F.CA%C/0

which is the same as

10 and ^A and :F and .CA and %C and /0

Single expressions may be left out as long as the order (see above) is kept, for example:

:A/0 # select chain A from model 0

Atomindex

A list of atom indices can be given as a comma seperated list (no spaces in between) prefixed with the @ character.

@0,1,4,5,11,23,42

Logical Operators (in Order of Binding Strength)

  • NOT

  • AND

  • OR

Additionally, parentheses () can be used for grouping:

:A and ( 1 or 10 or 100 ) # select residues 1, 10 and 100 from chain A

Atom Selection in the SilcsBio CLI

The SilcsBio CLI tools that allow users to select specific atoms follow the same atom selection syntax as GROMACS in the command line. This syntax is described in the help menu when entering the command echo h | $GMXDIR/gmx make_ndx -f <structure file>. The syntax is also described here for convenience.

Keywords and Operators

Table 9 Table of Operators

Operators

Description

Usage

Identifiers

nr

Selects an index group by number or quoted string.

1

'a' nr

Selects atoms by index. Atom numbering starts at 1.

'a' 1 2 3 10

'a' name

Selects atoms by atom name.

'a' CA

't' type

Selects atoms by atom type. A run input file is required.

't' CA

'r' nr

Selects residues by number.

'r' 31 44

'r' name

Selects residues by resname.

'r' ASP VAL TRP

'ri' nr

Selects residues by number.

'r' 31 44

'chain' name

Selects atoms by chain identifier(s). Not available for use with .gro file as input.

'chain` A B C

Modifiers

-

Selects indicies within the specified range.

'a' 1-4 'r' 5-10

?

Wildcard that matches any one character

'a' name1? name2?

*

Wildcard allowed at the end of a name to match a pattern of any length

'r' name1* name2*

Logical Operators

'!'

Not.

'! r 1'

'&'

And.

r 1 & 1

'|'

Or.

'r 1 | r 29'

Commands

'name'

Rename group nr to 'name'.

'name' nr name

'del'

Deletes specified group(s).

'del' 1 - 3

'keep'

Deletes all groups except for the specified group.

'keep' 1

'case'

Make all name comparisons case (in)sensitive.

'splitch'

Split specified group into chains using CA distances.

'splitch' 1

'splitres'

Split specified group into residues.

'splitres' 1

'splitat'

Split specified group into atoms.

'splitat'' 1

'res'

Interpret numbers in specified group as residue numbers.

'res' 1

Enter

List currently defined groups and commands.

'l'

List the residues.

'h'

Show the help menu.

'q'

Save and quit

Examples

Table 10 Table of Examples

Selection

Description

2 | 4 & r 3-5

selects all atoms from group 2 and 4 that have residue numbers 3, 4 or 5

a C* & !a C CA

selects all atoms starting with ‘C’ but not the atoms ‘C’ and ‘CA’

"protein" & ! "backb"

selects all atoms that are in group ‘protein’ and not in group ‘backbone’