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

make mhandle in ElEnumerador const

Instead of directly modifying the mhandle, the result gets returned as
a list of indices
parent e5a93e08
Branches
Tags
No related merge requests found
...@@ -26,9 +26,10 @@ candidates each, this already gives 100000 set loop scoring environment calls ...@@ -26,9 +26,10 @@ candidates each, this already gives 100000 set loop scoring environment calls
and 100000 loop scoring calls. ElEnumerador tries to solve the problem in and 100000 loop scoring calls. ElEnumerador tries to solve the problem in
a more clever approach. It first generates an interaction graph of which a more clever approach. It first generates an interaction graph of which
locations actually have candidates that interact (If any of the candidates locations actually have candidates that interact (If any of the candidates
have a CA distances closer than 10A). This graph gets then decomposed into have a CA distances closer than a specified threshold).
a minimal width tree and solved in a similar manner as in the sidechain This graph gets then decomposed into a minimal width tree and solved in a
modelling problem. This typically massively reduces the problem size by solving similar manner as in the sidechain modelling problem.
This typically massively reduces the problem size by solving
small subproblems and allows to tackle larger problems in a feasible amount small subproblems and allows to tackle larger problems in a feasible amount
of computing time. Despite massively reducing the amount of loop scoring of computing time. Despite massively reducing the amount of loop scoring
and set environment calls, we still need to define an upper bound of computation and set environment calls, we still need to define an upper bound of computation
...@@ -43,39 +44,41 @@ considers the already set environment and no pairwise interactions to other ...@@ -43,39 +44,41 @@ considers the already set environment and no pairwise interactions to other
loops. A global optimum is therefore not guaranteed, but still very likely. loops. A global optimum is therefore not guaranteed, but still very likely.
.. method:: ElEnumerador(mhandle, gaps, loop_candidates, all_atom_scores,\ .. method:: ElEnumerador(mhandle, gaps, loop_candidates, all_atom_scores,\
[max_pruning_iterations=100, max_complexity=1000000]) [max_complexity=1000000, distance_thresh=10.0])
Searches the loops in **loop_candidates** with their exact locations defined Searches the loops in **loop_candidates** with their exact locations defined
in **gaps** that optimize the score given predefined scorer and weights. in **gaps** that optimize the score given a scoring environment built from the
current model attached to **mhandle** and an internally loaded default scorer
with default weights.
The scores can either be backbone only or also consider all atom scores if The scores can either be backbone only or also consider all atom scores if
the according flag is set to true. Please note, that this has a massive impact the according flag is set to true. Please note, that this has a massive impact
on runtime! The algorithm performs a maximum of on runtime! The algorithm performs pruning iterations
**max_pruning_iterations** of the previously described pruning iterations
until every connected component in the interaction graph can be solved with until every connected component in the interaction graph can be solved with
the number of required loop scoring calls being lower than **max_complexity**. the number of required loop scoring calls being lower than **max_complexity**.
There is no guarantee that this is achieved (but it's super likely).
In case of success, the algorithm updates **mhandle** with its attached model, :param mhandle: Handle with valid model attached. This handle is treated
gap list and scoring environments. as const
:param mhandle: A handle with valid scorer attached, that contains
all scores for which you defined a weight in
**weights**
:param gaps: A list of gaps specifying the loop locations :param gaps: A list of gaps specifying the loop locations
:param loop_candidates: A list of :class:`LoopCandidates` objects defining :param loop_candidates: A list of :class:`LoopCandidates` objects defining
loops at different locations. loops at different locations.
:param all_atom_scores: Whether to use all atom scores or go for backbone only :param all_atom_scores: Whether to use all atom scores or go for backbone only
:param max_pruning_iterations: Maximum number of pruning iterations before :param max_complexity: Pruning gets performed until every connected component
giving up in the interaction graph can be solved with scoring
:param max_complexity: Pruning gets performed until steps below this threshold.
:param distance_thresh: If any loop of two LoopCandidates objects has a
pairwise CA distance below this thresh, they're
considered to interact. Use with care, this has
an impact on the problem complexity if increased.
:type mhandle: :class:`ModellingHandle` :type mhandle: :class:`ModellingHandle`
:type gaps: :class:`StructuralGapList` :type gaps: :class:`StructuralGapList`
:type loop_candidates: :class:`list` :type loop_candidates: :class:`list`
:type all_atom_scores: :class:`bool` :type all_atom_scores: :class:`bool`
:type max_pruning_iterations: :class:`int`
:type max_complexity: :class:`int` :type max_complexity: :class:`int`
:type distance_thresh: :class:`float`
:returns: A :class:`list` of :class:`int` specifying the optimal loop in every
item of **loop_candidates**
Rigid Blocks Rigid Blocks
......
...@@ -8,25 +8,28 @@ using namespace promod3::modelling; ...@@ -8,25 +8,28 @@ using namespace promod3::modelling;
namespace{ namespace{
void WrapEnumerador(ModellingHandle& mhandle, boost::python::list WrapEnumerador(ModellingHandle& mhandle,
const StructuralGapList& gaps, const StructuralGapList& gaps,
const boost::python::list& loop_candidates, const boost::python::list& loop_candidates,
bool all_atom, bool all_atom,
uint max_pruning_iterations, uint max_complexity,
uint max_complexity){ Real distance_thresh){
std::vector<promod3::modelling::LoopCandidatesPtr> v_loop_candidates; std::vector<promod3::modelling::LoopCandidatesPtr> v_loop_candidates;
promod3::core::ConvertListToVector(loop_candidates, v_loop_candidates); promod3::core::ConvertListToVector(loop_candidates, v_loop_candidates);
std::vector<uint> v_result =
promod3::modelling::ElEnumerador(mhandle, gaps, v_loop_candidates, promod3::modelling::ElEnumerador(mhandle, gaps, v_loop_candidates,
all_atom, max_pruning_iterations, all_atom, max_complexity,
max_complexity); distance_thresh);
}
}
boost::python::list result;
promod3::core::AppendVectorToList(v_result, result);
return result;
}
}
void export_el_enumerador(){ void export_el_enumerador(){
...@@ -35,7 +38,7 @@ void export_el_enumerador(){ ...@@ -35,7 +38,7 @@ void export_el_enumerador(){
arg("gaps"), arg("gaps"),
arg("loop_candidates"), arg("loop_candidates"),
arg("all_atom_scores") = false, arg("all_atom_scores") = false,
arg("max_pruning_iterations") = 100, arg("max_complexity")=1000000,
arg("max_complexity")=1000000)); arg("distance_thresh")=10.0));
} }
\ No newline at end of file
This diff is collapsed.
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
namespace promod3 { namespace modelling { namespace promod3 { namespace modelling {
void ElEnumerador(ModellingHandle& mhandle, std::vector<uint> ElEnumerador(const ModellingHandle& mhandle,
const StructuralGapList& gaps, const StructuralGapList& gaps,
std::vector<LoopCandidatesPtr>& loop_candidates, const std::vector<LoopCandidatesPtr>& loop_candidates,
bool all_atom_scores = false, bool all_atom_scores = false,
uint max_pruning_iterations = 100, uint max_complexity = 10000000,
uint max_complexity = 10000000); Real distance_thresh = 10.0);
}} //ns }} //ns
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment