FreeSASA
2.1.2
Open source SASA calculations
|
View on GitHub |
Represent results as a tree. More...
Data Structures | |
struct | freesasa_nodearea |
Struct to store integrated SASA values for either a full structure or a subset thereof. More... | |
Typedefs | |
typedef struct freesasa_node | freesasa_node |
Result node. More... | |
Enumerations | |
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_CIF = 1 << 12 , FREESASA_OUTPUT_SKIP_REL = 1 << 13 } |
Output options. 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_node * | freesasa_tree_new (void) |
Generates empty freesasa_node of type FREESASA_NODE_ROOT. More... | |
freesasa_node * | freesasa_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_nodearea * | freesasa_node_area (const freesasa_node *node) |
The freesasa_nodearea of all atoms belonging to a node. More... | |
freesasa_node * | freesasa_node_children (freesasa_node *node) |
The children of a node. More... | |
freesasa_node * | freesasa_node_next (freesasa_node *node) |
Next sibling of a node. More... | |
freesasa_node * | freesasa_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_atom_residue_number (const freesasa_node *node) |
Atom residue number. More... | |
const char * | freesasa_node_atom_residue_name (const freesasa_node *node) |
Atom residue name. More... | |
char | freesasa_node_atom_chain (const freesasa_node *node) |
Atom chain. 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_nodearea * | freesasa_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_result * | freesasa_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_parameters * | freesasa_node_result_parameters (const freesasa_node *node) |
Parameter values used to calculate result. More... | |
Represent results as a tree.
Results are represented hierarchically as a tree with the following levels (see also freesasa_node_type)
The tree can be traversed using freesasa_node_children(), freesasa_node_next() and freesasa_node_parent(). The type of a node is determined by freesasa_node_type(). There are some properties that are common to all or most levels of the tree. These accessors simply have the prefix freesasa_node
, like for example freesasa_node_name() and the above-mentioned functions. Other properties are specific to a special level, and then the prefix of the accessor functions will be freesasa_node_atom
or freesasa_node_structure
, etc. The class of an atom can for example be accessed using freesasa_node_atom_is_polar().
The nodes of a tree are to be considered read-only, and changes are made only to the root node, initialized using freesasa_tree_new() or freesasa_tree_init(), and modified using freesasa_tree_add_result(), freesasa_tree_join(). The one exception where a lower level node can be modified is freesasa_node_structure_add_selection().
typedef struct freesasa_node freesasa_node |
Result node.
A node representing calculation results for a structure, chain, residue or atom in a structure (see Node).
Definition at line 352 of file freesasa.h.
Output options.
Controls output format, can be combined in options bitfield in freesasa_tree_export()
Definition at line 200 of file freesasa.h.
enum freesasa_nodetype |
Node types.
Definition at line 307 of file freesasa.h.
freesasa_node * freesasa_tree_new | ( | void | ) |
Generates empty freesasa_node of type FREESASA_NODE_ROOT.
To be populated by freesasa_tree_add_result().
The return value is dynamically allocated and should be freed using freesasa_node_free().
NULL
if memory allocation fails. freesasa_node * freesasa_tree_init | ( | const freesasa_result * | result, |
const freesasa_structure * | structure, | ||
const char * | name | ||
) |
Init tree based on result and structure.
The return value is dynamically allocated and should be freed using freesasa_node_free().
result | A result. |
structure | A structure. |
name | Name of the results (typically filename from which structure is derived) |
NULL
if memory allocation fails. 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.
Tree should first be initiated with freesasa_calc_tree(), freesasa_tree_new() or freesasa_tree_init().
tree | Node of type FREESASA_NODE_ROOT. Tree to add results to. |
result | SASA values for the structure |
structure | The structure the results are based on |
name | The name to use for the result |
int freesasa_tree_join | ( | freesasa_node * | tree1, |
freesasa_node ** | tree2 | ||
) |
Join two trees.
Allows joining several calculations into one output file.
tree1 | Node of type FREESASA_NODE_ROOT. The joint tree will be stored here. |
tree2 | Node of type FREESASA_NODE_ROOT. Will be added to tree1, and then changed to NULL , since ownership of its contents have been transferred to tree1. |
int freesasa_tree_export | ( | FILE * | output, |
freesasa_node * | root, | ||
int | options | ||
) |
Outputs result in format specified by options.
output | Output file. |
root | Structure tree containing results. Node of type FREESASA_NODE_ROOT. |
options | Bitfield specifying output format, see freesasa_output_options. |
int freesasa_node_free | ( | freesasa_node * | root | ) |
Free tree.
Will not free anything if the node is not a root node.
root | Node of type FREESASA_NODE_ROOT |
const freesasa_nodearea * freesasa_node_area | ( | const freesasa_node * | node | ) |
The freesasa_nodearea of all atoms belonging to a node.
node | The node. |
NULL
if no area has been attached to this node. freesasa_node * freesasa_node_children | ( | freesasa_node * | node | ) |
The children of a node.
Use freesasa_node_next() to access next sibling.
node | The node. |
NULL
if the node has no children. freesasa_node * freesasa_node_next | ( | freesasa_node * | node | ) |
Next sibling of a node.
node | The node. |
NULL
if this is the last node. freesasa_node * freesasa_node_parent | ( | freesasa_node * | node | ) |
The parent of a node.
node | The node. |
NULL
if the node has no parent. freesasa_nodetype freesasa_node_type | ( | const freesasa_node * | node | ) |
The type of a node.
node | The node. |
const char * freesasa_node_name | ( | const freesasa_node * | node | ) |
The name of a node.
The node types will have the following names:
" CA "
, " OXT"
, etc."ALA"
, "ARG"
, etc."A"
, "B"
, etc."A"
, "ABC"
, etc"stdin"
)NULL
node | The node. |
NULL
if the node has no name. const char * freesasa_node_classified_by | ( | const freesasa_node * | node | ) |
The name of the classifier used to generate the node.
node | A node of type FREESASA_NODE_RESULT. |
int freesasa_node_atom_is_polar | ( | const freesasa_node * | node | ) |
int freesasa_node_atom_is_mainchain | ( | const freesasa_node * | node | ) |
Does atom belong to the main chain/backbone.
node | A node of type FREESASA_NODE_ATOM. |
double freesasa_node_atom_radius | ( | const freesasa_node * | node | ) |
const char * freesasa_node_atom_pdb_line | ( | const freesasa_node * | node | ) |
Line in PDB atom was generated from.
node | A node of type FREESASA_NODE_ATOM. |
NULL
if atom wasn't taken from PDB file. const char * freesasa_node_atom_residue_number | ( | const freesasa_node * | node | ) |
Atom residue number.
node | A node of type FREESASA_NODE_ATOM. |
const char * freesasa_node_atom_residue_name | ( | const freesasa_node * | node | ) |
Atom residue name.
node | A node of type FREESASA_NODE_ATOM. |
char freesasa_node_atom_chain | ( | const freesasa_node * | node | ) |
Atom chain.
node | A node of type FREESASA_NODE_ATOM. |
const char * freesasa_node_residue_number | ( | const freesasa_node * | node | ) |
Residue number.
node | A node of type FREESASA_NODE_RESIDUE. |
int freesasa_node_residue_n_atoms | ( | const freesasa_node * | node | ) |
Number of atoms in a residue.
node | A node of type FREESASA_NODE_RESIDUE. |
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.
node | A node of type FREESASA_NODE_RESIDUE. |
NULL
if area not available. int freesasa_node_chain_n_residues | ( | const freesasa_node * | node | ) |
The number of residues in a chain.
node | A node of type FREESASA_NODE_CHAIN. |
int freesasa_node_structure_n_chains | ( | const freesasa_node * | node | ) |
The number of chains in a structure.
node | A node of type FREESASA_NODE_STRUCTURE. |
int freesasa_node_structure_n_atoms | ( | const freesasa_node * | node | ) |
The number of atoms in a structure.
node | A node of type FREESASA_NODE_STRUCTURE. |
const char * freesasa_node_structure_chain_labels | ( | const freesasa_node * | node | ) |
All chain labels in a structure.
node | A node of type FREESASA_NODE_STRUCTURE. |
int freesasa_node_structure_model | ( | const freesasa_node * | node | ) |
Model number of a structure (from input PDB)
node | A node of type FREESASA_NODE_STRUCTURE. |
const freesasa_result * freesasa_node_structure_result | ( | const freesasa_node * | node | ) |
Raw results for a structure.
node | A node of type FREESASA_NODE_STRUCTURE. |
const freesasa_selection ** freesasa_node_structure_selections | ( | const freesasa_node * | node | ) |
Selection results for a structure.
Generated using freesasa_node_structure_add_selection().
node | A node of type FREESASA_NODE_STRUCTURE. |
NULL
if no selections were associated with structure. int freesasa_node_structure_add_selection | ( | freesasa_node * | node, |
const freesasa_selection * | selection | ||
) |
Add a selection result to a structure node.
The selection is cloned, so the user can call freesasa_selection_free() on the provided selection at the time of their chosing.
node | A node of type FREESASA_NODE_STRUCTURE. |
selection | A selection. |
const freesasa_parameters * freesasa_node_result_parameters | ( | const freesasa_node * | node | ) |
Parameter values used to calculate result.
node | A node of type FREESASA_NODE_RESULT |