FreeSASA  2.0.1
Open source SASA calculations
View on GitHub
Selection syntax

FreeSASA uses a subset of the Pymol select commands to give users an easy way of summing up the SASA of groups of atoms. This is done by the function freesasa_selection_new() in the C API, freesasa.selectArea() in the Python interface and the option --select for the command line tool. All commands are case insensitive. A basic selection has a selection name, a property selector and a list of arguments

<selection-name>, <selector> <list>

For example

aromatic, resn phe+tyr+trp+his+pro

Several selectors can be joined using boolean logic and parentheses,

<selection-name>, (<s1> <l1>) and not (<s2> <l2> or <s3> <l3>)

where s1, s2 and s3 are selectors and l1, l2 and l3 are lists. The operator and has precedence over or, so the second parentheses is necessary but not the first, in the example above. The selection name can include letters, numbers and underscores. The name can't be longer than FREESASA_MAX_SELECTION_NAME characters.

The following property selectors are supported

A list of residues can be selected using

resn ala+val+leu+ile+met

and similarly for the other four selectors. In addition resi and chain support ranges

resi 1-10             (residues 1 to 10)
resi -10              (residues indices < 10)
resi 10-              (residues indices > 10)
resi 1-10+20-30+35-   (residues 1 to 10, 20 to 30 and above 35)
resi \-20-\-15+\-10-5 (residues -20 to -15 and -10 to 5)
chain A+C-E           (chains A and C to E, no open intervals allowed here)

Combining ranges with plus signs, as in the three last lines, is not allowed in Pymol but supported by FreeSASA.

If a selection list contains elements not found in the molecule that is analyzed, a warning is printed and that part of the list does not contribute to the selection. Not finding a list element can be because it specifies a residue that does not exist in the particular molecule, or because of typos. The selector does not keep a list of valid elements, residue names, etc.