OpenStructure
Loading...
Searching...
No Matches
Data Structures | Functions
ost.bindings.msms Namespace Reference

Data Structures

class  MsmsProcessError
 

Functions

 GetVersion (msms_exe=None, msms_env=None)
 
 _GetExecutable (msms_exe, msms_env)
 
 _SetupFiles (entity, selection)
 
 _ParseAreaFile (entity, selection, file, asa_prop, esa_prop)
 
 _CleanupFiles (dir_name)
 
 _RunMSMS (command)
 
 CalculateSurfaceArea (entity, density=1.0, radius=1.5, all_surf=False, no_hydrogens=False, no_hetatoms=False, no_waters=False, selection='', msms_exe=None, msms_env=None, keep_files=False, attach_asa=None, attach_esa=None)
 
 CalculateSurfaceVolume (entity, density=1.0, radius=1.5, all_surf=False, no_hydrogens=False, no_hetatoms=False, no_waters=False, selection='', msms_exe=None, msms_env=None, keep_files=False, attach_asa=None, attach_esa=None)
 
 CalculateSurface (entity, density=1.0, radius=1.5, all_surf=False, no_hydrogens=False, no_hetatoms=False, no_waters=False, selection='', msms_exe=None, msms_env=None, keep_files=False, attach_asa=None, attach_esa=None)
 

Detailed Description

MSMS module

Author: Tobias Schmidt

This module is for calculating MSMS surfaces as well as surface areas
(SESA, SASA) from OpenStructure using the external program MSMS.

How To Use This Module:
 1. Import it (e.g. as "from ost.bindings import msms")
 2. Use it (e.g. as "surfaces_list = msms.CalculateSurface(entity)"
                    "(sesa,sasa) = msms.CalculateSurfaceArea(entity)")

Requirement:
 - MSMS installed

Function Documentation

◆ _CleanupFiles()

_CleanupFiles (   dir_name)
protected
Function which recursively deletes a directory and all the files contained
in it. *Warning*: This method removes also non-empty directories without
asking, so be careful!

Definition at line 132 of file msms.py.

◆ _GetExecutable()

_GetExecutable (   msms_exe,
  msms_env 
)
protected
Function to check if MSMS executable is present

:param msms_exe: Explicit path to msms executable
:param msms_env: Environment variable pointing to msms executable
:returns: Path to the executable
:raises:  :class:`~ost.FileNotFound` if executable is not found

Definition at line 59 of file msms.py.

◆ _ParseAreaFile()

_ParseAreaFile (   entity,
  selection,
  file,
  asa_prop,
  esa_prop 
)
protected
 Reads Area file (-af) and attach sasa and sesa per atom to an entitiy

:param entity:   :class:`~ost.mol.EntityHandle` or :class:`~ost.mol.EntityView`
                 for attaching sasa and sesa on atom level
:param file:     Filename of area file
:param asa_prop: Name of the float property for SASA
:param esa_prop: Name of the float property for SESA
:raises: :class:`RuntimeError` if number of atoms in file != number of atoms in entity

Definition at line 103 of file msms.py.

◆ _RunMSMS()

_RunMSMS (   command)
protected
Run the MSMS surface calculation

This functions starts the external MSMS executable and returns the stdout of
MSMS.

:param command:          Command to execute
:returns:                 stdout of MSMS
:raises:              :class:`CalledProcessError` for non-zero return value

Definition at line 141 of file msms.py.

◆ _SetupFiles()

_SetupFiles (   entity,
  selection 
)
protected
Setup files for MSMS calculation in temporary directory

:param entity: The entity for which the surface is to be calculated
:type entity: :class:`~ost.mol.EntityHandle` or :class:`~ost.mol.EntityHandle`
:param selection:  Calculate surface for subset of entity
:type selection: :class:`str`
:returns: tuple containing temporary directory and msms input file
:raises:         :class:`RuntimeError` if selection is not valid

Definition at line 72 of file msms.py.

◆ CalculateSurface()

CalculateSurface (   entity,
  density = 1.0,
  radius = 1.5,
  all_surf = False,
  no_hydrogens = False,
  no_hetatoms = False,
  no_waters = False,
  selection = '',
  msms_exe = None,
  msms_env = None,
  keep_files = False,
  attach_asa = None,
  attach_esa = None 
)
Calculates molecular surface by using the external MSMS program

This method calculates a molecular surface by invoking the external program
MSMS. First, it is checked if the MSMS executable is present, then, the
necessary files are prepared in a temporary directory and MSMS is executed.
The last step is to remove the temporary directory.


:param entity:        Entity for which the surface is to be calculated
:param density:       Surface point density
:param radius:        Surface probe radius
:param all_surf:      Calculate surface for all cavities (returns multiple
                      surfaces as a list)
:param no_hydrogens:  Calculate surface only for heavy atoms
:param selection:     Calculate surface for subset of entity
:param msms_exe:      msms executable (full path to executable)
:param msms_env:      msms environment variable
:param keep_files:    Do not delete temporary files
:param attach_asa:    Attaches per atom SASA to specified FloatProp at atom level
:param attach_esa:    Attaches per atom SESA to specified FloatProp at atom level
:returns:             list of :class:`~ost.mol.SurfaceHandle` objects

Definition at line 332 of file msms.py.

◆ CalculateSurfaceArea()

CalculateSurfaceArea (   entity,
  density = 1.0,
  radius = 1.5,
  all_surf = False,
  no_hydrogens = False,
  no_hetatoms = False,
  no_waters = False,
  selection = '',
  msms_exe = None,
  msms_env = None,
  keep_files = False,
  attach_asa = None,
  attach_esa = None 
)
Calculates analytical solvent excluded and solvent accessible surface
area by using the external MSMS program.

This method calculates the molecular surface areas by invoking the external
program MSMS. First, it is checked if the MSMS executable is present, then,
the necessary files are prepared in a temporary directory and MSMS is
executed. The last step is to remove the temporary directory.


:param entity:        OST entity to calculate surface
:param density:       Surface point density
:param radius:       Surface probe radius
:param all_surf:      Calculate surface area for all cavities (returns multiple
    surfaces areas as a list)
:param no_hydrogens:  Calculate surface only for hevy atoms
:param selection:     Calculate surface for subset of entity
:param msms_exe:      msms executable (full path to executable)
:param msms_env:      msms environment variable
:param keep_files:    Do not delete temporary files
:param attach_asa:    Attaches per atom SASA to specified FloatProp at atom level
:param attach_esa:    Attaches per atom SESA to specified FloatProp at atom level
:returns:             Tuple of lists for (SES, SAS)

Definition at line 164 of file msms.py.

◆ CalculateSurfaceVolume()

CalculateSurfaceVolume (   entity,
  density = 1.0,
  radius = 1.5,
  all_surf = False,
  no_hydrogens = False,
  no_hetatoms = False,
  no_waters = False,
  selection = '',
  msms_exe = None,
  msms_env = None,
  keep_files = False,
  attach_asa = None,
  attach_esa = None 
)
Calculates the volume of the solvent excluded surface by using the external MSMS program.

This method calculates the volume of the molecular surface by invoking the external
program MSMS. First, it is checked if the MSMS executable is present, then,
the necessary files are prepared in a temporary directory and MSMS is
executed. The last step is to remove the temporary directory.


:param entity:        OST entity to calculate surface
:param density:       Surface point density
:param radius:       Surface probe radius
:param all_surf:      Calculate surface area for all cavities (returns multiple
    surfaces areas as a list)
:param no_hydrogens:  Calculate surface only for hevy atoms
:param selection:     Calculate surface for subset of entity
:param msms_exe:      msms executable (full path to executable)
:param msms_env:      msms environment variable
:param keep_files:    Do not delete temporary files
:param attach_asa:    Attaches per atom SASA to specified FloatProp at atom level
:param attach_esa:    Attaches per atom SESA to specified FloatProp at atom level
:returns:             Tuple of lists for (SES, SAS)

Definition at line 252 of file msms.py.

◆ GetVersion()

GetVersion (   msms_exe = None,
  msms_env = None 
)
Get version of MSMS executable

Definition at line 40 of file msms.py.