FreeSASA  2.0
Open source SASA calculations
View on GitHub
Data Structures | Macros | Enumerations | Functions | Variables
Core

The core functions to perform a calculation. More...

Data Structures

struct  freesasa_parameters
 Struct to store parameters for SASA calculation. More...
 
struct  freesasa_result
 Struct to store results of SASA calculation. More...
 

Macros

#define FREESASA_DEF_ALGORITHM   FREESASA_LEE_RICHARDS
 Default algorithm.
 
#define FREESASA_DEF_PROBE_RADIUS   1.4
 Default probe radius (in Ångström).
 
#define FREESASA_DEF_SR_N   100
 Default number of test points in S&R.
 
#define FREESASA_DEF_LR_N   20
 Default number of slices per atom in L&R.
 
#define freesasa_default_classifier   freesasa_protor_classifier
 Default freesasa_classifier.
 

Enumerations

enum  freesasa_algorithm { FREESASA_LEE_RICHARDS, FREESASA_SHRAKE_RUPLEY }
 The FreeSASA algorithms. More...
 

Functions

freesasa_resultfreesasa_calc_structure (const freesasa_structure *structure, const freesasa_parameters *parameters)
 Calculates SASA based on a given structure. More...
 
freesasa_resultfreesasa_calc_coord (const double *xyz, const double *radii, int n, const freesasa_parameters *parameters)
 Calculates SASA based on a given set of coordinates and radii. More...
 
freesasa_nodefreesasa_calc_tree (const freesasa_structure *structure, const freesasa_parameters *parameters, const char *name)
 Calculates SASA for a structure and returns as a tree of freesasa_node. More...
 
freesasa_nodearea freesasa_result_classes (const freesasa_structure *structure, const freesasa_result *result)
 Results by classes. More...
 
void freesasa_result_free (freesasa_result *result)
 Frees a freesasa_result object. More...
 
int freesasa_set_verbosity (freesasa_verbosity v)
 Set the global verbosity level. More...
 
freesasa_verbosity freesasa_get_verbosity (void)
 Get the current verbosity level. More...
 
void freesasa_set_err_out (FILE *err)
 Set where to write errors. More...
 
FILE * freesasa_get_err_out ()
 Get pointer to error file. More...
 

Variables

const int FREESASA_DEF_NUMBER_THREADS
 Default number of threads. More...
 
const freesasa_parameters freesasa_default_parameters
 The default parameters for FreeSASA.
 

Detailed Description

The core functions to perform a calculation.

Enumeration Type Documentation

The FreeSASA algorithms.

Enumerator
FREESASA_LEE_RICHARDS 

Lee & Richards' algorithm.

FREESASA_SHRAKE_RUPLEY 

Shrake & Rupley's algorithm.

Definition at line 89 of file freesasa.h.

Function Documentation

freesasa_result* freesasa_calc_structure ( const freesasa_structure structure,
const freesasa_parameters parameters 
)

Calculates SASA based on a given structure.

This function allows direct access to the results array, for most users freesasa_calc_tree() is more appropriate.

Return value is dynamically allocated, should be freed with freesasa_result_free().

Parameters
structureThe structure
parametersParameters for the calculation, if NULL defaults are used.
Returns
The result of the calculation, NULL if something went wrong.
freesasa_result* freesasa_calc_coord ( const double *  xyz,
const double *  radii,
int  n,
const freesasa_parameters parameters 
)

Calculates SASA based on a given set of coordinates and radii.

Return value is dynamically allocated, should be freed with freesasa_result_free().

Parameters
xyzArray of coordinates in the form x1,y1,z1,x2,y2,z2,...,xn,yn,zn.
radiiRadii, this array should have n elements..
nNumber of coordinates (i.e. xyz has size 3*n, radii size n).
parametersParameters for the calculation, if NULL defaults are used.
Returns
The result of the calculation, NULL if something went wrong.
freesasa_node* freesasa_calc_tree ( const freesasa_structure structure,
const freesasa_parameters parameters,
const char *  name 
)

Calculates SASA for a structure and returns as a tree of freesasa_node.

Return value is dynamically allocated, should be freed with freesasa_node_free()

Parameters
structureA structure
parametersParameters for the calculation, if NULL, defaults are used.
nameName of input structure to be used in output.
Returns
The result of the calculation, NULL if something went wrong.
freesasa_nodearea freesasa_result_classes ( const freesasa_structure structure,
const freesasa_result result 
)

Results by classes.

Adds up the SASA of Polar/Apolar/Unknown atoms, and main-chain/side-chain atoms for the whole protein. Uses the classes defined by the classifier used when generating the structure.

Parameters
structureThe structure the results are based on
resultThe results
Returns
A struct with all the results.
void freesasa_result_free ( freesasa_result result)

Frees a freesasa_result object.

Parameters
resultthe object to be freed.
int freesasa_set_verbosity ( freesasa_verbosity  v)

Set the global verbosity level.

Parameters
vthe verbosity level
Returns
FREESASA_SUCCESS. If v is invalid FREESASA_FAIL.
See also
freesasa_verbosity
freesasa_verbosity freesasa_get_verbosity ( void  )

Get the current verbosity level.

Returns
the verbosity level.
void freesasa_set_err_out ( FILE *  err)

Set where to write errors.

By default stderr is used, this function can be called to redirect error output elsewhere.

Parameters
errThe file to write to. If NULL, stderr will be used.
FILE* freesasa_get_err_out ( )

Get pointer to error file.

NULL means stderr is used.

Returns
The error file.

Variable Documentation

const int FREESASA_DEF_NUMBER_THREADS

Default number of threads.

Value will depend on if library was compiled with or without thread support. (2 with threads, 1 without)