Skip to content
Snippets Groups Projects
Commit 3e02346f authored by Niklaus Johner's avatar Niklaus Johner
Browse files

Added a function to compute how well an EntityView superposes with

a denisty map
parent 939a3710
Branches
Tags
No related merge requests found
...@@ -3,12 +3,14 @@ set(OST_MOL_ALG_PYMOD_SOURCES ...@@ -3,12 +3,14 @@ set(OST_MOL_ALG_PYMOD_SOURCES
export_svd_superpose.cc export_svd_superpose.cc
export_clash.cc export_clash.cc
export_trajectory_analysis.cc export_trajectory_analysis.cc
export_structure_analysis.cc
) )
set(OST_MOL_ALG_PYMOD_MODULES set(OST_MOL_ALG_PYMOD_MODULES
"__init__.py" "__init__.py"
views.py views.py
superpose.py superpose.py
structure_analysis.py
) )
if (ENABLE_IMG) if (ENABLE_IMG)
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2011 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>
using namespace boost::python;
#include <ost/mol/alg/structure_analysis.hh>
using namespace ost;
using namespace ost::mol::alg;
void export_StructureAnalysis()
{
def("GetPosListFromView",&GetPosListFromView, (arg("view")));
def("CalculateAgreementWithDensityMap",&CalculateAgreementWithDensityMap,(arg("pos_list"),arg("density_map")));
}
...@@ -27,6 +27,7 @@ using namespace ost; ...@@ -27,6 +27,7 @@ using namespace ost;
void export_svdSuperPose(); void export_svdSuperPose();
void export_TrajectoryAnalysis(); void export_TrajectoryAnalysis();
void export_StructureAnalysis();
void export_Clash(); void export_Clash();
#if OST_IMG_ENABLED #if OST_IMG_ENABLED
void export_entity_to_density(); void export_entity_to_density();
...@@ -48,6 +49,7 @@ BOOST_PYTHON_MODULE(_ost_mol_alg) ...@@ -48,6 +49,7 @@ BOOST_PYTHON_MODULE(_ost_mol_alg)
{ {
export_svdSuperPose(); export_svdSuperPose();
export_TrajectoryAnalysis(); export_TrajectoryAnalysis();
export_StructureAnalysis();
#if OST_IMG_ENABLED #if OST_IMG_ENABLED
export_entity_to_density(); export_entity_to_density();
#endif #endif
......
...@@ -8,6 +8,7 @@ set(OST_MOL_ALG_HEADERS ...@@ -8,6 +8,7 @@ set(OST_MOL_ALG_HEADERS
construct_cbeta.hh construct_cbeta.hh
clash_score.hh clash_score.hh
trajectory_analysis.hh trajectory_analysis.hh
structure_analysis.hh
) )
set(OST_MOL_ALG_SOURCES set(OST_MOL_ALG_SOURCES
...@@ -19,6 +20,7 @@ set(OST_MOL_ALG_SOURCES ...@@ -19,6 +20,7 @@ set(OST_MOL_ALG_SOURCES
filter_clashes.cc filter_clashes.cc
construct_cbeta.cc construct_cbeta.cc
trajectory_analysis.cc trajectory_analysis.cc
structure_analysis.cc
) )
set(MOL_ALG_DEPS ost_mol ost_seq) set(MOL_ALG_DEPS ost_mol ost_seq)
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2011 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
//------------------------------------------------------------------------------
/*
* Author Niklaus Johner
*/
#include <ost/base.hh>
#include <ost/mol/mol.hh>
#include "structure_analysis.hh"
namespace ost { namespace mol { namespace alg {
geom::Vec3List GetPosListFromView(const EntityView& view){
CheckHandleValidity(view);
geom::Vec3List vl;
AtomViewList atoms=view.GetAtomList();
vl.reserve(atoms.size());
for (AtomViewList::const_iterator i=atoms.begin(),
e=atoms.end(); i!=e; ++i) {
vl.push_back(i->GetPos());
}
return vl;
}
Real CalculateAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& density_map){
Real sum,v;
sum=0;
CheckHandleValidity(density_map);
for (geom::Vec3List::const_iterator v1=vl.begin(),e=vl.end(); v1!=e; ++v1) {
img::Point p(density_map.CoordToIndex(*v1));
v=density_map.GetReal(p);
sum=sum+v;
}
return sum;
}
}}} //ns
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2011 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
//------------------------------------------------------------------------------
/*
* Niklaus Johner
*/
#ifndef OST_STRUCTURE_ANALYSIS_HH
#define OST_STRUCTURE_ANALYSIS_HH
#include <ost/mol/alg/module_config.hh>
#include <ost/mol/entity_view.hh>
#include <ost/img/map.hh>
namespace ost { namespace mol { namespace alg {
geom::Vec3List DLLEXPORT_OST_MOL_ALG GetPosListFromView(const EntityView& view);
Real DLLEXPORT_OST_MOL_ALG CalculateAgreementWithDensityMap(const geom::Vec3List& vl, img::MapHandle& density_map);
}}}//ns
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment