FreeSASA  2.0.1
Open source SASA calculations
View on GitHub
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
freesasa.h File Reference

Functions and datatypes for performing and analyzing SASA calculations. More...

#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  freesasa_parameters
 Struct to store parameters for SASA calculation. More...
 
struct  freesasa_result
 Struct to store results of SASA calculation. More...
 
struct  freesasa_nodearea
 Struct to store integrated SASA values for either a full structure or a subset thereof. 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.
 
#define FREESASA_CONFLICTING_CLASSIFIERS   "conflicting-classifiers"
 String returned by freesasa_structure_classifier_name() when structure was initialized using several different classifiers. More...
 
#define FREESASA_MAX_SELECTION_NAME   50
 The maximum length of a selection name. More...
 

Typedefs

typedef struct freesasa_structure freesasa_structure
 Struct for structure object. More...
 
typedef struct freesasa_node freesasa_node
 A node representing calculation results for a structure, chain, residue or atom in a structure (see Node).
 
typedef struct freesasa_selection freesasa_selection
 Struct to store a selection generated by freesasa_selection_new().
 
typedef struct freesasa_classifier freesasa_classifier
 Struct that can be used to determine classes (polar/apolar) and radii of atoms. More...
 

Enumerations

enum  freesasa_algorithm { FREESASA_LEE_RICHARDS, FREESASA_SHRAKE_RUPLEY }
 The FreeSASA algorithms. More...
 
enum  freesasa_verbosity { FREESASA_V_NORMAL, FREESASA_V_NOWARNINGS, FREESASA_V_SILENT, FREESASA_V_DEBUG }
 Verbosity levels. More...
 
enum  freesasa_error_codes { FREESASA_SUCCESS =0, FREESASA_FAIL =-1, FREESASA_WARN =-2 }
 Error codes. More...
 
enum  freesasa_atom_class { FREESASA_ATOM_APOLAR =0, FREESASA_ATOM_POLAR =1, FREESASA_ATOM_UNKNOWN =2 }
 Atoms can be of the classes Apolar, Polar or Unknown.
 
enum  freesasa_structure_options {
  FREESASA_INCLUDE_HETATM =1, FREESASA_INCLUDE_HYDROGEN =1<<2, FREESASA_SEPARATE_MODELS =1<<3, FREESASA_SEPARATE_CHAINS =1<<4,
  FREESASA_JOIN_MODELS =1<<5, FREESASA_HALT_AT_UNKNOWN =1<<6, FREESASA_SKIP_UNKNOWN =1<<7, FREESASA_RADIUS_FROM_OCCUPANCY =1<<8
}
 Options for reading structure from PDB. More...
 
enum  freesasa_output_options {
  FREESASA_OUTPUT_ATOM =1, FREESASA_OUTPUT_RESIDUE =1<<2, FREESASA_OUTPUT_CHAIN =1<<3, FREESASA_OUTPUT_STRUCTURE =1<<4,
  FREESASA_LOG =1<<5, FREESASA_RSA =1<<6, FREESASA_JSON =1<<7, FREESASA_XML =1<<8,
  FREESASA_PDB =1<<9, FREESASA_RES =1<<10, FREESASA_SEQ =1<<11, FREESASA_OUTPUT_SKIP_REL =1<<12
}
 Controls output format, can be combined in options bitfield in freesasa_tree_export() More...
 
enum  freesasa_nodetype {
  FREESASA_NODE_ATOM, FREESASA_NODE_RESIDUE, FREESASA_NODE_CHAIN, FREESASA_NODE_STRUCTURE,
  FREESASA_NODE_RESULT, FREESASA_NODE_ROOT, FREESASA_NODE_NONE
}
 Node types. 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...
 
freesasa_classifierfreesasa_classifier_from_file (FILE *file)
 Generate a classifier from a config-file. More...
 
void freesasa_classifier_free (freesasa_classifier *classifier)
 Frees a classifier object. More...
 
double freesasa_classifier_radius (const freesasa_classifier *classifier, const char *res_name, const char *atom_name)
 Use a classifier to determine the radius of a given atom. More...
 
freesasa_atom_class freesasa_classifier_class (const freesasa_classifier *classifier, const char *res_name, const char *atom_name)
 Use a classifier to determine the class of a given atom. More...
 
const char * freesasa_classifier_class2str (freesasa_atom_class atom_class)
 Names for freesasa_atom_class. More...
 
const char * freesasa_classifier_name (const freesasa_classifier *classifier)
 The name of a classifier. More...
 
freesasa_selectionfreesasa_selection_new (const char *command, const freesasa_structure *structure, const freesasa_result *result)
 Get area of a selection. More...
 
void freesasa_selection_free (freesasa_selection *selection)
 Free selection. More...
 
const char * freesasa_selection_name (const freesasa_selection *selection)
 Name of the selection. More...
 
const char * freesasa_selection_command (const freesasa_selection *selection)
 Command that was used to generate the selection. More...
 
double freesasa_selection_area (const freesasa_selection *selection)
 Area of the selection. More...
 
int freesasa_selection_n_atoms (const freesasa_selection *selection)
 Number of atoms that matched the selection. 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...
 
freesasa_structurefreesasa_structure_new (void)
 Allocate empty structure. More...
 
void freesasa_structure_free (freesasa_structure *structure)
 Free structure. More...
 
freesasa_structurefreesasa_structure_from_pdb (FILE *pdb, const freesasa_classifier *classifier, int options)
 Init structure with coordinates from pdb-file. More...
 
freesasa_structure ** freesasa_structure_array (FILE *pdb, int *n, const freesasa_classifier *classifier, int options)
 Init array of structures from PDB. More...
 
int freesasa_structure_add_atom (freesasa_structure *structure, const char *atom_name, const char *residue_name, const char *residue_number, char chain_label, double x, double y, double z)
 Add individual atom to structure using default behavior. More...
 
int freesasa_structure_add_atom_wopt (freesasa_structure *structure, const char *atom_name, const char *residue_name, const char *residue_number, char chain_label, double x, double y, double z, const freesasa_classifier *classifier, int options)
 Add individual atom to structure. More...
 
freesasa_structurefreesasa_structure_get_chains (const freesasa_structure *structure, const char *chains)
 Create new structure consisting of a selection chains from the provided structure. More...
 
const char * freesasa_structure_chain_labels (const freesasa_structure *structure)
 Get string listing all chains in structure. More...
 
int freesasa_structure_n (const freesasa_structure *structure)
 Get number of atoms. More...
 
int freesasa_structure_n_residues (const freesasa_structure *structure)
 Get number of residues. More...
 
int freesasa_structure_n_chains (const freesasa_structure *structure)
 Get number of chains. More...
 
const double * freesasa_structure_radius (const freesasa_structure *structure)
 Returns a pointer to an array of the radii of each atom. More...
 
void freesasa_structure_set_radius (freesasa_structure *structure, const double *radii)
 Override the radii set when the structure was initialized. More...
 
const char * freesasa_structure_atom_name (const freesasa_structure *structure, int i)
 Get atom name. More...
 
const char * freesasa_structure_atom_res_name (const freesasa_structure *structure, int i)
 Get residue name. More...
 
const char * freesasa_structure_atom_res_number (const freesasa_structure *structure, int i)
 Get residue number. More...
 
char freesasa_structure_atom_chain (const freesasa_structure *structure, int i)
 Get chain label. More...
 
const char * freesasa_structure_atom_symbol (const freesasa_structure *structure, int i)
 Get atom symbol. More...
 
double freesasa_structure_atom_radius (const freesasa_structure *structure, int i)
 Get atom radius. More...
 
void freesasa_structure_atom_set_radius (freesasa_structure *structure, int i, double radius)
 Set atom radius. More...
 
const char * freesasa_structure_residue_name (const freesasa_structure *structure, int r_i)
 Get name of residue. More...
 
const char * freesasa_structure_residue_number (const freesasa_structure *structure, int r_i)
 Get residue number. More...
 
char freesasa_structure_residue_chain (const freesasa_structure *structure, int r_i)
 Get chain residue belongs to. More...
 
int freesasa_structure_model (const freesasa_structure *structure)
 Get model number for structure. More...
 
const double * freesasa_structure_coord_array (const freesasa_structure *structure)
 Get array of coordinates. More...
 
int freesasa_structure_residue_atoms (const freesasa_structure *structure, int r_i, int *first, int *last)
 Get indices of first and last atoms of a residue. More...
 
int freesasa_structure_chain_atoms (const freesasa_structure *structure, char chain, int *first, int *last)
 Get indices of first and last atoms of a chain. More...
 
int freesasa_structure_chain_residues (const freesasa_structure *structure, char chain, int *first, int *last)
 Get indices of first and last residues of a chain. More...
 
const char * freesasa_structure_classifier_name (const freesasa_structure *structure)
 Name of classifier used to generate structure. More...
 
freesasa_nodefreesasa_tree_new (void)
 Generates empty freesasa_node of type FREESASA_NODE_ROOT. More...
 
freesasa_nodefreesasa_tree_init (const freesasa_result *result, const freesasa_structure *structure, const char *name)
 Init tree based on result and structure. More...
 
int freesasa_tree_add_result (freesasa_node *tree, const freesasa_result *result, const freesasa_structure *structure, const char *name)
 Add a new set of results to a tree. More...
 
int freesasa_tree_join (freesasa_node *tree1, freesasa_node **tree2)
 Join two trees. More...
 
int freesasa_tree_export (FILE *output, freesasa_node *root, int options)
 Outputs result in format specified by options. More...
 
int freesasa_node_free (freesasa_node *root)
 Free tree. More...
 
const freesasa_nodeareafreesasa_node_area (const freesasa_node *node)
 The freesasa_nodearea of all atoms belonging to a node. More...
 
freesasa_nodefreesasa_node_children (freesasa_node *node)
 The children of a node. More...
 
freesasa_nodefreesasa_node_next (freesasa_node *node)
 Next sibling of a node. More...
 
freesasa_nodefreesasa_node_parent (freesasa_node *node)
 The parent of a node. More...
 
freesasa_nodetype freesasa_node_type (const freesasa_node *node)
 The type of a node. More...
 
const char * freesasa_node_name (const freesasa_node *node)
 The name of a node. More...
 
const char * freesasa_node_classified_by (const freesasa_node *node)
 The name of the classifier used to generate the node. More...
 
int freesasa_node_atom_is_polar (const freesasa_node *node)
 Is atom polar. More...
 
int freesasa_node_atom_is_mainchain (const freesasa_node *node)
 Does atom belong to the main chain/backbone. More...
 
double freesasa_node_atom_radius (const freesasa_node *node)
 Atom radius. More...
 
const char * freesasa_node_atom_pdb_line (const freesasa_node *node)
 Line in PDB atom was generated from. More...
 
const char * freesasa_node_residue_number (const freesasa_node *node)
 Residue number. More...
 
int freesasa_node_residue_n_atoms (const freesasa_node *node)
 Number of atoms in a residue. More...
 
const freesasa_nodeareafreesasa_node_residue_reference (const freesasa_node *node)
 The reference area for a node from the classifier used to generate the tree. More...
 
int freesasa_node_chain_n_residues (const freesasa_node *node)
 The number of residues in a chain. More...
 
int freesasa_node_structure_n_chains (const freesasa_node *node)
 The number of chains in a structure. More...
 
int freesasa_node_structure_n_atoms (const freesasa_node *node)
 The number of atoms in a structure. More...
 
const char * freesasa_node_structure_chain_labels (const freesasa_node *node)
 All chain labels in a structure. More...
 
int freesasa_node_structure_model (const freesasa_node *node)
 Model number of a structure (from input PDB) More...
 
const freesasa_resultfreesasa_node_structure_result (const freesasa_node *node)
 Raw results for a structure. More...
 
const freesasa_selection ** freesasa_node_structure_selections (const freesasa_node *node)
 Selection results for a structure. More...
 
int freesasa_node_structure_add_selection (freesasa_node *node, const freesasa_selection *selection)
 Add a selection result to a structure node. More...
 
const freesasa_parametersfreesasa_node_result_parameters (const freesasa_node *node)
 Parameter values used to calculate result. More...
 
int freesasa_select_area (const char *command, char *name, double *area, const freesasa_structure *structure, const freesasa_result *result)
 Get area of a selection. More...
 

Variables

const int FREESASA_DEF_NUMBER_THREADS
 Default number of threads. More...
 
const freesasa_parameters freesasa_default_parameters
 The default parameters for FreeSASA.
 
const freesasa_classifier freesasa_protor_classifier
 Classifier using ProtOr radii and classes.
 
const freesasa_classifier freesasa_naccess_classifier
 Classifier using NACCESS radii and classes.
 
const freesasa_classifier freesasa_oons_classifier
 Classifier using OONS radii and classes.
 

Detailed Description

Functions and datatypes for performing and analyzing SASA calculations.

Author
Simon Mitternacht

This header provides the functions and data types necessary to perform and analyze a SASA calculation using FreeSASA. They are all listed on this page, but also divided into Core, Structure, Classifier, Node and Selection modules. The page FreeSASA API shows how to set up and perform a simple SASA calculation.

Definition in file freesasa.h.

Enumeration Type Documentation

Verbosity levels.

See also
freesasa_set_verbosity()
freesasa_get_verbosity()
Enumerator
FREESASA_V_NORMAL 

Print all errors and warnings.

FREESASA_V_NOWARNINGS 

Print only errors.

FREESASA_V_SILENT 

Print no errors and warnings.

FREESASA_V_DEBUG 

Print all errors, warnings and debug messages.

Definition at line 95 of file freesasa.h.

Error codes.

Can rely upon FREESASA_SUCCESS being 0 and the errors having negative numbers.

Enumerator
FREESASA_SUCCESS 

All is ok (value will always be zero).

FREESASA_FAIL 

Something went seriously wrong (value will always be negative).

FREESASA_WARN 

Something went wrong, but results might still be meaningful (value will always be negative).

Definition at line 123 of file freesasa.h.