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

Solvent Accessibility after Lee and Richards

It's basically a clone of NACCESS. The current function interface
mimics the interface from the naccess binding.

The problem with NACCESS is the size limitation of the input. It also
allocates tons of memory it doesn't need. The C++ implementation should
be much more careful with the memory and thus allows has much higher
limits for the input size. It's also faster due to less io (no dump
of pdb file on HD as input for NACCESS). On my machine, the speed
increase is roughly 2x.

The results have been checked for equality with NACCESS on a large
set of structures.

Fails have been observed in:

- structures containing hydrogens:
Bug in NACCESS... Example: the hydrogen hanging at the CG2 of THR
are called HG21, HG22 and HG23 => four letters and the atom name
already starts at position 13 in the according line in the PDB file.
NACCESS checks if position 14 is either H or D to detect a hydrogen.
This fails in this case (letter at pos 14 is G). Since its an "unknown"
atom, the hydrogen gets treated as carbon with VdW radius 1.80.
Example in THR.383.A in pdb entry 4DKK

- structures containing alt locations
Maybe different handling of which alternative is actually active.
Has to be further evaluated.
parent 8e3e2a56
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ set(OST_MOL_ALG_PYMOD_SOURCES ...@@ -5,6 +5,7 @@ set(OST_MOL_ALG_PYMOD_SOURCES
export_trajectory_analysis.cc export_trajectory_analysis.cc
export_structure_analysis.cc export_structure_analysis.cc
export_contact_overlap.cc export_contact_overlap.cc
export_accessibility.cc
) )
set(OST_MOL_ALG_PYMOD_MODULES set(OST_MOL_ALG_PYMOD_MODULES
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2017 by the OpenStructure authors
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 3.0 of the License, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//------------------------------------------------------------------------------
#include <boost/python.hpp>
#include <ost/mol/alg/accessibility.hh>
using namespace boost::python;
namespace{
Real WrapAccessibilityHandle(ost::mol::EntityHandle& ent,
Real probe_radius,
bool include_hydrogens,
bool include_hetatm,
bool include_water,
const String& selection,
const String& asa_abs,
const String& asa_rel,
const String& asa_atom) {
return ost::mol::alg::Accessibility(ent, probe_radius, include_hydrogens,
include_hetatm, include_water,
selection, asa_abs, asa_rel, asa_atom);
}
Real WrapAccessibilityView(ost::mol::EntityView& ent,
Real probe_radius,
bool include_hydrogens,
bool include_hetatm,
bool include_water,
const String& selection,
const String& asa_abs, const String& asa_rel,
const String& asa_atom) {
return ost::mol::alg::Accessibility(ent, probe_radius, include_hydrogens,
include_hetatm, include_water,
selection, asa_abs, asa_rel, asa_atom);
}
} // ns
void export_accessibility() {
def("Accessibility", WrapAccessibilityHandle, (arg("ent"),
arg("probe_radius")=1.4,
arg("include_hydrogens")=false,
arg("include_hetatm")=false,
arg("include_water")=false,
arg("selection")="",
arg("asa_abs")="asaAbs",
arg("asa_rel")="asaRel",
arg("asa_atom")="asaAtom"));
def("Accessibility", WrapAccessibilityView, (arg("ent"),
arg("probe_radius")=1.4,
arg("include_hydrogens")=false,
arg("include_hetatm")=false,
arg("include_water")=false,
arg("selection")="",
arg("asa_abs")="asaAbs",
arg("asa_rel")="asaRel",
arg("asa_atom")="asaAtom"));
}
...@@ -40,6 +40,7 @@ void export_TrajectoryAnalysis(); ...@@ -40,6 +40,7 @@ void export_TrajectoryAnalysis();
void export_StructureAnalysis(); void export_StructureAnalysis();
void export_Clash(); void export_Clash();
void export_contact_overlap(); void export_contact_overlap();
void export_accessibility();
#if OST_IMG_ENABLED #if OST_IMG_ENABLED
void export_entity_to_density(); void export_entity_to_density();
#endif #endif
...@@ -109,6 +110,7 @@ BOOST_PYTHON_MODULE(_ost_mol_alg) ...@@ -109,6 +110,7 @@ BOOST_PYTHON_MODULE(_ost_mol_alg)
export_StructureAnalysis(); export_StructureAnalysis();
export_Clash(); export_Clash();
export_contact_overlap(); export_contact_overlap();
export_accessibility();
#if OST_IMG_ENABLED #if OST_IMG_ENABLED
export_entity_to_density(); export_entity_to_density();
#endif #endif
......
...@@ -18,6 +18,7 @@ set(OST_MOL_ALG_HEADERS ...@@ -18,6 +18,7 @@ set(OST_MOL_ALG_HEADERS
contact_overlap.hh contact_overlap.hh
domain_find.hh domain_find.hh
similarity_matrix.hh similarity_matrix.hh
accessibility.hh
) )
set(OST_MOL_ALG_SOURCES set(OST_MOL_ALG_SOURCES
...@@ -39,6 +40,7 @@ set(OST_MOL_ALG_SOURCES ...@@ -39,6 +40,7 @@ set(OST_MOL_ALG_SOURCES
contact_overlap.cc contact_overlap.cc
domain_find.cc domain_find.cc
similarity_matrix.cc similarity_matrix.cc
accessibility.cc
) )
set(MOL_ALG_DEPS ost_mol ost_seq) set(MOL_ALG_DEPS ost_mol ost_seq)
......
This diff is collapsed.
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2017 by the OpenStructure authors
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 3.0 of the License, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//------------------------------------------------------------------------------
#ifndef OST_ACCESSIBILITY_HH
#define OST_ACCESSIBILITY_HH
#include <ost/mol/entity_view.hh>
#include <ost/mol/entity_handle.hh>
namespace ost { namespace mol { namespace alg {
class NACCESSParam {
public:
// Singleton access to one constant instance
static const NACCESSParam& GetInstance() {
static NACCESSParam instance;
return instance;
}
// Data access
Real GuessRadius(const String& ele) const;
Real GetVdWRadius(const String& rname, const String& aname,
const String& ele) const;
Real GetResidueAccessibility(const String& rname) const;
private:
// construction only inside here
NACCESSParam();
std::map<String, std::map<String, Real> > vdw_radii_;
std::map<String, Real> accessibilities_;
};
Real Accessibility(ost::mol::EntityView& ent,
Real probe_radius = 1.4,
bool include_hydrogens = false,
bool include_hetatm = false,
bool include_water = false,
const String& selection = "",
const String& asa_abs = "asaAbs",
const String& asa_rel = "asaRel",
const String& asa_atom = "asaAtom");
Real Accessibility(ost::mol::EntityHandle& ent,
Real probe_radius = 1.4,
bool include_hydrogens = false,
bool include_hetatm = false,
bool include_water = false,
const String& selection = "",
const String& asa_abs = "asaAbs",
const String& asa_rel = "asaRel",
const String& asa_atom = "asaAtom");
}}} //ns
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment