Functions¶
Calculate SASA of Structure |
|
Calc SASA from BioPython PDB structure. |
|
Calculate SASA for a set of coordinates and radii |
|
Break SASA result down into classes. |
|
Get global verbosity |
|
Sum SASA result over a selection of atoms |
|
Set global verbosity |
-
freesasa.
calc
()¶ Calculate SASA of Structure
- Parameters
structure –
Structure
to be usedparameters –
Parameters
to use (if not specified defaults are used)
- Returns
The results
- Return type
- Raises
Exception – something went wrong in calculation (see C library error messages)
-
freesasa.
calcBioPDB
()¶ Calc SASA from BioPython PDB structure.
Usage:
result, sasa_classes, residue_areas = calcBioPDB(structure, ...)
Experimental, not thorougly tested yet
- Parameters
bioPDBStructure – A Bio.PDB structure
parameters – A
Parameters
object (uses default if none specified)classifier – A
Classifier
object (uses default if none specified)options (dict) – Options supported are ‘hetatm’, ‘skip-unknown’ and ‘halt-at-unknown’ (uses
Structure.defaultOptions
if none specified
- Returns
A
Result
object, a dictionary with classes defined by the classifier and associated areas, and a dictionary of the type returned byResult.residueAreas()
.- Raises
Exception – if unknown atom is encountered and the option ‘halt-at-unknown’ is active. Passes on exceptions from
calc()
,classifyResults()
andstructureFromBioPDB()
.
-
freesasa.
calcCoord
()¶ Calculate SASA for a set of coordinates and radii
- Parameters
coord (list) – array of size 3*N with atomic coordinates (x1, y1, z1, x2, y2, z2, …, x_N, y_N, z_N).
radii (list) – array of size N with atomic radii (r_1, r_2, …, r_N).
parameters –
Parameters
to use (if not specified, defaults are used)
- Raises
AssertionError – mismatched array-sizes
Exception – Out of memory
Exception – something went wrong in calculation (see C library error messages)
-
freesasa.
classifyResults
()¶ Break SASA result down into classes.
- Parameters
result –
Result
from SASA calculation.structure –
Structure
used in calculation.classifier –
Classifier
to use (if not specified default is used).
- Returns
Dictionary with names of classes as keys and their SASA values as values.
- Return type
dict
- Raises
Exception – Problems with classification, see C library error messages (or Python exceptions if run with derived classifier).
-
freesasa.
getVerbosity
()¶ Get global verbosity
- Returns
Verbosity
silent
,nowarnings
ornormal
- Return type
int
-
freesasa.
setVerbosity
()¶ Set global verbosity
- Parameters
verbosity (int) – Can have values
silent
,nowarnings
ornormal
- Raises
AssertionError – if verbosity has illegal value
-
freesasa.
selectArea
()¶ Sum SASA result over a selection of atoms
- Parameters
commands (list) – A list of commands with selections using Pymol syntax, e.g.
"s1, resn ala+arg"
or"s2, chain A and resi 1-5"
. See select-syntax.structure – A
Structure
.result –
Result
from sasa calculation on structure.
- Returns
Dictionary with names of selections (
"s1"
,"s2"
, …) as keys, and the corresponding SASA values as values.- Return type
dict
- Raises
Exception – Parser failed (typically syntax error), see library error messages.
-
freesasa.
structureArray
()¶ Create array of structures from PDB file.
Split PDB file into several structures by either by treating chains separately and/or by treating each MODEL as a separate structure and/or grouping chains.
- Parameters
fileName (str) – The PDB file.
options (dict) – Specification for how to read the PDB-file (see
Structure.defaultStructureArrayOptions
for options and default value).classifier –
Classifier
to assign atoms radii, default is used if none specified.
- Returns
An array of
Structure
- Return type
list
- Raises
AssertionError – if fileName is None
AssertionError – if an option value is not recognized
AssertionError – if neither of the options ‘separate-chains’ and ‘separate-models’ are specified.
IOError – if can’t open file
Exception – if there are problems parsing the input
-
freesasa.
structureFromBioPDB
()¶ Create a freesasa structure from a Bio.PDB structure
Experimental, not thorougly tested yet. Structures generated this way will not preserve whitespace in residue numbers, etc, as in
Structure
.- Parameters
bioPDBStructure – a Bio.PDB structure
classifier – an optional
Classifier
to specify atomic radiioptions (dict) – Options supported are ‘hetatm’, ‘skip-unknown’ and ‘halt-at-unknown’
- Returns
The structure
- Return type
- Raises
Exception – if option ‘halt-at-unknown’ is selected and unknown atoms are encountered. Passes on exceptions from
Structure.addAtom()
andStructure.setRadiiWithClassifier()
.