Skip to content
Snippets Groups Projects
Commit 1e817071 authored by Gabriel Studer's avatar Gabriel Studer
Browse files

Map ASA/ESA onto atoms

Allows to map the asa and esa values calculated by msms onto
the atoms with generic properties using the CalculateSurface
function.
parent effb5ab3
No related branches found
No related tags found
No related merge requests found
...@@ -332,7 +332,8 @@ def CalculateSurfaceVolume(entity, density=1.0, radius=1.5, all_surf=False, ...@@ -332,7 +332,8 @@ def CalculateSurfaceVolume(entity, density=1.0, radius=1.5, all_surf=False,
def CalculateSurface(entity, density=1.0, radius=1.5, all_surf=False, def CalculateSurface(entity, density=1.0, radius=1.5, all_surf=False,
no_hydrogens=False, no_hetatoms=False, no_waters=False, no_hydrogens=False, no_hetatoms=False, no_waters=False,
selection='', selection='',
msms_exe=None, msms_env=None, keep_files=False): msms_exe=None, msms_env=None, keep_files=False,
attach_asa=None, attach_esa=None):
""" """
Calculates molecular surface by using the external MSMS program Calculates molecular surface by using the external MSMS program
...@@ -353,6 +354,8 @@ def CalculateSurface(entity, density=1.0, radius=1.5, all_surf=False, ...@@ -353,6 +354,8 @@ def CalculateSurface(entity, density=1.0, radius=1.5, all_surf=False,
:param msms_exe: msms executable (full path to executable) :param msms_exe: msms executable (full path to executable)
:param msms_env: msms environment variable :param msms_env: msms environment variable
:param keep_files: Do not delete temporary files :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 :returns: list of :class:`~ost.mol.SurfaceHandle` objects
""" """
import os import os
...@@ -385,10 +388,17 @@ def CalculateSurface(entity, density=1.0, radius=1.5, all_surf=False, ...@@ -385,10 +388,17 @@ def CalculateSurface(entity, density=1.0, radius=1.5, all_surf=False,
msms_data_file, msms_data_file, density, radius) msms_data_file, msms_data_file, density, radius)
if all_surf: if all_surf:
command+=" -all" command+=" -all"
if attach_asa != None or attach_esa != None:
command+=" -af %s" % os.path.join(msms_data_dir, "asa_atom")
# run msms # run msms
stdout_value=_RunMSMS(command) stdout_value=_RunMSMS(command)
# add sesa and asa to entity if attach_asa is specified
if attach_asa != None or attach_esa != None:
_ParseAreaFile(entity, selection, os.path.join(msms_data_dir, "asa_atom.area"),
attach_asa, attach_esa)
# parse msms output # parse msms output
num_surf=0 num_surf=0
for line in stdout_value.splitlines(): for line in stdout_value.splitlines():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment