FreeSASA Python interface. More...
Data Structures | |
class | Classifier |
Assigns class and radius to atom by residue and atom name. More... | |
class | Parameters |
Stores parameter values to be used by calculation. More... | |
class | Result |
Stores results from SASA calculation. More... | |
class | Structure |
Represents a protein structure, including its atomic radii. More... | |
Functions | |
def | structureArray |
Create array of structures from PDB file. More... | |
def | calc |
Calculate SASA of Structure. More... | |
def | classifyResults |
Break SASA result down into classes. More... | |
def | selectArea (commands, structure, result) |
Sum SASA result over a selection of atoms. More... | |
def | setVerbosity (verbosity) |
Set global verbosity. More... | |
def | getVerbosity () |
Get global verbosity. More... | |
def | structureFromBioPDB |
Create a freesasa structure from a Bio.PDB structure. More... | |
def | calcBioPDB |
Calc SASA from Bio.PDB structure. More... | |
Variables | |
string | ShrakeRupley = 'ShrakeRupley' |
Used to specify the algorithm by Shrake & Rupley. | |
string | LeeRichards = 'LeeRichards' |
Used to specify the algorithm by Lee & Richards. | |
string | polar = 'Polar' |
Used for classification. | |
string | apolar = 'Apolar' |
Used for classification. | |
silent = FREESASA_V_SILENT | |
int: Suppress all warnings and errors (used by setVerbosity()) | |
nowarnings = FREESASA_V_NOWARNINGS | |
int: Suppress all warnings but not errors (used by setVerbosity()) | |
normal = FREESASA_V_NORMAL | |
int: Normal verbosity (used by setVerbosity()) | |
debug = FREESASA_V_DEBUG | |
int: Print debug messages (used by setVerbosity()) | |
dictionary | defaultParameters |
The default values for calculation parameters. More... | |
dictionary | defaultStructureArrayOptions |
Default options for structureArray. More... | |
FreeSASA Python interface.
A minimal program would be something like
See documentation of the classes and functions for how to customize behavior
def freesasa.structureArray | ( | fileName, | |
options = defaultStructureArrayOptions , |
|||
classifier = None |
|||
) |
Create array of structures from PDB file.
Split PDB file into several structures by either by treating chains separately, by treating each MODEL as a separate structure, or both.
fileName | (str) The PDB file. |
options | (dict) Specification for how to read the PDB-file (see def value for options). |
classifier | Classifier to assign atoms radii, default is used if none specified. |
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 |
Definition at line 551 of file freesasa.pyx.
def freesasa.calc | ( | structure, | |
parameters = None |
|||
) |
Calculate SASA of Structure.
structure | Structure to be used |
parameters | Parameters to use (if not specified defaults are used) |
Exception | something went wrong in calculation (see C library error messages) |
Definition at line 581 of file freesasa.pyx.
def freesasa.classifyResults | ( | result, | |
structure, | |||
classifier = None |
|||
) |
Break SASA result down into classes.
result | Result from sasa calculation. |
structure | Structure used in calculation. |
classifier | Classifier (if not specified default is used). |
Exception | Problems with classification, see C library error messages (or Python exceptions if run with derived classifier). |
Definition at line 599 of file freesasa.pyx.
def freesasa.selectArea | ( | commands, | |
structure, | |||
result | |||
) |
Sum SASA result over a selection of atoms.
commands | A list of commands with selections using Pymol syntax, e.g. "s1, resn ala+arg" or "s2, chain A and resi 1-5" (see Selection syntax). |
structure | A Structure. |
result | Result from sasa calculation on structure. |
"s1"
,"s2"
,...) as keys, and the corresponding SASA values as values. Exception | Parser failed (typically syntax error), see library error messages. |
Definition at line 620 of file freesasa.pyx.
def freesasa.setVerbosity | ( | verbosity | ) |
Set global verbosity.
verbosity | Can have values freesasa.silent, freesasa.nowarnings or freesasa.normal |
AssertionError | if verbosity has illegal value |
Definition at line 639 of file freesasa.pyx.
def freesasa.getVerbosity | ( | ) |
Get global verbosity.
Definition at line 646 of file freesasa.pyx.
def freesasa.structureFromBioPDB | ( | bioPDBStructure, | |
classifier = None , |
|||
options = Structure.defaultOptions |
|||
) |
Create a freesasa structure from a Bio.PDB structure.
bioPDBStructure | a Bio.PDB structure |
classifier | an optional classifier to specify atomic radii |
options | Options supported are 'hetatm', 'skip-unknown' and 'halt-at-unknown' |
Exception | if option 'halt-at-unknown' is selected and unknown atoms are encountered. Passes on exceptions from Structure.addAtom() and Structure.setRadiiWithClassifier(). |
Definition at line 662 of file freesasa.pyx.
def freesasa.calcBioPDB | ( | bioPDBStructure, | |
parameters = Parameters() , |
|||
classifier = None , |
|||
options = Structure.defaultOptions |
|||
) |
Calc SASA from Bio.PDB structure.
Usage
result, sasa_classes = calcBioPDB(structure, ...)
bioPDBStructure | A Bio.PDB structure |
parameters | A freesasa.Paremeters object |
classifier | A freesasa.Classifier object |
options | Options supported are 'hetatm', 'skip-unknown' and 'halt-at-unknown' |
Exception | if unknown atom is encountered and the option 'halt-at-unknown' is active. Passes on exceptions from calc(), classifyResults() and structureFromBioPDB(). |
Definition at line 712 of file freesasa.pyx.
dictionary freesasa.defaultParameters |
The default values for calculation parameters.
Definition at line 48 of file freesasa.pyx.
dictionary freesasa.defaultStructureArrayOptions |
Default options for structureArray.
Defined separately for Doxygen's sake.
Definition at line 524 of file freesasa.pyx.