FreeSASA  2.1.2
Open source SASA calculations
View on GitHub
freesasa.h
Go to the documentation of this file.
1#ifndef FREESASA_H
2#define FREESASA_H
3
82#include <stdio.h>
83
84#ifdef __cplusplus
85extern "C" {
86#endif
87
92};
93
94#ifndef __cplusplus
96#endif
97
108};
109
110#ifndef __cplusplus
112#endif
113
114/* Default parameters */
115#define FREESASA_DEF_ALGORITHM FREESASA_LEE_RICHARDS
116#define FREESASA_DEF_PROBE_RADIUS 1.4
117#define FREESASA_DEF_SR_N 100
118#define FREESASA_DEF_LR_N 20
124#define freesasa_default_classifier freesasa_protor_classifier
125
133#define FREESASA_CONFLICTING_CLASSIFIERS "conflicting-classifiers"
134
143const extern int FREESASA_DEF_NUMBER_THREADS;
144
155};
156
164 FREESASA_ATOM_APOLAR = 0,
165 FREESASA_ATOM_POLAR = 1,
166 FREESASA_ATOM_UNKNOWN = 2,
167};
168
169#ifndef __cplusplus
171#endif
172
191};
192
205 FREESASA_LOG = 1 << 5,
206 FREESASA_RSA = 1 << 6,
207 FREESASA_JSON = 1 << 7,
208 FREESASA_XML = 1 << 8,
209 FREESASA_PDB = 1 << 9,
210 FREESASA_RES = 1 << 10,
211 FREESASA_SEQ = 1 << 11,
212 FREESASA_CIF = 1 << 12,
219};
220
226#define FREESASA_MAX_SELECTION_NAME 50
227
238};
239
240#ifndef __cplusplus
242#endif
243
249
261
268 double total;
269 double *sasa;
272};
273
274#ifndef __cplusplus
275typedef struct freesasa_result freesasa_result;
276#endif
277
290 const char *name;
291 double total;
292 double main_chain;
293 double side_chain;
294 double polar;
295 double apolar;
296 double unknown;
297};
298
299#ifndef __cplusplus
301#endif
302
316
317#ifndef __cplusplus
319#endif
320
327 const char *group_PDB;
328 const char auth_asym_id;
329 const char *auth_seq_id;
330 const char *pdbx_PDB_ins_code;
331 const char *auth_comp_id;
332 const char *auth_atom_id;
333 const char *label_alt_id;
334 const char *type_symbol;
335 const double Cartn_x;
336 const double Cartn_y;
337 const double Cartn_z;
338};
339
340#ifndef __cplusplus
342#endif
343
353
362
375
384
393
402
422 const freesasa_parameters *parameters);
423
441freesasa_calc_coord(const double *xyz,
442 const double *radii,
443 int n,
444 const freesasa_parameters *parameters);
445
464 const freesasa_parameters *parameters,
465 const char *name);
466
483 const freesasa_result *result);
484
493
512
521
532double
534 const char *res_name,
535 const char *atom_name);
536
549 const char *res_name,
550 const char *atom_name);
551
560const char *
562
571const char *
573
603freesasa_selection_new(const char *command,
604 const freesasa_structure *structure,
605 const freesasa_result *result);
606
615
624const char *
626
635const char *
637
646double
648
658
669
679
690void freesasa_set_err_out(FILE *err);
691
701FILE *
703
716
725
781 const freesasa_classifier *classifier,
782 int options);
783
813 int *n,
814 const freesasa_classifier *classifier,
815 int options);
816
837 const char *atom_name,
838 const char *residue_name,
839 const char *residue_number,
840 char chain_label,
841 double x, double y, double z);
891 const char *atom_name,
892 const char *residue_name,
893 const char *residue_number,
894 char chain_label,
895 double x, double y, double z,
896 const freesasa_classifier *classifier,
897 int options);
914 freesasa_cif_atom *atom,
915 const freesasa_classifier *classifier,
916 int options);
940 const char *chains,
941 const freesasa_classifier *classifier,
942 int options);
943
952const char *
954
964
980
990
1000const double *
1002
1015 const double *radii);
1016
1032const char *
1034 int i);
1035
1050const char *
1052 int i);
1053
1068const char *
1070 int i);
1071
1084 int i);
1085
1101const char *
1103 int i);
1104
1116double
1118 int i);
1131 int i,
1132 double radius);
1133
1143const char *
1145 int r_i);
1146
1156const char *
1158 int r_i);
1169 int r_i);
1170
1183
1195const double *
1197
1210 int r_i,
1211 int *first,
1212 int *last);
1213
1226 char chain,
1227 int *first,
1228 int *last);
1229
1242 char chain,
1243 int *first,
1244 int *last);
1245
1256const char *
1258
1273
1292 const freesasa_structure *structure,
1293 const char *name);
1294
1312 const freesasa_result *result,
1313 const freesasa_structure *structure,
1314 const char *name);
1315
1331 freesasa_node **tree2);
1332
1345int freesasa_tree_export(FILE *output,
1346 freesasa_node *root,
1347 int options);
1348
1361
1370const freesasa_nodearea *
1372
1386
1397
1408
1419
1436const char *
1438
1447const char *
1449
1459
1469
1478double
1480
1489const char *
1491
1500const char *
1502
1511const char *
1513
1523
1532const char *
1534
1544
1554const freesasa_nodearea *
1556
1566
1576
1586
1595const char *
1597
1607
1616const freesasa_result *
1618
1630const freesasa_selection **
1632
1648 const freesasa_selection *selection);
1657const freesasa_parameters *
1659
1660/* Deprecated functions below, from 1.x API */
1661
1680int freesasa_select_area(const char *command,
1681 char *name,
1682 double *area,
1683 const freesasa_structure *structure,
1684 const freesasa_result *result);
1685
1686void freesasa_structure_set_model(freesasa_structure *structure,
1687 int model);
1688
1689#ifdef __cplusplus
1690}
1691#endif
1692
1693#endif /* FREESASA_H */
freesasa_error_codes
Error codes.
Definition: freesasa.h:151
@ FREESASA_WARN
Something went wrong, but results might still be meaningful (value will always be negative).
Definition: freesasa.h:154
@ FREESASA_SUCCESS
All is ok (value will always be zero).
Definition: freesasa.h:152
@ FREESASA_FAIL
Something went seriously wrong (value will always be negative).
Definition: freesasa.h:153
freesasa_verbosity
Verbosity levels.
Definition: freesasa.h:103
@ FREESASA_V_DEBUG
Print all errors, warnings and debug messages.
Definition: freesasa.h:107
@ FREESASA_V_NORMAL
Print all errors and warnings.
Definition: freesasa.h:104
@ FREESASA_V_SILENT
Print no errors and warnings.
Definition: freesasa.h:106
@ FREESASA_V_NOWARNINGS
Print only errors.
Definition: freesasa.h:105
const freesasa_classifier freesasa_naccess_classifier
NACCESS classifier.
freesasa_classifier * freesasa_classifier_from_file(FILE *file)
Generate a classifier from a config-file.
void freesasa_classifier_free(freesasa_classifier *classifier)
Frees a classifier object.
const char * freesasa_classifier_name(const freesasa_classifier *classifier)
The name of a classifier.
const freesasa_classifier freesasa_oons_classifier
OONS classifier.
freesasa_atom_class
Atom classes.
Definition: freesasa.h:163
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.
const char * freesasa_classifier_class2str(freesasa_atom_class atom_class)
Names for freesasa_atom_class.
const freesasa_classifier freesasa_protor_classifier
ProtOr classifier.
struct freesasa_classifier freesasa_classifier
Classifier struct.
Definition: freesasa.h:374
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.
freesasa_nodearea freesasa_result_classes(const freesasa_structure *structure, const freesasa_result *result)
Results by classes.
FILE * freesasa_get_err_out(void)
Get pointer to error file.
void freesasa_set_err_out(FILE *err)
Set where to write errors.
freesasa_algorithm
The FreeSASA algorithms.
Definition: freesasa.h:89
const int FREESASA_DEF_NUMBER_THREADS
Default number of threads.
freesasa_result * freesasa_calc_structure(const freesasa_structure *structure, const freesasa_parameters *parameters)
Calculates SASA based on a given structure.
int freesasa_set_verbosity(freesasa_verbosity v)
Set the global verbosity level.
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.
freesasa_verbosity freesasa_get_verbosity(void)
Get the current verbosity level.
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.
const freesasa_parameters freesasa_default_parameters
The default parameters for FreeSASA.
void freesasa_result_free(freesasa_result *result)
Frees a freesasa_result object.
@ FREESASA_LEE_RICHARDS
Lee & Richards' algorithm.
Definition: freesasa.h:90
@ FREESASA_SHRAKE_RUPLEY
Shrake & Rupley's algorithm.
Definition: freesasa.h:91
int freesasa_select_area(const char *command, char *name, double *area, const freesasa_structure *structure, const freesasa_result *result)
Get area of a selection.
const char * freesasa_node_atom_residue_number(const freesasa_node *node)
Atom residue number.
freesasa_node * freesasa_node_parent(freesasa_node *node)
The parent of a node.
int freesasa_node_atom_is_polar(const freesasa_node *node)
Is atom polar.
const char * freesasa_node_structure_chain_labels(const freesasa_node *node)
All chain labels in a structure.
int freesasa_node_structure_n_chains(const freesasa_node *node)
The number of chains in a structure.
int freesasa_node_atom_is_mainchain(const freesasa_node *node)
Does atom belong to the main chain/backbone.
int freesasa_node_chain_n_residues(const freesasa_node *node)
The number of residues in a chain.
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.
const char * freesasa_node_residue_number(const freesasa_node *node)
Residue number.
const freesasa_nodearea * freesasa_node_area(const freesasa_node *node)
The freesasa_nodearea of all atoms belonging to a node.
int freesasa_node_structure_model(const freesasa_node *node)
Model number of a structure (from input PDB)
freesasa_node * freesasa_tree_new(void)
Generates empty freesasa_node of type FREESASA_NODE_ROOT.
freesasa_nodetype freesasa_node_type(const freesasa_node *node)
The type of a node.
int freesasa_node_residue_n_atoms(const freesasa_node *node)
Number of atoms in a residue.
char freesasa_node_atom_chain(const freesasa_node *node)
Atom chain.
freesasa_node * freesasa_tree_init(const freesasa_result *result, const freesasa_structure *structure, const char *name)
Init tree based on result and structure.
int freesasa_tree_join(freesasa_node *tree1, freesasa_node **tree2)
Join two trees.
const char * freesasa_node_atom_residue_name(const freesasa_node *node)
Atom residue name.
int freesasa_node_structure_add_selection(freesasa_node *node, const freesasa_selection *selection)
Add a selection result to a structure node.
int freesasa_node_free(freesasa_node *root)
Free tree.
const char * freesasa_node_name(const freesasa_node *node)
The name of a node.
double freesasa_node_atom_radius(const freesasa_node *node)
Atom radius.
const freesasa_result * freesasa_node_structure_result(const freesasa_node *node)
Raw results for a structure.
freesasa_node * freesasa_node_next(freesasa_node *node)
Next sibling of a node.
freesasa_nodetype
Node types.
Definition: freesasa.h:307
const char * freesasa_node_atom_pdb_line(const freesasa_node *node)
Line in PDB atom was generated from.
int freesasa_node_structure_n_atoms(const freesasa_node *node)
The number of atoms in a structure.
const freesasa_selection ** freesasa_node_structure_selections(const freesasa_node *node)
Selection results for a structure.
struct freesasa_node freesasa_node
Result node.
Definition: freesasa.h:352
freesasa_node * freesasa_node_children(freesasa_node *node)
The children of a node.
const char * freesasa_node_classified_by(const freesasa_node *node)
The name of the classifier used to generate the node.
freesasa_output_options
Output options.
Definition: freesasa.h:200
const freesasa_nodearea * freesasa_node_residue_reference(const freesasa_node *node)
The reference area for a node from the classifier used to generate the tree.
const freesasa_parameters * freesasa_node_result_parameters(const freesasa_node *node)
Parameter values used to calculate result.
int freesasa_tree_export(FILE *output, freesasa_node *root, int options)
Outputs result in format specified by options.
@ FREESASA_NODE_STRUCTURE
Structure node.
Definition: freesasa.h:311
@ FREESASA_NODE_ATOM
Atom node.
Definition: freesasa.h:308
@ FREESASA_NODE_CHAIN
Chain node.
Definition: freesasa.h:310
@ FREESASA_NODE_RESULT
Result node, wraps results for one or more related structures.
Definition: freesasa.h:312
@ FREESASA_NODE_NONE
for specifying not a valid node.
Definition: freesasa.h:314
@ FREESASA_NODE_RESIDUE
Residue node.
Definition: freesasa.h:309
@ FREESASA_NODE_ROOT
Root node, wraps one or more unrelated results.
Definition: freesasa.h:313
@ FREESASA_OUTPUT_SKIP_REL
Don't output relative areas, for example if structure has manually set radii, invalidating reference ...
Definition: freesasa.h:218
@ FREESASA_CIF
CIF output with SASA values and SASA radius appended.
Definition: freesasa.h:212
@ FREESASA_XML
XML output.
Definition: freesasa.h:208
@ FREESASA_PDB
PDB output (with B-factors replaced by SASA values, and occupancy by radius).
Definition: freesasa.h:209
@ FREESASA_OUTPUT_ATOM
Output data for atoms, residues, chains and structure.
Definition: freesasa.h:201
@ FREESASA_JSON
JSON output.
Definition: freesasa.h:207
@ FREESASA_LOG
Simple plain text results.
Definition: freesasa.h:205
@ FREESASA_RES
A list of the integrated SASA of each residue type.
Definition: freesasa.h:210
@ FREESASA_SEQ
The SASA of each residue in the sequence.
Definition: freesasa.h:211
@ FREESASA_OUTPUT_CHAIN
Output data for chains and structure.
Definition: freesasa.h:203
@ FREESASA_RSA
RSA output (not affected by atom, residue, etc above).
Definition: freesasa.h:206
@ FREESASA_OUTPUT_RESIDUE
Output data for residues, chains and structure.
Definition: freesasa.h:202
@ FREESASA_OUTPUT_STRUCTURE
Output data only for the whole structure.
Definition: freesasa.h:204
void freesasa_selection_free(freesasa_selection *selection)
Free selection.
freesasa_selection * freesasa_selection_new(const char *command, const freesasa_structure *structure, const freesasa_result *result)
Get area of a selection.
const char * freesasa_selection_command(const freesasa_selection *selection)
Command that was used to generate the selection.
struct freesasa_selection freesasa_selection
Selection struct.
Definition: freesasa.h:361
const char * freesasa_selection_name(const freesasa_selection *selection)
Name of the selection.
int freesasa_selection_n_atoms(const freesasa_selection *selection)
Number of atoms that matched the selection.
double freesasa_selection_area(const freesasa_selection *selection)
Area of the selection.
void freesasa_structure_atom_set_radius(freesasa_structure *structure, int i, double radius)
Set atom radius.
int freesasa_structure_model(const freesasa_structure *structure)
Get model number for structure.
const char * freesasa_structure_atom_symbol(const freesasa_structure *structure, int i)
Get atom symbol.
void freesasa_structure_free(freesasa_structure *structure)
Free structure.
int freesasa_structure_n_residues(const freesasa_structure *structure)
Get number of residues.
freesasa_structure_options
Options for reading structure from PDB.
Definition: freesasa.h:182
char freesasa_structure_atom_chain(const freesasa_structure *structure, int i)
Get chain label.
const char * freesasa_structure_chain_labels(const freesasa_structure *structure)
Get string listing all chains in structure.
freesasa_structure * freesasa_structure_new(void)
Allocate empty structure.
freesasa_structure * freesasa_structure_get_chains(const freesasa_structure *structure, const char *chains, const freesasa_classifier *classifier, int options)
Create new structure consisting of a selection chains from the provided structure.
struct freesasa_structure freesasa_structure
Struct for structure object.
Definition: freesasa.h:260
void freesasa_structure_set_radius(freesasa_structure *structure, const double *radii)
Override the radii set when the structure was initialized.
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.
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.
char freesasa_structure_residue_chain(const freesasa_structure *structure, int r_i)
Get chain residue belongs to.
const double * freesasa_structure_coord_array(const freesasa_structure *structure)
Get array of coordinates.
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.
const char * freesasa_structure_classifier_name(const freesasa_structure *structure)
Name of classifier used to generate structure.
double freesasa_structure_atom_radius(const freesasa_structure *structure, int i)
Get atom radius.
const char * freesasa_structure_residue_name(const freesasa_structure *structure, int r_i)
Get name of residue.
freesasa_structure ** freesasa_structure_array(FILE *pdb, int *n, const freesasa_classifier *classifier, int options)
Init array of structures from PDB.
const char * freesasa_structure_atom_res_number(const freesasa_structure *structure, int i)
Get residue number.
const double * freesasa_structure_radius(const freesasa_structure *structure)
Returns a pointer to an array of the radii of each atom.
int freesasa_structure_n_chains(const freesasa_structure *structure)
Get number of chains.
const char * freesasa_structure_atom_res_name(const freesasa_structure *structure, int i)
Get residue name.
int freesasa_structure_n(const freesasa_structure *structure)
Get number of atoms.
freesasa_structure * freesasa_structure_from_pdb(FILE *pdb, const freesasa_classifier *classifier, int options)
Init structure with coordinates from pdb-file.
const char * freesasa_structure_atom_name(const freesasa_structure *structure, int i)
Get atom name.
int freesasa_structure_add_cif_atom(freesasa_structure *structure, freesasa_cif_atom *atom, const freesasa_classifier *classifier, int options)
Add atoms from a mmCIF file to a structure.
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.
const char * freesasa_structure_residue_number(const freesasa_structure *structure, int r_i)
Get residue number.
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.
@ FREESASA_SEPARATE_MODELS
Read MODELs as separate structures.
Definition: freesasa.h:185
@ FREESASA_SKIP_UNKNOWN
Skip atom when unknown atom is encountered.
Definition: freesasa.h:189
@ FREESASA_INCLUDE_HYDROGEN
Include hydrogen atoms.
Definition: freesasa.h:184
@ FREESASA_RADIUS_FROM_OCCUPANCY
Read atom radius from occupancy field.
Definition: freesasa.h:190
@ FREESASA_JOIN_MODELS
Read MODELs as part of one big structure.
Definition: freesasa.h:187
@ FREESASA_SEPARATE_CHAINS
Read separate chains as separate structures.
Definition: freesasa.h:186
@ FREESASA_INCLUDE_HETATM
Include HETATM entries.
Definition: freesasa.h:183
@ FREESASA_HALT_AT_UNKNOWN
Halt reading when unknown atom is encountered.
Definition: freesasa.h:188
Struct to store data about a mmCIF atom site.
Definition: freesasa.h:326
Struct to store integrated SASA values for either a full structure or a subset thereof.
Definition: freesasa.h:289
double side_chain
Side-chain SASA.
Definition: freesasa.h:293
double apolar
Apolar SASA.
Definition: freesasa.h:295
double main_chain
Main-chain/Backbone SASA.
Definition: freesasa.h:292
double polar
Polar SASA.
Definition: freesasa.h:294
double total
Total SASA.
Definition: freesasa.h:291
const char * name
Name of substructure.
Definition: freesasa.h:290
double unknown
SASA of unknown class (neither polar nor apolar).
Definition: freesasa.h:296
Struct to store parameters for SASA calculation.
Definition: freesasa.h:232
freesasa_algorithm alg
Algorithm.
Definition: freesasa.h:233
int shrake_rupley_n_points
Number of test points in S&R calculation.
Definition: freesasa.h:235
double probe_radius
Probe radius (in Ångström).
Definition: freesasa.h:234
int n_threads
Number of threads to use, if compiled with thread-support.
Definition: freesasa.h:237
int lee_richards_n_slices
Number of slices per atom in L&R calculation.
Definition: freesasa.h:236
Struct to store results of SASA calculation.
Definition: freesasa.h:267
freesasa_parameters parameters
Parameters used when generating result.
Definition: freesasa.h:271
int n_atoms
Number of atoms.
Definition: freesasa.h:270
double * sasa
SASA of each atom in Ångström^2.
Definition: freesasa.h:269
double total
Total SASA in Ångström^2.
Definition: freesasa.h:268