If Python is enabled using
$ ./configure --enable-python-bindings
Cython is used to build Python bindings for FreeSASA, and make install
will install them.
Below follow some illustrations of how to use the package, see the package documentation for details.
Using defaults everywhere a simple calculation can be carried out as follows (assuming the PDB structure 1UBQ is available)
Which would give the following output
Total : 4804.06 A2 Polar : 2504.22 A2 Apolar : 2299.84 A2
The following does a high precision L&R calculation
Using the results from a calculation we can also integrate SASA over a selection of atoms, using a subset of the Pymol selection syntax (see Selection syntax):
which gives the output
alanine : 120.08 A2 r1_10 : 634.31 A2
This uses the NACCESS parameters (the file 'naccess.config' is available in the share/ directory of the repository).
Classification can be customized also by extending the Classifier interface. The code below is an illustration of a classifier that classes Nitrogens separately, and assigns radii based on element only (and crudely).
Of course, this example is somewhat contrived, if we only want the integrated area of Nitrogen atoms, the simpler choice would be
However, extending freesasa.Classifier, as illustrated above, allows classification to arbitrary complexity and also lets us redefine the radii used in the calculation.
FreeSASA can also calculate the SASA of a Bio.PDB structure
If one needs more control over the analysis the structure can be converted to a freesasa.Structure using freesasa.structureFromBioPDB() and the calculation can be performed the normal way using this structure.